Makefile.am 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. ## Input file for automake to generate the Makefile.in used by configure
  2. GLIBJ_CLASSPATH='$(top_builddir)/lib/glibj.zip:$(top_builddir)/lib'
  3. if GCJ_JAVAC
  4. JCOMPILER = $(JAVAC) $(JAVACFLAGS) -fsource=1.5 -ftarget=1.5 --encoding=UTF-8 --bootclasspath=$(GLIBJ_CLASSPATH) --classpath='$(top_builddir)/tools/tools.zip'
  5. else
  6. JCOMPILER = $(JAVAC) $(JAVACFLAGS) -source 1.5 -target 1.5 -encoding UTF-8 -bootclasspath $(GLIBJ_CLASSPATH) -classpath '$(top_builddir)/tools/tools.zip'
  7. endif
  8. # All our example java source files
  9. EXAMPLE_JAVA_FILES = $(srcdir)/gnu/classpath/examples/*/*.java $(srcdir)/gnu/classpath/examples/*/*/*.java $(srcdir)/gnu/classpath/examples/*/*/*/*.java
  10. # The example C source & header files
  11. EXAMPLE_C_FILES = $(srcdir)/gnu/classpath/examples/*/*.c
  12. EXAMPLE_CH_FILES = $(srcdir)/gnu/classpath/examples/*/*.h
  13. # The zip files with classes we want to produce.
  14. EXAMPLE_ZIP = examples.zip
  15. # Extra objects that will not exist until configure-time
  16. BUILT_SOURCES = $(EXAMPLE_ZIP)
  17. # the png icons we use in some of the examples.
  18. EXAMPLE_ICONS = $(srcdir)/gnu/classpath/examples/icons/*.png
  19. EXAMPLE_ICONS += $(srcdir)/gnu/classpath/examples/icons/*.gif
  20. # the html pages we use in the swing demo example.
  21. EXAMPLE_HTML = $(srcdir)/gnu/classpath/examples/swing/*.html
  22. # The example specific README files.
  23. READMES = $(srcdir)/gnu/classpath/examples/CORBA/swing/README.html
  24. # All the files we find "interesting"
  25. ALL_EXAMPLE_FILES = $(EXAMPLE_JAVA_FILES) $(EXAMPLE_C_FILES) $(EXAMPLE_CH_FILES) $(EXAMPLE_ICONS) $(EXAMPLE_HTML) $(READMES)
  26. # Some architecture independent data to be installed.
  27. example_DATA = $(EXAMPLE_ZIP) README
  28. # Where we want these data files installed.
  29. exampledir = $(pkgdatadir)/examples
  30. # Make sure all sources and icons are also installed so users can use them.
  31. # (Be careful to strip off the srcdir part of the path when installing.)
  32. install-data-local:
  33. srcdir_cnt=`echo $(srcdir) | wc -c`; \
  34. for file in $(ALL_EXAMPLE_FILES); do \
  35. f=`echo $$file | cut -c$$srcdir_cnt-`; \
  36. fdir=`dirname $$f`; \
  37. if test ! -d $(DESTDIR)$(pkgdatadir)/examples/$$fdir; then \
  38. echo "$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/examples/$$fdir"; \
  39. $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/examples/$$fdir; \
  40. fi; \
  41. echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/examples/$$f"; \
  42. $(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/examples/$$f; \
  43. done
  44. echo "$(INSTALL_DATA) Makefile.jawt $(DESTDIR)$(pkgdatadir)/examples/"
  45. echo "$(INSTALL_DATA) Makefile.java2d $(DESTDIR)$(pkgdatadir)/examples/"
  46. $(INSTALL_DATA) Makefile.jawt $(DESTDIR)$(pkgdatadir)/examples/
  47. $(INSTALL_DATA) Makefile.java2d $(DESTDIR)$(pkgdatadir)/examples/
  48. uninstall-local:
  49. srcdir_cnt=`echo $(srcdir) | wc -c`; \
  50. for file in $(ALL_EXAMPLE_FILES); do \
  51. f=`echo $$file | cut -c$$srcdir_cnt-`; \
  52. echo "rm -f $(DESTDIR)$(pkgdatadir)/examples/$$f"; \
  53. rm -f $(DESTDIR)$(pkgdatadir)/examples/$$f; \
  54. done
  55. echo "rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.jawt"
  56. echo "rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.java2d"
  57. rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.jawt
  58. rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.java2d
  59. # Make sure everything is included in the distribution.
  60. EXTRA_DIST = README Makefile.jawt.in Makefile.java2d.in
  61. dist-hook:
  62. srcdir_cnt=`echo $(srcdir) | wc -c`; \
  63. for file in $(ALL_EXAMPLE_FILES); do \
  64. f=`echo $$file | cut -c$$srcdir_cnt-`; \
  65. fdir=`dirname $$f`; \
  66. if test ! -d $(distdir)/$$fdir; then \
  67. echo "$(makeinstalldirs) $(distdir)/$$fdir"; \
  68. $(mkinstalldirs) $(distdir)/$$fdir; \
  69. fi; \
  70. echo "cp -p $$file $(distdir)/$$f"; \
  71. cp -p $$file $(distdir)/$$f; \
  72. done
  73. # To generate the example zip just depend on the sources and ignore the
  74. # class files. Always regenerate all .class files and remove them immediatly.
  75. # And copy the png icons we use to the classes dir so they get also included.
  76. if WITH_JAR
  77. CREATE_EXAMPLE_ZIP=$(JAR) cf ../$(EXAMPLE_ZIP) .
  78. else
  79. CREATE_EXAMPLE_ZIP=$(ZIP) -r ../$(EXAMPLE_ZIP) .
  80. endif
  81. $(EXAMPLE_ZIP): $(EXAMPLE_JAVA_FILES)
  82. @mkdir_p@ classes/gnu/classpath/examples/icons
  83. cp $(EXAMPLE_ICONS) classes/gnu/classpath/examples/icons
  84. @mkdir_p@ classes/gnu/classpath/examples/swing
  85. cp $(EXAMPLE_HTML) classes/gnu/classpath/examples/swing
  86. $(JCOMPILER) -d classes $(EXAMPLE_JAVA_FILES)
  87. (cd classes; \
  88. $(CREATE_EXAMPLE_ZIP); \
  89. cd ..)
  90. rm -rf classes
  91. # Zip file be gone! (and make sure the classes are gone too)
  92. clean-local:
  93. rm -rf $(EXAMPLE_ZIP) classes