OSDN Git Service

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