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