-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
71 lines (55 loc) · 1.84 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
#!/usr/bin/make -f
CC ?= gcc
CFLAGS ?= -O2
CPPFLAGS ?=
LDFLAGS ?=
JAVA_HOME ?=/usr/lib/jvm/default-java
UNAME_S ?=$(shell uname -s | tr '[:upper:]' '[:lower:]')
LIBNAME =libthesiaslib
SOVERSION =0
SONAME =${LIBNAME}.so.${SOVERSION}
CFLAGS += -fPIC -I${JAVA_HOME}/include -I${JAVA_HOME}/include/${UNAME_S}/
CPPFLAGS +=
LDFLAGS += -shared -fPIC
ifeq ($(UNAME_S), darwin)
LDFLAGS += -Wl,-install_name,${SONAME}
else
LDFLAGS += -Wl,-soname,${SONAME}
endif
export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
PREFIX = /usr
all: thesias
thesias: libthesiaslib.so thesias.jar
libthesiaslib.so:
${CC} ${CPPFLAGS} ${CFLAGS} -c src/*.c
${CC} ${LDFLAGS} *.o -o ${SONAME}
thesias.jar:
javac -d class java/*.java
jar cfe thesias.jar GraficT -C class . -C misc LogoThesias.png
.PHONY: clean install uninstall
install:
install -d $(DESTDIR)$(PREFIX)/lib/jni/
install ${SONAME} $(DESTDIR)$(PREFIX)/lib/jni/
install -d $(DESTDIR)$(PREFIX)/share/java/
install thesias.jar $(DESTDIR)$(PREFIX)/share/java/
install -d $(DESTDIR)$(PREFIX)/bin/
install misc/THESIAS $(DESTDIR)$(PREFIX)/bin/
install -d $(DESTDIR)$(PREFIX)/share/man/man1/
install misc/THESIAS.1 $(DESTDIR)$(PREFIX)/share/man/man1/
install misc/THESIAS.desktop $(DESTDIR)$(PREFIX)/share/applications/
install misc/THESIAS_icon.svg $(DESTDIR)$(PREFIX)/share/pixmaps/
ln -s $(DESTDIR)$(PREFIX)/lib/jni/${SONAME} $(DESTDIR)$(PREFIX)/lib/jni/${LIBNAME}.so
uninstall:
rm -f $(DESTDIR)$(PREFIX)/lib/jni/${SONAME}
rm -f $(DESTDIR)$(PREFIX)/lib/jni/${LIBNAME}.so
rm -f $(DESTDIR)$(PREFIX)/share/java/thesias.jar
rm -f $(DESTDIR)$(PREFIX)/bin/THESIAS
rm -f $(DESTDIR)$(PREFIX)/share/man/man1/THESIAS.1
rm -f $(DESTDIR)$(PREFIX)/share/applications/THESIAS.desktop
rm -f $(DESTDIR)$(PREFIX)/share/pixmaps/THESIAS_icon.svg
clean:
rm -f *.o
rm -f *.so
rm -f *.so.*
rm -f *.jar
rm -rf class/