-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
36 lines (27 loc) · 980 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
ANT := ant
INSTALL := install
GIT_DIR := $(CURDIR)/git
BUILD_DIR := $(CURDIR)/build
DESTDIR := /
PREFIX := /usr/local
LIBEXEC_DIR := $(DESTDIR)$(PREFIX)/lib
GITCORE_DIR := $(LIBEXEC_DIR)/git-core
GIT_MAKE_ARGS :=
JAVA_HOME := $(shell javac="$$(which javac)"; [ ! -h "$$javac" ] || javac="$$(readlink -f $$javac)"; dirname "$$(dirname "$$javac")")
all: build-git build-git-st build-native
build-git:
echo $(JAVA_HOME)
cd "$(GIT_DIR)" && $(MAKE) $(GIT_MAKE_ARGS) CFLAGS="-g -O2 -Wall -fPIC" libgit.a xdiff/lib.a
build-git-st:
JAVA_HOME="$(JAVA_HOME)" $(ANT) jar
build-native:
cd $(CURDIR)/src/native && \
make JAVA_HOME="$(JAVA_HOME)" GIT_DIR="$(GIT_DIR)" BUILD_DIR="$(BUILD_DIR)"
install:
$(INSTALL) -d "$(GITCORE_DIR)"
$(INSTALL) -m 755 "$(CURDIR)"/bin/* "$(GITCORE_DIR)"
$(INSTALL) -m 644 "$(BUILD_DIR)"/*.jar "$(GITCORE_DIR)"
$(INSTALL) -m 644 "$(BUILD_DIR)"/*.so "$(GITCORE_DIR)"
clean:
cd "$(GIT_DIR)" && $(MAKE) clean
JAVA_HOME="$(JAVA_HOME)" $(ANT) clean