Merge from mainline
[official-gcc.git] / libjava / classpath / examples / Makefile.am
blobdb6cac0d6862d9a3b71708e548657d845d33625a
1 ## Input file for automake to generate the Makefile.in used by configure
3 # Setup the compiler to use the GNU Classpath library we just build
4 if FOUND_GCJ
5 JCOMPILER = $(GCJ) --bootclasspath '$(top_builddir)/lib' --classpath . -C
6 else
7 if FOUND_JIKES
8 JCOMPILER = $(JIKES) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(top_builddir)/lib:.
9 else
10 if FOUND_GCJX
11 JCOMPILER = $(GCJX) -bootclasspath '' -sourcepath '' -classpath $(top_builddir)/lib:.
12 else
13 if FOUND_ECJ
14 JCOMPILER = $(ECJ) -bootclasspath '$(top_builddir)/lib' -classpath .
15 else
16 error dunno how to setup the JCOMPILER and compile
17 endif
18 endif
19 endif
20 endif
22 # All our example java source files
23 EXAMPLE_JAVA_FILES = $(srcdir)/gnu/classpath/examples/*/*.java $(srcdir)/gnu/classpath/examples/*/*/*.java $(srcdir)/gnu/classpath/examples/*/*/*/*.java
25 # The example C source files
26 EXAMPLE_C_FILES = $(srcdir)/gnu/classpath/examples/*/*.c
28 # The zip files with classes we want to produce.
29 EXAMPLE_ZIP = examples.zip
31 # Extra objects that will not exist until configure-time
32 BUILT_SOURCES = $(EXAMPLE_ZIP)
34 # the png icons we use in some of the examples.
35 EXAMPLE_ICONS = $(srcdir)/gnu/classpath/examples/icons/*.png
37 # The example specific README files.
38 READMES = $(srcdir)/gnu/classpath/examples/CORBA/swing/README.html
40 # All the files we find "interesting"
41 ALL_EXAMPLE_FILES = $(EXAMPLE_JAVA_FILES) $(EXAMPLE_C_FILES) $(EXAMPLE_ICONS) $(READMES)
43 # Some architecture independent data to be installed.
44 example_DATA = $(EXAMPLE_ZIP) README
46 # Where we want these data files installed.
47 exampledir = $(pkgdatadir)/examples
49 # Make sure all sources and icons are also installed so users can use them.
50 # (Be careful to strip off the srcdir part of the path when installing.)
51 install-data-local:
52         srcdir_cnt=`echo $(srcdir) | wc -c`; \
53         for file in $(ALL_EXAMPLE_FILES); do \
54           f=`echo $$file | cut -c$$srcdir_cnt-`; \
55           fdir=`dirname $$f`; \
56           if test ! -d $(DESTDIR)$(pkgdatadir)/examples/$$fdir; then \
57             echo "$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/examples/$$fdir"; \
58             $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/examples/$$fdir; \
59           fi; \
60           echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/examples/$$f"; \
61           $(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/examples/$$f; \
62         done
63         echo "$(INSTALL_DATA) Makefile.jawt $(DESTDIR)$(pkgdatadir)/examples/"
64         $(INSTALL_DATA) Makefile.jawt $(DESTDIR)$(pkgdatadir)/examples/
66 uninstall-local:
67         srcdir_cnt=`echo $(srcdir) | wc -c`; \
68         for file in $(ALL_EXAMPLE_FILES); do \
69           f=`echo $$file | cut -c$$srcdir_cnt-`; \
70           echo "rm -f $(DESTDIR)$(pkgdatadir)/examples/$$f"; \
71           rm -f $(DESTDIR)$(pkgdatadir)/examples/$$f; \
72         done
73         echo "rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.jawt"
74         rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.jawt
76 # Make sure everything is included in the distribution.
77 EXTRA_DIST = README Makefile.jawt.in
78 dist-hook:
79         srcdir_cnt=`echo $(srcdir) | wc -c`; \
80         for file in $(ALL_EXAMPLE_FILES); do \
81           f=`echo $$file | cut -c$$srcdir_cnt-`; \
82           fdir=`dirname $$f`; \
83           if test ! -d $(distdir)/$$fdir; then \
84             echo "$(makeinstalldirs) $(distdir)/$$fdir"; \
85             $(mkinstalldirs) $(distdir)/$$fdir; \
86           fi; \
87           echo "cp -p $$file $(distdir)/$$f"; \
88           cp -p $$file $(distdir)/$$f; \
89         done
91 # To generate the example zip just depend on the sources and ignore the
92 # class files. Always regenerate all .class files and remove them immediatly.
93 # And copy the png icons we use to the classes dir so they get also included.
94 $(EXAMPLE_ZIP): $(EXAMPLE_JAVA_FILES)
95         mkdir -p classes/gnu/classpath/examples/icons
96         cp $(EXAMPLE_ICONS) classes/gnu/classpath/examples/icons
97         $(JCOMPILER) -d classes $(EXAMPLE_JAVA_FILES) 
98         cd classes; $(ZIP) -r ../$(EXAMPLE_ZIP) .; cd ..
99         rm -rf classes
101 # Zip file be gone! (and make sure the classes are gone too)
102 clean-local:
103         rm -rf $(EXAMPLE_ZIP) classes