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