OSDN Git Service

31c9a6cc1d4556a4241961148347d77399ef521f
[pf3gnuchains/gcc-fork.git] / libjava / classpath / tools / Makefile.am
1 ## Input file for automake to generate the Makefile.in used by configure
2
3 if CREATE_GJDOC
4 ## GCJ LOCAL: always put source files in srcdir
5 ## if CREATE_GJDOC_PARSER
6 ## gjdoc_gendir = ${top_builddir}/tools/generated
7 ## else
8 gjdoc_gendir = ${top_srcdir}/tools/generated
9 ## endif
10 ## END GCJ LOCAL
11 ANTLR_CLASSPATH = $(ANTLR_JAR):$(gjdoc_gendir)
12 endif
13
14 ## GCJ LOCAL: use srcdir to find core classes.
15 GLIBJ_BOOTCLASSPATH='$(top_srcdir)/lib'
16 GLIBJ_CLASSPATH=.:$(srcdir)/asm:$(ANTLR_CLASSPATH)
17 ## END GCJ LOCAL
18
19 # Setup the compiler to use the GNU Classpath library we just built.
20 if GCJ_JAVAC
21 JCOMPILER = $(JAVAC) $(JAVACFLAGS) -fsource=1.5 -ftarget=1.5 --encoding=UTF-8 --bootclasspath=$(GLIBJ_BOOTCLASSPATH) --classpath=$(GLIBJ_CLASSPATH)
22 else
23 JCOMPILER = $(JAVAC) $(JAVACFLAGS) -source 1.5 -target 1.5 -encoding UTF-8 -bootclasspath $(GLIBJ_BOOTCLASSPATH) -classpath $(GLIBJ_CLASSPATH)
24 endif
25
26 if CREATE_WRAPPERS
27 bin_SCRIPTS =
28 bin_PROGRAMS = gappletviewer gjarsigner gkeytool \
29         gjar gnative2ascii gserialver gjavah grmiregistry \
30         gtnameserv gorbd grmid grmic
31 if CREATE_GJDOC
32 bin_PROGRAMS += gjdoc
33 endif
34
35 AM_CPPFLAGS = -Wall \
36         -I$(top_srcdir)/include \
37         -DLIBJVM="\"$(libdir)/libjvm\"" \
38         -DTOOLS_ZIP="\"$(TOOLSdir)/$(TOOLS_ZIP)\""
39
40 gappletviewer_SOURCES = toolwrapper.c
41 gappletviewer_CFLAGS = \
42         -DTOOLPACKAGE="\"appletviewer\"" \
43         -DTOOLNAME="\"gappletviewer\""
44
45 gjarsigner_SOURCES = toolwrapper.c
46 gjarsigner_CFLAGS = \
47         -DTOOLPACKAGE="\"jarsigner\"" \
48         -DTOOLNAME="\"gjarsigner\""
49
50 gkeytool_SOURCES = toolwrapper.c
51 gkeytool_CFLAGS = \
52         -DTOOLPACKAGE="\"keytool\"" \
53         -DTOOLNAME="\"gkeytool\""
54
55 gjar_SOURCES = toolwrapper.c
56 gjar_CFLAGS = \
57         -DTOOLPACKAGE="\"jar\"" \
58         -DTOOLNAME="\"gjar\""
59
60 gnative2ascii_SOURCES = toolwrapper.c
61 gnative2ascii_CFLAGS = \
62         -DTOOLPACKAGE="\"native2ascii\"" \
63         -DTOOLNAME="\"gnative2ascii\"" \
64         -DMAINCLASS="\"Native2ASCII\""
65
66 gserialver_SOURCES = toolwrapper.c
67 gserialver_CFLAGS = \
68         -DTOOLPACKAGE="\"serialver\"" \
69         -DTOOLNAME="\"gserialver\"" \
70         -DMAINCLASS="\"SerialVer\""
71
72 grmiregistry_SOURCES = toolwrapper.c
73 grmiregistry_CFLAGS = \
74         -DTOOLPACKAGE="\"rmiregistry\"" \
75         -DTOOLNAME="\"grmiregistry\""
76
77 gtnameserv_SOURCES = toolwrapper.c
78 gtnameserv_CFLAGS = \
79         -DTOOLPACKAGE="\"tnameserv\"" \
80         -DTOOLNAME="\"gtnameserv\""
81
82 gorbd_SOURCES = toolwrapper.c
83 gorbd_CFLAGS = \
84         -DTOOLPACKAGE="\"orbd\"" \
85         -DTOOLNAME="\"gorbd\""
86
87 grmid_SOURCES = toolwrapper.c
88 grmid_CFLAGS = \
89         -DTOOLPACKAGE="\"rmid\"" \
90         -DTOOLNAME="\"grmid\""
91
92 gjavah_SOURCES = toolwrapper.c
93 gjavah_CFLAGS = \
94         -DTOOLPACKAGE="\"javah\"" \
95         -DTOOLNAME="\"gjavah\""
96
97 grmic_SOURCES = toolwrapper.c
98 grmic_CFLAGS = \
99         -DTOOLPACKAGE="\"rmic\"" \
100         -DTOOLNAME="\"grmic\""
101
102 gjdoc_SOURCES = toolwrapper.c
103 gjdoc_CFLAGS = \
104         -DTOOLPACKAGE="\"gjdoc\"" \
105         -DTOOLNAME="\"gjdoc\""
106
107 else
108 ## GCJ LOCAL: do not install these.
109 noinst_SCRIPTS = gappletviewer gjarsigner gkeytool \
110         gjar gnative2ascii gserialver gjavah grmiregistry \
111         gtnameserv gorbd grmid grmic
112 if CREATE_GJDOC
113 noinst_SCRIPTS += gjdoc
114 endif
115 bin_PROGRAMS =
116 ## FIXME: remove these unneeded dependency lines once we can
117 ## require Automake 1.11.
118 gappletviewer: gappletviewer.in
119 gjarsigner: gjarsigner.in
120 gkeytool: gkeytool.in
121 gjar: gjar.in
122 gnative2ascii: gnative2ascii.in
123 gserialver: gserialver.in
124 gjavah: gjavah.in
125 grmiregistry: grmiregistry.in
126 gtnameserv: gtnameserv.in
127 gorbd: gorbd.in
128 grmid: grmid.in
129 grmic: grmic.in
130 if CREATE_GJDOC
131 gjdoc: gjdoc.in
132 endif
133 endif
134 EXTRA_DIST = toolwrapper.c gappletviewer.in gjarsigner.in gkeytool.in \
135         gjar.in gnative2ascii.in gserialver.in gjavah.in grmiregistry.in \
136         gtnameserv.in gorbd.in grmid.in grmic.in gjdoc.in
137
138 # All our example java source files
139 TOOLS_JAVA_FILES = $(srcdir)/gnu/classpath/tools/*/*.java \
140         $(srcdir)/gnu/classpath/tools/*.java \
141         $(srcdir)/gnu/classpath/tools/*/*.java \
142         $(srcdir)/gnu/classpath/tools/*/*/*.java \
143         $(srcdir)/gnu/classpath/tools/*/*/*/*.java \
144         $(srcdir)/com/sun/javadoc/*.java \
145         $(srcdir)/com/sun/tools/doclets/*.java \
146         $(srcdir)/com/sun/tools/javac/*.java \
147         $(srcdir)/com/sun/tools/javah/*.java \
148         $(srcdir)/com/sun/tools/javadoc/*.java \
149         $(srcdir)/sun/rmi/rmic/*.java \
150         $(srcdir)/external/asm/org/objectweb/asm/*.java \
151         $(srcdir)/external/asm/org/objectweb/asm/attrs/*.java \
152         $(srcdir)/external/asm/org/objectweb/asm/commons/*.java \
153         $(srcdir)/external/asm/org/objectweb/asm/optimizer/*.java \
154         $(srcdir)/external/asm/org/objectweb/asm/signature/*.java \
155         $(srcdir)/external/asm/org/objectweb/asm/tree/*.java \
156         $(srcdir)/external/asm/org/objectweb/asm/tree/analysis/*.java \
157         $(srcdir)/external/asm/org/objectweb/asm/util/*.java \
158         $(srcdir)/external/asm/org/objectweb/asm/util/attrs/*.java \
159         $(srcdir)/external/asm/org/objectweb/asm/xml/*.java
160
161 # Properties files that must be included in the generated zip file.
162 PROPERTY_FILES = $(srcdir)/external/asm/org/objectweb/asm/optimizer/shrink.properties \
163         $(srcdir)/resource/com/sun/tools/javac/messages.properties \
164         $(srcdir)/resource/gnu/classpath/tools/jar/messages.properties \
165         $(srcdir)/resource/gnu/classpath/tools/orbd/messages.properties \
166         $(srcdir)/resource/gnu/classpath/tools/rmic/messages.properties \
167         $(srcdir)/resource/gnu/classpath/tools/rmid/messages.properties \
168         $(srcdir)/resource/gnu/classpath/tools/serialver/messages.properties \
169         $(srcdir)/resource/gnu/classpath/tools/keytool/messages.properties \
170         $(srcdir)/resource/gnu/classpath/tools/native2ascii/messages.properties \
171         $(srcdir)/resource/gnu/classpath/tools/appletviewer/messages.properties \
172         $(srcdir)/resource/gnu/classpath/tools/common/Messages.properties \
173         $(srcdir)/resource/gnu/classpath/tools/getopt/Messages.properties \
174         $(srcdir)/resource/gnu/classpath/tools/tnameserv/messages.properties \
175         $(srcdir)/resource/gnu/classpath/tools/jarsigner/messages.properties \
176         $(srcdir)/resource/gnu/classpath/tools/rmiregistry/messages.properties \
177         $(srcdir)/resource/sun/rmi/rmic/messages.properties
178
179 # RMIC templates that must be included in the generated zip file.
180 RMIC_TEMPLATES = $(srcdir)/resource/gnu/classpath/tools/rmic/templates/*.jav
181
182 # gjdoc resource files.
183 gnu_classpath_tools_gjdoc_jar_CSS = \
184         doctranslets/html/res/gjdochtml-clean.css \
185         doctranslets/html/res/gjdochtml-fixed.css \
186         doctranslets/html/res/gjdochtml-sclara.css \
187         doctranslets/html/res/gjdochtml.css \
188         htmldoclet/gjdochtml-vanilla.css \
189         htmldoclet/gjdochtml-clean-layout.css \
190         htmldoclet/gjdochtml-clean-color1.css
191
192 gnu_classpath_tools_gjdoc_jar_DTDS = \
193         htmldoclet/xhtml11-target10.dtd \
194         dtd/gjdoc-alphaindex.dtd \
195         dtd/gjdoc.dtd
196
197 gnu_classpath_tools_gjdoc_jar_ENTS = \
198         dtd/ent/iso-amsa.ent \
199         dtd/ent/iso-amsb.ent \
200         dtd/ent/iso-amsc.ent \
201         dtd/ent/iso-amsn.ent \
202         dtd/ent/iso-amso.ent \
203         dtd/ent/iso-amsr.ent \
204         dtd/ent/iso-box.ent \
205         dtd/ent/iso-cyr1.ent \
206         dtd/ent/iso-cyr2.ent \
207         dtd/ent/iso-dia.ent \
208         dtd/ent/iso-grk1.ent \
209         dtd/ent/iso-grk2.ent \
210         dtd/ent/iso-grk3.ent \
211         dtd/ent/iso-grk4.ent \
212         dtd/ent/iso-lat1.ent \
213         dtd/ent/iso-lat2.ent \
214         dtd/ent/iso-num.ent \
215         dtd/ent/iso-pub.ent \
216         dtd/ent/iso-tech.ent
217
218 gnu_classpath_tools_gjdoc_jar_HTML = doctranslets/html/res/default_help_en.html
219
220 gnu_classpath_tools_gjdoc_jar_JS = \
221         doctranslets/html/res/gjdoc.js \
222         htmldoclet/gjdoc.js
223
224 gnu_classpath_tools_gjdoc_jar_PNG = \
225         htmldoclet/inherit.png
226
227 gnu_classpath_tools_gjdoc_jar_MODS = dtd/dbcentx.mod
228
229 gnu_classpath_tools_gjdoc_jar_PROPERTIES = htmldoclet/HtmlDoclet.properties
230
231 gnu_classpath_tools_gjdoc_jar_RNGS = \
232         rng/gjdoc-classdoc.rng \
233         rng/gjdoc-common.rng \
234         rng/gjdoc-index.rng
235
236 gnu_classpath_tools_gjdoc_jar_TXTS = \
237         java.lang-classes-1.2.txt \
238         java.lang-classes-1.3.txt \
239         java.lang-classes-1.4.txt \
240         java.lang-classes-1.5.txt
241
242 gnu_classpath_tools_gjdoc_jar_XHTML = htmldoclet/help.xhtml
243
244 gnu_classpath_tools_gjdoc_jar_XSLS = \
245         doctranslets/gjdoc_common.xsl \
246         doctranslets/html/about.xsl \
247         doctranslets/html/allclasses.xsl \
248         doctranslets/html/allpackages.xsl \
249         doctranslets/html/alphaindex.xsl \
250         doctranslets/html/alphaindex_chunked.xsl \
251         doctranslets/html/classdoc-source.xsl \
252         doctranslets/html/classdoc-uses.xsl \
253         doctranslets/html/classdoc.xsl \
254         doctranslets/html/deprecated.xsl \
255         doctranslets/html/descriptor.xsl \
256         doctranslets/html/doctranslet.xsl \
257         doctranslets/html/fulltree.xsl \
258         doctranslets/html/gjdoc.xsl \
259         doctranslets/html/help.xsl \
260         doctranslets/html/html_common.xsl \
261         doctranslets/html/index_noframes.xsl \
262         doctranslets/html/index.xsl \
263         doctranslets/html/packageclasses.xsl \
264         doctranslets/html/packagedoc.xsl
265
266 # All our resources.
267 gjdoc_resources = $(gnu_classpath_tools_gjdoc_jar_CSS) $(gnu_classpath_tools_gjdoc_jar_DTDS) \
268         $(gnu_classpath_tools_gjdoc_jar_ENTS) $(gnu_classpath_tools_gjdoc_jar_HTML) \
269         $(gnu_classpath_tools_gjdoc_jar_JS) $(gnu_classpath_tools_gjdoc_jar_MODS) \
270         $(gnu_classpath_tools_gjdoc_jar_PNG) $(gnu_classpath_tools_gjdoc_jar_PROPERTIES) \
271         $(gnu_classpath_tools_gjdoc_jar_RNGS) $(gnu_classpath_tools_gjdoc_jar_TXTS) \
272         $(gnu_classpath_tools_gjdoc_jar_XHTML) $(gnu_classpath_tools_gjdoc_jar_XSLS)
273
274 if !CREATE_GJDOC
275 GJDOC_EX = -path '*gnu/classpath/tools/gjdoc' -prune -o \
276         -path '*gnu/classpath/tools/doclets' -prune -o \
277         -path '*gnu/classpath/tools/taglets' -prune -o \
278         -path '*com/sun/javadoc' -prune -o \
279         -path '*com/sun/tools/doclets' -prune -o \
280         -path '*com/sun/tools/javadoc' -prune -o
281 endif
282
283 # The zip files with classes we want to produce.
284 TOOLS_ZIP = tools.zip
285
286 # Extra objects that will not exist until configure-time
287 BUILT_SOURCES = $(TOOLS_ZIP)
288
289 # All the files we find "interesting"
290 ALL_TOOLS_FILES = $(TOOLS_JAVA_FILES) $(RMIC_TEMPLATES) $(PROPERTY_FILES) \
291   $(addprefix $(srcdir)/resource/gnu/classpath/tools/gjdoc/,$(gjdoc_resources))\
292   $(srcdir)/gnu/classpath/tools/gjdoc/expr/java-expression.g
293
294 # Some architecture independent data to be installed.
295 # GCJ LOCAL: do not install this.
296 noinst_DATA = $(TOOLS_ZIP)
297
298 # Where we want these data files installed.
299 TOOLSdir = $(pkgdatadir)
300
301 # Make sure everything is included in the distribution.
302 dist-hook:
303         srcdir_cnt=`echo $(srcdir) | wc -c`; \
304         for file in $(ALL_TOOLS_FILES); do \
305           f=`echo $$file | cut -c$$srcdir_cnt-`; \
306           fdir=`dirname $$f`; \
307           if test ! -d $(distdir)/$$fdir; then \
308             echo "$(makeinstalldirs) $(distdir)/$$fdir"; \
309             $(mkinstalldirs) $(distdir)/$$fdir; \
310           fi; \
311           echo "cp -p $$file $(distdir)/$$f"; \
312           cp -p $$file $(distdir)/$$f; \
313         done
314
315 # To generate the example zip just depend on the sources and ignore
316 # the class files. Always regenerate all .class files and remove them
317 # immediately.  And copy the template files we use to the classes dir
318 # so they get also included.
319 $(TOOLS_ZIP): $(ALL_TOOLS_FILES)
320 ## GCJ LOCAL: put classes in srcdir
321 ##      @rm -rf classes asm
322 ##      @mkdir_p@ classes asm
323 if JAVA_MAINTAINER_MODE
324 if CREATE_GJDOC
325 if CREATE_GJDOC_PARSER
326 ## Generate antlr sources.
327         @mkdir_p@ $(gjdoc_gendir)/gnu/classpath/tools/gjdoc/expr
328         $(ANTLR) -o $(gjdoc_gendir)/gnu/classpath/tools/gjdoc/expr/ \
329           $(srcdir)/gnu/classpath/tools/gjdoc/expr/java-expression.g
330 endif
331 endif
332 endif
333         find $(srcdir)/external/asm -name '*.java' -print > asm.lst
334         find $(srcdir)/gnu/classpath/tools \
335              $(srcdir)/com/sun/javadoc \
336              $(srcdir)/com/sun/tools/doclets \
337              $(srcdir)/com/sun/tools/javadoc \
338              $(srcdir)/com/sun/tools/javac \
339              $(srcdir)/com/sun/tools/javah \
340              $(srcdir)/sun/rmi/rmic \
341              $(GJDOC_EX) \
342              -name '*.java' -print > classes.lst
343         if [ -f $(top_builddir)/../vm-tools-packages ]; then \
344             : > vm-tools.lst; \
345             for pkg in `cat $(top_builddir)/../vm-tools-packages`; do \
346               $(FIND) $(top_srcdir)/../$$pkg -follow -name '*.java' -print >> vm-tools.lst; \
347             done \
348         else \
349             echo -n > vm-tools.lst; \
350         fi
351         cat classes.lst asm.lst vm-tools.lst > all-classes.lst
352 if JAVA_MAINTAINER_MODE
353 ## Compile ASM separately as it is latin-1 encoded.
354         AC=`echo $(JCOMPILER) | sed -e 's/UTF-8/ISO-8859-1/g'`; \
355           $$AC -g -w -d $(srcdir)/asm @asm.lst
356         $(JCOMPILER) $(USE_JAVAC_FLAGS) -g -d $(srcdir)/classes @classes.lst @vm-tools.lst
357 endif
358 ## END GCJ LOCAL
359 ## Copy over tools resource files.
360         @list=`cd $(srcdir)/resource && find gnu/classpath/tools com/sun/tools/javac \
361                sun/rmi/rmic $(GJDOC_EX) -name \*.properties -print -o -name \*.jav -print`; \
362         for p in $$list; do \
363           dirname=classes/`dirname $$p`; \
364           if ! test -d "$$dirname"; then @mkdir_p@ "$$dirname"; fi; \
365           echo "  cp $(srcdir)/resource/$$p classes/$$p"; \
366           cp $(srcdir)/resource/$$p classes/$$p; \
367         done
368 ## BEGIN GCJ LOCAL
369         cp -pR $(srcdir)/asm .
370         cp -pR $(srcdir)/classes .
371 ## END GCJ LOCAL
372 if CREATE_GJDOC
373 ## Copy over gjdoc resource files.
374         for res in $(gjdoc_resources); do \
375           dir=classes/`dirname $$res`; \
376           if ! test -d "$$dir"; then @mkdir_p@ "$$dir"; fi; \
377           echo "  cp $(srcdir)/resource/gnu/classpath/tools/gjdoc/$$res classes/$$res"; \
378           cp $(srcdir)/resource/gnu/classpath/tools/gjdoc/$$res classes/$$res; \
379         done 
380 endif
381
382 if WITH_JAR
383 CREATE_TOOLS_ZIP=$(JAR) cf ../$(TOOLS_ZIP) .
384 UPDATE_TOOLS_ZIP=$(JAR) uf ../$(TOOLS_ZIP) .
385 else
386 CREATE_TOOLS_ZIP=$(ZIP) -r ../$(TOOLS_ZIP) .
387 UPDATE_TOOLS_ZIP=$(ZIP) -u -r ../$(TOOLS_ZIP) .
388 endif
389
390 ## First add classpath tools stuff.
391         (cd classes; \
392         $(CREATE_TOOLS_ZIP); \
393         cd ..)
394 ## Now add ASM classes.
395         (cd asm; \
396         $(UPDATE_TOOLS_ZIP); \
397         cd ..)
398         rm -rf asm classes classes.lst asm.lst
399
400 # Zip file be gone! (and make sure the classes are gone too)
401 clean-local:
402         rm -rf $(TOOLS_ZIP) classes classes.lst asm asm.lst all-classes.lst
403 if CREATE_GJDOC_PARSER
404         rm -rf $(gjdoc_gendir)
405 endif
406
407 # FIXME: remove this when GNU Classpath includes a bootstrap VM.
408 installcheck-binSCRIPTS:
409         :