Add dist target.
[busymon] / Makefile
1
2 VERSION=-0
3
4 JAVAFX_HOME=/usr/lib64/javafx-sdk-13
5
6 CFLAGS=-Wall -Wno-parentheses
7 CPPFLAGS=
8 LDLIBS=-lX11 -lXext -lXss
9
10 prefix ?= /usr/local
11
12 notzed.busyalert_JAVA=                                          \
13  java/notzed.busyalert/module-info.java                         \
14  java/notzed.busyalert/au/notzed/busyalert/BusyAlert.java
15
16 all: bin/busymon bin/notzed.busyalert.jar
17
18 bin/busymon.o: src/busymon.c
19 bin/busymon: bin/busymon.o
20
21 bin/%.o: src/%.c
22         mkdir -p bin
23         $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
24
25 bin/notzed.busyalert.jar: bin/.classes
26         jar -c -f $(@) -M -C bin/modules/notzed.busyalert .
27
28 bin/.classes: $(notzed.busyalert_JAVA)
29         javac --module-source-path "java/*" -d bin/modules -m notzed.busyalert --module-path $(JAVAFX_HOME)/lib
30         touch $@
31
32 clean:
33         rm -rf bin
34
35 install: bin/notzed.busyalert.jar bin/busymon
36         sed -e 's,@JAVAFX_HOME@,$(JAVAFX_HOME),g' \
37             -e 's,@MODULE_DIR@,$(DESTDIR)$(prefix)/share/notzed.busyalert,g' \
38            < src/busyalert.in > bin/busyalert
39         chmod 755 bin/busyalert
40         install -D bin/busyalert $(DESTDIR)$(prefix)/share/notzed.busyalert/busyalert
41         install -D bin/notzed.busyalert.jar $(DESTDIR)$(prefix)/share/notzed.busyalert/notzed.busyalert.jar
42         install -D bin/busymon $(DESTDIR)$(prefix)/bin/busymon
43
44 dist:
45         tar cfz busymon$(VERSION).tar.gz \
46         --xform 's@^@busymon$(VERSION)/@' \
47         COPYING README Makefile \
48         src/busyalert.in src/busymon.c \
49         $(notzed.busyalert_JAVA) \
50         contrib
51