OSDN Git Service

Merged gcj-eclipse branch to trunk.
[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':'$(top_builddir)/tools/tools.zip'
3
4 # Setup the compiler to use the GNU Classpath library we just build
5 #if FOUND_GCJ
6 #JCOMPILER = $(GCJ) --bootclasspath '$(top_builddir)/lib' --classpath . -C
7 #else
8 #if FOUND_JIKES
9 #JCOMPILER = $(JIKES) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(top_builddir)/lib:.
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) -1.5 -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 & header files
27 EXAMPLE_C_FILES = $(srcdir)/gnu/classpath/examples/*/*.c
28 EXAMPLE_CH_FILES = $(srcdir)/gnu/classpath/examples/*/*.h
29
30 # The zip files with classes we want to produce.
31 EXAMPLE_ZIP = examples.zip
32
33 # Extra objects that will not exist until configure-time
34 BUILT_SOURCES = $(EXAMPLE_ZIP)
35
36 # the png icons we use in some of the examples.
37 EXAMPLE_ICONS = $(srcdir)/gnu/classpath/examples/icons/*.png
38
39 # the html pages we use in the swing demo example.
40 EXAMPLE_HTML = $(srcdir)/gnu/classpath/examples/swing/*.html
41
42 # The example specific README files.
43 READMES = $(srcdir)/gnu/classpath/examples/CORBA/swing/README.html
44
45 # All the files we find "interesting"
46 ALL_EXAMPLE_FILES = $(EXAMPLE_JAVA_FILES) $(EXAMPLE_C_FILES) $(EXAMPLE_CH_FILES) $(EXAMPLE_ICONS) $(EXAMPLE_HTML) $(READMES)
47
48 # Some architecture independent data to be installed.
49 example_DATA = $(EXAMPLE_ZIP) README
50
51 # Where we want these data files installed.
52 exampledir = $(pkgdatadir)/examples
53
54 # Make sure all sources and icons are also installed so users can use them.
55 # (Be careful to strip off the srcdir part of the path when installing.)
56 install-data-local:
57         srcdir_cnt=`echo $(srcdir) | wc -c`; \
58         for file in $(ALL_EXAMPLE_FILES); do \
59           f=`echo $$file | cut -c$$srcdir_cnt-`; \
60           fdir=`dirname $$f`; \
61           if test ! -d $(DESTDIR)$(pkgdatadir)/examples/$$fdir; then \
62             echo "$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/examples/$$fdir"; \
63             $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/examples/$$fdir; \
64           fi; \
65           echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/examples/$$f"; \
66           $(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/examples/$$f; \
67         done
68         echo "$(INSTALL_DATA) Makefile.jawt $(DESTDIR)$(pkgdatadir)/examples/"
69         echo "$(INSTALL_DATA) Makefile.java2d $(DESTDIR)$(pkgdatadir)/examples/"
70         $(INSTALL_DATA) Makefile.jawt $(DESTDIR)$(pkgdatadir)/examples/
71         $(INSTALL_DATA) Makefile.java2d $(DESTDIR)$(pkgdatadir)/examples/
72
73 uninstall-local:
74         srcdir_cnt=`echo $(srcdir) | wc -c`; \
75         for file in $(ALL_EXAMPLE_FILES); do \
76           f=`echo $$file | cut -c$$srcdir_cnt-`; \
77           echo "rm -f $(DESTDIR)$(pkgdatadir)/examples/$$f"; \
78           rm -f $(DESTDIR)$(pkgdatadir)/examples/$$f; \
79         done
80         echo "rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.jawt"
81         echo "rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.java2d"
82         rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.jawt
83         rm -f $(DESTDIR)$(pkgdatadir)/examples/Makefile.java2d
84
85 # Make sure everything is included in the distribution.
86 EXTRA_DIST = README Makefile.jawt.in Makefile.java2d.in
87 dist-hook:
88         srcdir_cnt=`echo $(srcdir) | wc -c`; \
89         for file in $(ALL_EXAMPLE_FILES); do \
90           f=`echo $$file | cut -c$$srcdir_cnt-`; \
91           fdir=`dirname $$f`; \
92           if test ! -d $(distdir)/$$fdir; then \
93             echo "$(makeinstalldirs) $(distdir)/$$fdir"; \
94             $(mkinstalldirs) $(distdir)/$$fdir; \
95           fi; \
96           echo "cp -p $$file $(distdir)/$$f"; \
97           cp -p $$file $(distdir)/$$f; \
98         done
99
100 # To generate the example zip just depend on the sources and ignore the
101 # class files. Always regenerate all .class files and remove them immediatly.
102 # And copy the png icons we use to the classes dir so they get also included.
103 $(EXAMPLE_ZIP): $(EXAMPLE_JAVA_FILES)
104         mkdir -p classes/gnu/classpath/examples/icons
105         cp $(EXAMPLE_ICONS) classes/gnu/classpath/examples/icons
106         mkdir -p classes/gnu/classpath/examples/swing
107         cp $(EXAMPLE_HTML) classes/gnu/classpath/examples/swing
108         $(JCOMPILER) -d classes $(EXAMPLE_JAVA_FILES) 
109         (cd classes; \
110         if test "$(ZIP)" != ""; then $(ZIP) -r ../$(EXAMPLE_ZIP) .; fi; \
111         if test "$(FASTJAR)" != ""; then $(FASTJAR) cf ../$(EXAMPLE_ZIP) .; fi; \
112         cd ..)
113         rm -rf classes
114
115 # Zip file be gone! (and make sure the classes are gone too)
116 clean-local:
117         rm -rf $(EXAMPLE_ZIP) classes