From f6ba2ed10f41e5a9fc41eba6a2a610084910458d Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 17 Feb 2013 21:05:42 +0100 Subject: add jni .so to makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 8a9adc0..9f69c97 100644 --- a/Makefile +++ b/Makefile @@ -18,12 +18,15 @@ CPPFLAGS= LDFLAGS= C_FLAGS=$(CFLAGS) $(CPPFLAGS) $(LDFLAGS) +JNI_INCLUDE=-I$${JAVA_HOME}/include +JNI_FLAGS=$(JNI_INCLUDE) -fPIC -shared + JAVA_CLASSES = $(shell find "pure-java" | grep '\.java$$' | sed -e 's_^_bin/_g' -e 's_java$$_class_g') C_OBJS = $(shell find "c" | grep '\.h$$' | sed -e 's_^_bin/_g' -e 's_h$$_o_g') C_BINS = bin/c/sha3sum -all: pure-java c +all: pure-java c java-c-jni pure-java: $(JAVA_CLASSES) @@ -40,6 +43,11 @@ bin/c/%: c/%.c mkdir -p "bin/c" $(CC) $(C_FLAGS) -o "$@" "c/$*".c "c/"*.o +java-c-jni: bin/java-c-jni/SHA3.so +bin/java-c-jni/%.so: java-c-jni/%.c + mkdir -p "bin/java-c-jni" + gcc $(C_FLAGS) $(JNI_FLAGS) "java-c-jni/$*.c" -o "bin/java-c-jni/$*.so" + .PHONY: clean clean: -- cgit v1.2.3-70-g09d2