X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=natives%2FMakefile;h=19ffac44438a330b8104251bdf30dc86bc5d7e0c;hb=123453c89af0440afb52064a0980024c135185fd;hp=b58e400672c0e222c313ab4583d07fb7b872ee46;hpb=a7221f6d65748e2c681e94e905615b4e576b75a5;p=gigi.git diff --git a/natives/Makefile b/natives/Makefile index b58e4006..19ffac44 100644 --- a/natives/Makefile +++ b/natives/Makefile @@ -1,11 +1,17 @@ +JAVA_HOME=/usr/lib/jvm/default-java SYSTEM= $(shell uname | awk '{print tolower($$0)}') +JAVAH?=javah +CC?=gcc +CFLAGS?=-O3 -g -flto -Wall -Werror -Wextra -pedantic -fPIC +CFLAGS+=-I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/$(SYSTEM) +LDFLAGS?=-shared all: libsetuid.so -libsetuid.so: - javah -classpath ../bin/ -jni org.cacert.gigi.natives.SetUID - gcc -fPIC -o libsetuid.so -shared -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/$(SYSTEM) org_cacert_gigi_natives_SetUID.c +libsetuid.so: org_cacert_gigi_natives_SetUID.c + $(JAVAH) -classpath ../bin/ -jni org.cacert.gigi.natives.SetUID && \ + $(CC) $(CFLAGS) $(LDFLAGS) -o libsetuid.so org_cacert_gigi_natives_SetUID.c clean: rm -f *.so