OSDN Git Service

2006-06-09 Thomas Fitzsimmons <fitzsim@redhat.com>
[pf3gnuchains/gcc-fork.git] / libjava / classpath / tools / Makefile.am
1 ## Input file for automake to generate the Makefile.in used by configure
2
3 GLIBJ_CLASSPATH='$(top_builddir)/lib':'$(top_builddir)/lib/glibj.zip'
4
5 # Setup the compiler to use the GNU Classpath library we just build
6 if FOUND_GCJ
7 JCOMPILER = $(GCJ) -encoding UTF-8 --bootclasspath $(GLIBJ_CLASSPATH) --classpath . -C
8 else
9 if FOUND_JIKES
10 JCOMPILER = $(JIKES) $(JIKESENCODING) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(GLIBJ_CLASSPATH):.
11 else
12 if FOUND_GCJX
13 JCOMPILER = $(GCJX) -encoding UTF-8 -bootclasspath '' -sourcepath '' -classpath $(GLIBJ_CLASSPATH):.
14 else
15 if FOUND_ECJ
16 JCOMPILER = $(ECJ) -encoding UTF-8 -bootclasspath $(GLIBJ_CLASSPATH) -classpath .
17 else
18 error dunno how to setup the JCOMPILER and compile
19 endif
20 endif
21 endif
22 endif
23
24 if CREATE_WRAPPERS
25 bin_SCRIPTS =
26 bin_PROGRAMS = appletviewer jarsigner keytool
27
28 if FOUND_GCJ
29 LIBJVM = -lgcj
30 else
31 if FOUND_CACAO
32 LIBJVM = -ljvm
33 else
34 LIBJVM =
35 endif
36 endif
37
38 appletviewer_SOURCES = toolwrapper.c
39 appletviewer_CFLAGS = -Wall \
40         -DDATA_DIR="\"$(datadir)\"" \
41         -DPACKAGE="\"$(PACKAGE)\"" \
42         -DTOOLNAME="\"appletviewer\""
43 appletviewer_LDFLAGS = -L$(libdir) $(LIBJVM)
44
45 jarsigner_SOURCES = toolwrapper.c
46 jarsigner_CFLAGS = -Wall \
47         -DDATA_DIR="\"$(datadir)\"" \
48         -DPACKAGE="\"$(PACKAGE)\"" \
49         -DTOOLNAME="\"jarsigner\""
50 jarsigner_LDFLAGS = -L$(libdir) $(LIBJVM)
51
52 keytool_SOURCES = toolwrapper.c
53 keytool_CFLAGS = -Wall \
54         -DDATA_DIR="\"$(datadir)\"" \
55         -DPACKAGE="\"$(PACKAGE)\"" \
56         -DTOOLNAME="\"keytool\""
57 keytool_LDFLAGS = -L$(libdir) $(LIBJVM)
58
59 else
60 bin_SCRIPTS = appletviewer jarsigner keytool
61 bin_PROGRAMS =
62 endif
63 EXTRA_DIST = toolwrapper.c appletviewer.in jarsigner.in keytool.in
64
65 # All our example java source files
66 TOOLS_JAVA_FILES = $(srcdir)/gnu/classpath/tools/*.java $(srcdir)/gnu/classpath/tools/*/*.java $(srcdir)/gnu/classpath/tools/*/*/*.java
67
68
69 # The zip files with classes we want to produce.
70 TOOLS_ZIP = tools.zip
71
72 # Extra objects that will not exist until configure-time
73 BUILT_SOURCES = $(TOOLS_ZIP)
74
75 # The templates that must be included into the generated zip file.
76 GRMIC_TEMPLATES = $(srcdir)/gnu/classpath/tools/giop/grmic/templates/*.jav
77 RMIC_TEMPLATES = $(srcdir)/gnu/classpath/tools/rmi/rmic/templates/*.jav
78
79 TOOLS_TEMPLATES = $(GRMIC_TEMPLATES) $(RMIC_TEMPLATES)
80
81 # This covers the built-in help texts, both for giop and rmic subpackages.
82 GIOP_HELPS = $(srcdir)/gnu/classpath/tools/giop/*.txt
83 RMI_HELPS = $(srcdir)/gnu/classpath/tools/rmi/*.txt
84
85 TOOLS_HELPS = $(GIOP_HELPS) $(RMI_HELPS)
86
87 # The tool specific README files.
88 READMES = $(srcdir)/gnu/classpath/tools/giop/README
89
90 # All the files we find "interesting"
91 ALL_TOOLS_FILES = $(TOOLS_JAVA_FILES) $(TOOLS_TEMPLATES) $(TOOLS_HELPS) $(READMES)
92
93 # Some architecture independent data to be installed.
94 TOOLS_DATA = $(TOOLS_ZIP) README
95
96 # Where we want these data files installed.
97 TOOLSdir = $(pkgdatadir)
98
99 # Make sure everything is included in the distribution.
100 dist-hook:
101         srcdir_cnt=`echo $(srcdir) | wc -c`; \
102         for file in $(ALL_TOOLS_FILES); do \
103           f=`echo $$file | cut -c$$srcdir_cnt-`; \
104           fdir=`dirname $$f`; \
105           if test ! -d $(distdir)/$$fdir; then \
106             echo "$(makeinstalldirs) $(distdir)/$$fdir"; \
107             $(mkinstalldirs) $(distdir)/$$fdir; \
108           fi; \
109           echo "cp -p $$file $(distdir)/$$f"; \
110           cp -p $$file $(distdir)/$$f; \
111         done
112
113 # To generate the example zip just depend on the sources and ignore
114 # the class files. Always regenerate all .class files and remove them
115 # immediately.  And copy the template files we use to the classes dir
116 # so they get also included.
117 $(TOOLS_ZIP): $(TOOLS_JAVA_FILES)
118         mkdir -p classes/gnu/classpath/tools/giop/grmic/templates
119         mkdir -p classes/gnu/classpath/tools/rmi/rmic/templates
120         mkdir -p classes/gnu/classpath/tools/appletviewer
121         mkdir -p classes/gnu/classpath/tools/jarsigner
122         mkdir -p classes/gnu/classpath/tools/keytool
123         cp $(RMIC_TEMPLATES) classes/gnu/classpath/tools/rmi/rmic/templates
124         cp $(GRMIC_TEMPLATES) classes/gnu/classpath/tools/giop/grmic/templates
125         cp $(RMI_HELPS) classes/gnu/classpath/tools/rmi/
126         cp $(GIOP_HELPS) classes/gnu/classpath/tools/giop/
127         $(JCOMPILER) -d classes $(TOOLS_JAVA_FILES)
128         (cd classes; \
129         if test "$(ZIP)" != ""; then $(ZIP) -r ../$(TOOLS_ZIP) .; fi; \
130         if test "$(FASTJAR)" != ""; then $(FASTJAR) cf ../$(TOOLS_ZIP) .; fi; \
131         cd ..)
132         rm -rf classes
133
134 # Zip file be gone! (and make sure the classes are gone too)
135 clean-local:
136         rm -rf $(TOOLS_ZIP) classes
137
138 # FIXME: remove this when GNU Classpath includes a bootstrap VM.
139 installcheck-binSCRIPTS:
140         :