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