source: libcaca/trunk/java/Makefile.am @ 4338

Last change on this file since 4338 was 4338, checked in by Sam Hocevar, 10 years ago

Fix distribution of Java source.

File size: 3.1 KB
Line 
1
2jnidir = $(libdir)/jni
3libcaca_javadir = $(datadir)/java
4
5java_jar = libjava.jar
6
7if USE_JAVA
8jni_LTLIBRARIES = libcaca-java.la
9libcaca_java_DATA = $(java_jar)
10noinst_DATA = examples/Driver.class examples/TrueColor.class
11endif
12
13java_src = $(wildcard $(srcdir)/org/zoy/caca/*.java)
14
15java_jni_headers = \
16    org_zoy_caca_Attribute.h \
17    org_zoy_caca_Caca.h \
18    org_zoy_caca_Canvas.h \
19    org_zoy_caca_Display.h \
20    org_zoy_caca_Dither.h \
21    org_zoy_caca_Event.h \
22    org_zoy_caca_Font.h
23
24java_jni_src = \
25    org_zoy_caca_Attribute.c \
26    org_zoy_caca_Caca.c \
27    org_zoy_caca_Canvas.c \
28    org_zoy_caca_Display.c \
29    org_zoy_caca_Dither.c \
30    org_zoy_caca_Event.c \
31    org_zoy_caca_Font.c
32
33java_jni_classes = \
34    org/zoy/caca/Attribute.class \
35    org/zoy/caca/Caca.class \
36    org/zoy/caca/Canvas.class \
37    org/zoy/caca/Display.class \
38    org/zoy/caca/Dither.class \
39    org/zoy/caca/Event.class \
40    org/zoy/caca/Font.class
41
42java_jni_java = \
43    org/zoy/caca/CacaException.java \
44    org/zoy/caca/Caca.java \
45    org/zoy/caca/NativeObject.java \
46    org/zoy/caca/Dither.java \
47    org/zoy/caca/Canvas.java \
48    org/zoy/caca/CacaObject.java \
49    org/zoy/caca/Font.java \
50    org/zoy/caca/Attribute.java \
51    org/zoy/caca/Color.java \
52    org/zoy/caca/Event.java \
53    org/zoy/caca/TimeoutException.java \
54    org/zoy/caca/Display.java
55
56JAVAH_FLAGS = -d . -classpath .
57
58$(java_jni_classes): $(java_src)
59        $(JAVAC) -d . $(java_src)
60        $(JAR) -cf $(java_jar) org
61
62# Javah does not update the file if it detects that there is nothing to do,
63# hence the `touch` so that javah is not run at every `make`.
64
65org_zoy_caca_Attribute.h: org/zoy/caca/Attribute.class
66        $(JAVAH) $(JAVAH_FLAGS) org.zoy.caca.Attribute
67        @touch org_zoy_caca_Attribute.h
68
69org_zoy_caca_Caca.h: org/zoy/caca/Caca.class
70        $(JAVAH) $(JAVAH_FLAGS) org.zoy.caca.Caca
71        @touch org_zoy_caca_Caca.h
72
73org_zoy_caca_Canvas.h: org/zoy/caca/Canvas.class
74        $(JAVAH) $(JAVAH_FLAGS) org.zoy.caca.Canvas
75        @touch org_zoy_caca_Canvas.h
76
77org_zoy_caca_Display.h: org/zoy/caca/Display.class
78        $(JAVAH) $(JAVAH_FLAGS) org.zoy.caca.Display
79        @touch org_zoy_caca_Display.h
80
81org_zoy_caca_Dither.h: org/zoy/caca/Dither.class
82        $(JAVAH) $(JAVAH_FLAGS) org.zoy.caca.Dither
83        @touch org_zoy_caca_Dither.h
84
85org_zoy_caca_Event.h: org/zoy/caca/Event.class
86        $(JAVAH) $(JAVAH_FLAGS) org.zoy.caca.Event
87        @touch org_zoy_caca_Event.h
88
89org_zoy_caca_Font.h: org/zoy/caca/Font.class
90        $(JAVAH) $(JAVAH_FLAGS) org.zoy.caca.Font
91        @touch org_zoy_caca_Font.h
92
93CLEANFILES = $(noinst_DATA) $(java_jar) \
94             org/zoy/caca/*.class org_zoy_caca_[A-Z]*.h
95EXTRA_DIST = README $(java_jni_java) \
96             examples/Driver.java examples/TrueColor.java
97
98if USE_JAVA
99BUILT_SOURCES = $(java_jni_headers) $(java_jni_classes)
100endif
101
102libcaca_java_la_CPPFLAGS = $(JAVA_CFLAGS)
103libcaca_java_la_SOURCES = \
104  caca_java_common.h   \
105  caca_java_common.c   \
106  $(java_jni_src)
107#nodist_libcaca_java_la_SOURCES = \
108#  $(java_jni_headers)
109libcaca_java_la_LDFLAGS = -shared $(JAVA_LIBS)
110libcaca_java_la_LIBADD = ../caca/libcaca.la
111
112examples/Driver.class: examples/Driver.java
113        $(JAVAC) $^
114
115examples/TrueColor.class: examples/TrueColor.java
116        $(JAVAC) $^
117
Note: See TracBrowser for help on using the repository browser.