OSDN Git Service

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