You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

104 line
2.7 KiB

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