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

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

Large source code cleanup, getting rid of spaces, tabs, and svn keywords.

File size: 2.7 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
42JAVAH_FLAGS = -d . -classpath .
43
44$(java_jni_classes): $(java_src)
45        $(JAVAC) -d . $(java_src)
46        $(JAR) -cf $(java_jar) org
47
48# Javah does not update the file if it detects that there is nothing to do,
49# hence the `touch` so that javah is not run at every `make`.
50
51org_zoy_caca_Attribute.h: org/zoy/caca/Attribute.class
52        $(JAVAH) $(JAVAH_FLAGS) org.zoy.caca.Attribute
53        @touch org_zoy_caca_Attribute.h
54
55org_zoy_caca_Caca.h: org/zoy/caca/Caca.class
56        $(JAVAH) $(JAVAH_FLAGS) org.zoy.caca.Caca
57        @touch org_zoy_caca_Caca.h
58
59org_zoy_caca_Canvas.h: org/zoy/caca/Canvas.class
60        $(JAVAH) $(JAVAH_FLAGS) org.zoy.caca.Canvas
61        @touch org_zoy_caca_Canvas.h
62
63org_zoy_caca_Display.h: org/zoy/caca/Display.class
64        $(JAVAH) $(JAVAH_FLAGS) org.zoy.caca.Display
65        @touch org_zoy_caca_Display.h
66
67org_zoy_caca_Dither.h: org/zoy/caca/Dither.class
68        $(JAVAH) $(JAVAH_FLAGS) org.zoy.caca.Dither
69        @touch org_zoy_caca_Dither.h
70
71org_zoy_caca_Event.h: org/zoy/caca/Event.class
72        $(JAVAH) $(JAVAH_FLAGS) org.zoy.caca.Event
73        @touch org_zoy_caca_Event.h
74
75org_zoy_caca_Font.h: org/zoy/caca/Font.class
76        $(JAVAH) $(JAVAH_FLAGS) org.zoy.caca.Font
77        @touch org_zoy_caca_Font.h
78
79CLEANFILES = $(noinst_DATA) $(java_jar) \
80             org/zoy/caca/*.class org_zoy_caca_[A-Z]*.h
81EXTRA_DIST = README
82
83if USE_JAVA
84BUILT_SOURCES = $(java_jni_headers) $(java_jni_classes)
85endif
86
87libcaca_java_la_CPPFLAGS = $(JAVA_CFLAGS)
88libcaca_java_la_SOURCES = \
89  caca_java_common.h   \
90  caca_java_common.c   \
91  $(java_jni_src)
92#nodist_libcaca_java_la_SOURCES = \
93#  $(java_jni_headers)
94libcaca_java_la_LDFLAGS = -shared $(JAVA_LIBS)
95libcaca_java_la_LIBADD = ../caca/libcaca.la
96
97examples/Driver.class: examples/Driver.java
98        $(JAVAC) $^
99
100examples/TrueColor.class: examples/TrueColor.java
101        $(JAVAC) $^
102
Note: See TracBrowser for help on using the repository browser.