-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
122 lines (87 loc) · 2.49 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# This project uses GNU Make as its main build system.
# This is the top-level build file. It sticks to conventions expected by debuild.
# It will call ./gradlew for java related builds.
#
# Usages:
#
# - Build jar and install it to local maven repository:
# make install
#
# - Build generator and generate all sources (including jni headers)
# make gen
#
# - Build and test everything and then run the selected example
# make run
#
ifndef VERSION
VERSION=$(shell ./gradlew cV -q -Prelease.quiet)
endif
ifndef JOBS
JOBS=9
endif
export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
generator_jar = generator/build/libs/generator.jar
gen_source_marker = build/gen-source.marker
gen_header_marker = build/gen-header.marker
jlib = java-gtk/build/libs/java-gtk-$(VERSION).jar
ifdef DESTDIR
# global
install_target = install_global
# DESTDIR path must be absolute, else gradle will ignore this
m2_repo = $(DESTDIR)/usr/share/maven-repo
else
# local
install_target = install_local
m2_repo = $(HOME)/.m2/repository
endif
m2_dir = $(m2_repo)/ch/bailu/java-gtk/
all: $(jlib)
install: $(install_target)
install_local: all uninstall
./gradlew -q publishToMavenLocal -Dmaven.repo.local=$(m2_repo)
install_global: all uninstall
./gradlew -q publishToMavenLocal -Dmaven.repo.local=$(m2_repo) -PjarType=shared
clean:
./gradlew -q clean
- rm -rf build
distclean: FORCE
- rm -rf .gradle
- rm -rf build
- rm -rf java-gtk/build
- rm -rf generator/build
- rm -rf examples/build
- rm -rf ci/debian/build
maintainer-clean: distclean
echo "maintainer-clean"
uninstall:
- rm -r $(m2_dir)
dist:
make install DESTDIR=$(CURDIR)/build/java-gtk-$(VERSION)
cd build && tar -czvf java-gtk-$(VERSION).tar.gz java-gtk-$(VERSION)
dist-nogen:
echo "dist-nogen"
distcheck:
echo "distcheck"
examples: $(jlib)
./gradlew examples:build
run: $(jlib)
./gradlew examples:run
gen: $(gen_source_marker) $(gen_header_marker)
jdoc: $(gen_source_marker)
./gradlew -q java-gtk:javadocJar
jdoc-install: $(jdoc) javadoc
if [ -d javadoc/$(VERSION) ]; then rm -r javadoc/$(VERSION); fi
unzip -q java-gtk/build/libs/java-gtk-javadoc.jar -d javadoc/$(VERSION)
javadoc:
mkdir javadoc
$(jlib): gen FORCE
./gradlew -q java-gtk:build
$(gen_header_marker): $(gen_source_marker)
./gradlew -q java-gtk:classes
mkdir -p build && touch $(gen_header_marker)
$(gen_source_marker): $(generator_jar)
./gradlew -q generator:generate
mkdir -p build && touch $(gen_source_marker)
$(generator_jar): FORCE
./gradlew -q generator:build
FORCE: