aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-09-04 23:47:48 +0200
committerMattias Andrée <maandree@operamail.com>2014-09-04 23:47:48 +0200
commitd061ec06b2356d61f920ee4ecb4afd6c75092059 (patch)
treed892ec9bfb1d0ea5a7ccbe611637a4ea79f14c26 /Makefile
parentmisc (diff)
downloadjlibgamma-d061ec06b2356d61f920ee4ecb4afd6c75092059.tar.gz
jlibgamma-d061ec06b2356d61f920ee4ecb4afd6c75092059.tar.bz2
jlibgamma-d061ec06b2356d61f920ee4ecb4afd6c75092059.tar.xz
generate .h files
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 11 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index a6e8417..bc5c690 100644
--- a/Makefile
+++ b/Makefile
@@ -97,13 +97,16 @@ JAVA_OBJ = AdjustmentMethod CRTC CRTCInformation GammaRamps Libgamma Partition S
AdjustmentMethodCapabilities ConnectorType LibgammaException Ramp SubpixelOrder \
Ramp16 Ramp32 Ramp64 Ramp8 Rampd Rampf
+# Java classes with native functions
+JAVA_H = AdjustmentMethod CRTC GammaRamps LibgammaException Partition Ramp Site
+
.PHONY: all
all: lib
.PHONY: lib
-lib: jar
+lib: jar headers
.PHONY: jar
jar: bin/jlibgamma.jar
@@ -111,6 +114,9 @@ jar: bin/jlibgamma.jar
.PHONY: class
class: $(foreach O,$(JAVA_OBJ),obj/libgamma/$(O).class)
+.PHONY: headers
+headers: $(foreach H,$(JAVA_H),obj/libgamma_$(H).h)
+
bin/jlibgamma.jar: class
@mkdir -p bin
@@ -121,6 +127,10 @@ obj/libgamma/%.class: src/libgamma/%.java
@mkdir -p obj/libgamma
$(JAVAC) $(JAVAC_FLAGS) -cp src -s src -d obj $<
+obj/libgamma_%.h: obj/libgamma/%.class
+ $(JAVAH) -classpath obj -jni -d obj \
+ $$(echo "$<" | sed -e 's:^obj/::' -e 's:.class$$::' | sed -e 's:/:.:g')
+
.PHONY: clean
clean: