From 0415f01cf73d95ac60f6e025db1236c4c65f2ecc Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Sun, 6 Jul 2014 09:30:30 +0200 Subject: [PATCH] chg: Rework the Makefile to use the system defaults where possible --- natives/Makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/natives/Makefile b/natives/Makefile index b58e4006..faf073cd 100644 --- a/natives/Makefile +++ b/natives/Makefile @@ -1,11 +1,16 @@ SYSTEM= $(shell uname | awk '{print tolower($$0)}') +JAVAH?=javah +CC?=gcc +CFLAGS?=-O3 -g -flto -Wall -Werror -Wextra -pedantic -fsanitize=address -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 -- 2.39.2