diff java/jdc/Makefile @ 20:77ca609422f1

- first working build of new java binding
author cslag
date Wed, 30 Mar 2016 02:40:56 +0200
parents 3bfef07b0cd9
children 40a2c4198016
line wrap: on
line diff
--- a/java/jdc/Makefile	Wed Mar 30 02:06:16 2016 +0200
+++ b/java/jdc/Makefile	Wed Mar 30 02:40:56 2016 +0200
@@ -1,4 +1,21 @@
-all:
-	cd org/dyncall/ && javac DC.java
+# should be .jnilib on os x, .dll on windows, etc. @@@
+SO=libjdc.so
+
+build: $(SO)
+
+clean:
+	rm org_dyncall_DC.h || true
+	rm org/dyncall/DC.class || true
+	rm $(SO) || true
+
+$(SO): org_dyncall_DC.h org_dyncall_DC.c
+	# @@@ support different compilers @@@ esp. on windows
+	$(CC) -shared -fPIC -o $@ org_dyncall_DC.c
+
+org_dyncall_DC.h: org/dyncall/DC.class
 	javah org.dyncall.DC
 
+org/dyncall/DC.class:
+	cd org/dyncall/ && javac DC.java
+
+.PHONY: build clean