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

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

Java bindings, courtesy of Adrien Grand <jpountz@dinauz.org>.

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