OSDN Git Service

2001-02-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
[pf3gnuchains/gcc-fork.git] / gcc / java / Make-lang.in
1 # Top level makefile fragment for the GNU compiler for the Java(TM)
2 # language.
3 #   Copyright (C) 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
4
5 #This file is part of GNU CC.
6
7 #GNU CC is free software; you can redistribute it and/or modify
8 #it under the terms of the GNU General Public License as published by
9 #the Free Software Foundation; either version 2, or (at your option)
10 #any later version.
11
12 #GNU CC is distributed in the hope that it will be useful,
13 #but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 #GNU General Public License for more details.
16
17 #You should have received a copy of the GNU General Public License
18 #along with GNU CC; see the file COPYING.  If not, write to
19 #the Free Software Foundation, 59 Temple Place - Suite 330,
20 #Boston, MA 02111-1307, USA.
21
22 #Java and all Java-based marks are trademarks or registered trademarks
23 #of Sun Microsystems, Inc. in the United States and other countries.
24 #The Free Software Foundation is independent of Sun Microsystems, Inc.
25
26 # This file provides the language dependent support in the main Makefile.
27 # Each language makefile fragment must provide the following targets:
28 #
29 # foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
30 # foo.info, foo.dvi,
31 # foo.install-normal, foo.install-common, foo.install-info, foo.install-man,
32 # foo.uninstall,
33 # foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
34 # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
35 #
36 # where `foo' is the name of the language.
37 #
38 # It should also provide rules for:
39 #
40 # - making any compiler driver (eg: g++)
41 # - the compiler proper (eg: jc1)
42 # - define the names for selecting the language in LANGUAGES.
43
44 # Actual names to use when installing a native compiler.
45 JAVA_INSTALL_NAME = `t='$(program_transform_name)'; echo gcj | sed $$t`
46
47 # Actual names to use when installing a cross-compiler.
48 JAVA_CROSS_NAME = `t='$(program_transform_cross_name)'; echo gcj | sed $$t`
49
50 GCJ = gcj
51
52 # Define the names for selecting java in LANGUAGES.
53 java: jc1$(exeext) $(GCJ)$(exeext) jvgenmain$(exeext) \
54       gcjh$(exeext) jv-scan$(exeext) jcf-dump$(exeext)
55
56 # Define the name of target independant tools to be installed in $(bindir)
57 # Names are subject to changes
58 JAVA_TARGET_INDEPENDENT_BIN_TOOLS = gcjh jv-scan jcf-dump
59
60 # Tell GNU make to ignore these if they exist.
61 .PHONY: java
62
63 jvspec.o: $(srcdir)/java/jvspec.c system.h $(GCC_H) $(CONFIG_H)
64         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \
65                 $(INCLUDES) $(srcdir)/java/jvspec.c $(OUTPUT_OPTION)
66
67 # Create the compiler driver for $(GCJ).
68 $(GCJ)$(exeext): gcc.o jvspec.o version.o \
69            prefix.o intl.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
70         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o jvspec.o prefix.o intl.o \
71           version.o $(EXTRA_GCC_OBJS) $(LIBS)
72
73 # Create a version of the $(GCJ) driver which calls the cross-compiler.
74 $(GCJ)-cross$(exeext): $(GCJ)$(exeext)
75         -rm -f $(GCJ)-cross$(exeext)
76         cp $(GCJ)$(exeext) $(GCJ)-cross$(exeext)
77
78 $(INTL_TARGETS): $(srcdir)/java/parse.c $(srcdir)/java/parse-scan.c
79
80 $(srcdir)/java/parse.c: $(srcdir)/java/parse.y
81         (cd $(srcdir)/java && \
82         $(BISON) -t --name-prefix=java_ $(BISONFLAGS) -o p$$$$.c parse.y && \
83         mv -f p$$$$.c parse.c)
84
85 $(srcdir)/java/parse-scan.c:  $(srcdir)/java/parse-scan.y
86         (cd $(srcdir)/java && \
87         $(BISON) -t $(BISONFLAGS) -o ps$$$$.c parse-scan.y && \
88         mv -f ps$$$$.c parse-scan.c)
89
90 $(srcdir)/java/keyword.h: $(srcdir)/java/keyword.gperf
91         (cd $(srcdir)/java || exit 1; \
92         gperf -L C -F ', 0' -p -t -j1 -i 1 -g -o -N java_keyword -k1,4,$$ \
93                 keyword.gperf > k$$$$.h || { \
94         echo "Please update gperf from ftp://ftp.gnu.org/pub/gnu/gperf/" >&2; \
95         rm -f k$$$$.h; \
96         exit 1; } ; \
97         mv -f k$$$$.h keyword.h)
98
99 # Executables built by this Makefile:
100 JAVA_OBJS = java/parse.o java/class.o java/decl.o java/expr.o \
101   java/constants.o java/lang.o java/typeck.o java/except.o java/verify.o \
102   java/zextract.o java/jcf-io.o java/jcf-parse.o java/mangle.o \
103   java/mangle_name.o \
104   java/jcf-write.o java/buffer.o java/check-init.o java/jcf-depend.o \
105   java/jcf-path.o java/xref.o java/boehm.o mkdeps.o
106
107 GCJH_OBJS = java/gjavah.o java/jcf-io.o java/jcf-depend.o java/jcf-path.o \
108   java/zextract.o version.o mkdeps.o errors.o
109
110 JVSCAN_OBJS = java/parse-scan.o java/jv-scan.o version.o
111
112 JCFDUMP_OBJS = java/jcf-dump.o java/jcf-io.o java/jcf-depend.o java/jcf-path.o \
113                 java/zextract.o errors.o version.o mkdeps.o
114
115 JVGENMAIN_OBJS = java/jvgenmain.o java/mangle_name.o
116
117 # Use loose warnings for this front end.
118 java-warn =
119
120 jc1$(exeext): $(JAVA_OBJS) $(BACKEND) $(LIBDEPS)
121         rm -f $@
122         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
123                 $(JAVA_OBJS) $(BACKEND) $(ZLIB) $(LIBS)
124
125 gcjh$(exeext): $(GCJH_OBJS) $(LIBDEPS)
126         rm -f $@
127         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GCJH_OBJS) $(ZLIB) $(LIBS)
128
129 jv-scan$(exeext): $(JVSCAN_OBJS) $(LIBDEPS)
130         rm -f $@
131         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JVSCAN_OBJS) $(LIBS)
132
133 jcf-dump$(exeext): $(JCFDUMP_OBJS) $(LIBDEPS)
134         rm -f $@
135         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JCFDUMP_OBJS) $(ZLIB) $(LIBS)
136
137 jvgenmain$(exeext): $(JVGENMAIN_OBJS) $(LIBDEPS)
138         rm -f $@
139         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JVGENMAIN_OBJS) $(LIBS)
140
141 #\f
142 # Build hooks:
143
144 java.all.build: $(GCJ)$(exeext)
145 java.all.cross: $(GCJ)-cross$(exeext)
146 java.start.encap: $(GCJ)$(exeext)
147 java.rest.encap:
148
149 java.info: $(srcdir)/java/gcj.info
150 java.dvi: java/gcj.dvi
151
152 # Install hooks:
153 # jc1, gcj, jvgenmain, and gcjh are installed elsewhere as part
154 # of $(COMPILERS).
155
156 # Nothing to do here.
157 java.install-normal:
158
159 java.install-common:
160         -if [ -f $(GCJ)$(exeext) ]; then \
161           if [ -f $(GCJ)-cross$(exeext) ]; then \
162             rm -f $(bindir)/$(JAVA_CROSS_NAME)$(exeext); \
163             $(INSTALL_PROGRAM) $(GCJ)-cross$(exeext) $(bindir)/$(JAVA_CROSS_NAME)$(exeext); \
164             chmod a+x $(bindir)/$(JAVA_CROSS_NAME)$(exeext); \
165           else \
166             rm -f $(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \
167             $(INSTALL_PROGRAM) $(GCJ)$(exeext) $(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \
168             chmod a+x $(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \
169           fi ; \
170         fi ; \
171         for tool in $(JAVA_TARGET_INDEPENDENT_BIN_TOOLS); do \
172           if [ -f $$tool$(exeext) ]; then \
173             rm -f $(bindir)/$$tool$(exeext); \
174             $(INSTALL_PROGRAM) $$tool$(exeext) $(bindir)/$$tool$(exeext); \
175             chmod a+x $(bindir)/$$tool$(exeext); \
176           fi ; \
177        done
178
179 java.install-man:
180
181 java.uninstall:
182         -rm -rf $(bindir)/$(JAVA_INSTALL_NAME)$(exeext)
183         -rm -rf $(bindir)/$(JAVA_CROSS_NAME)$(exeext)
184
185 java.install-info:
186         if [ -f jc1$(exeext) ] ; then \
187           if [ -f $(srcdir)/java/gcj.info ]; then \
188             rm -f $(infodir)/gcj.info*; \
189             for f in $(srcdir)/java/gcj.info*; do \
190               realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
191               $(INSTALL_DATA) $$f $(infodir)/$$realfile; \
192             done; \
193             chmod a-x $(infodir)/gcj.info*; \
194           else true; fi; \
195         else true; fi
196         -if [ -f jc1$(exeext) ] && [ -f $(infodir)/gcj.info ]; then \
197           if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
198             install-info --dir-file=$(infodir)/dir $(infodir)/gcj.info; \
199           else true; fi; \
200         else true; fi
201
202 #\f
203 # Clean hooks:
204 # A lot of the ancillary files are deleted by the main makefile.
205 # We just have to delete files specific to us.
206
207 java.mostlyclean:
208         -rm -f java/*$(objext) $(DEMANGLER_PROG)
209         -rm -f jc1$(exeext) $(GCJ)$(exeext) jvgenmain$(exeext) gcjh$(exeext) jv-scan$(exeext) jcf-dump$(exeext) s-java
210 java.clean:
211 java.distclean:
212         -rm -f java/config.status java/Makefile
213         -rm -f java/parse.output
214 java.extraclean:
215 java.maintainer-clean:
216         -rm -f java/parse.c java/parse-scan.c java/parse.output java/y.tab.c
217 #\f
218 # Stage hooks:
219 # The main makefile has already created stage?/java.
220
221 java.stage1: stage1-start
222         -mv java/*$(objext) stage1/java
223 java.stage2: stage2-start
224         -mv java/*$(objext) stage2/java
225 java.stage3: stage3-start
226         -mv java/*$(objext) stage3/java
227 java.stage4: stage4-start
228         -mv java/*$(objext) stage4/java
229
230 #\f
231 # .o:.h dependencies.
232 JAVA_TREE_H = $(TREE_H) java/java-tree.h java/java-tree.def
233 JAVA_LEX_C = java/lex.c java/keyword.h java/chartables.h
234
235 java/parse.o: java/parse.c java/jcf-reader.c $(CONFIG_H) system.h \
236   function.h $(JAVA_TREE_H) $(JAVA_LEX_C) java/parse.h java/lex.h $(GGC_H)
237 java/jcf-dump.o: $(CONFIG_H) system.h $(JAVA_TREE_H) java/jcf-dump.c \
238   java/jcf-reader.c java/jcf.h java/javaop.h java/javaop.def version.h
239 java/gjavah.o: $(CONFIG_H) system.h $(JAVA_TREE_H) java/gjavah.c \
240   java/jcf-reader.c java/jcf.h java/javaop.h version.h
241 java/boehm.o: java/boehm.c $(CONFIG_H) system.h $(TREE_H) $(JAVA_TREE_H) \
242   java/parse.h
243 java/buffer.o: java/buffer.c $(CONFIG_H) java/buffer.h gansidecl.h \
244   system.h toplev.h
245 java/check-init.o: java/check-init.c $(CONFIG_H) gansidecl.h \
246   $(JAVA_TREE_H) system.h toplev.h
247 java/class.o: java/class.c $(CONFIG_H) $(JAVA_TREE_H) $(RTL_H) java/jcf.h \
248   java/parse.h gansidecl.h toplev.h system.h output.h $(GGC_H)
249 java/constants.o: java/constants.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
250   toplev.h system.h $(GGC_H)
251 java/decl.o: java/decl.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
252   toplev.h system.h function.h gcc.h
253 java/except.o: java/except.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h real.h \
254   $(RTL_H) java/javaop.h java/java-opcodes.h except.h java/java-except.h \
255   eh-common.h toplev.h system.h function.h
256 java/expr.o: java/expr.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h real.h \
257   $(RTL_H) $(EXPR_H) java/javaop.h java/java-opcodes.h except.h \
258   java/java-except.h java/java-except.h java/parse.h toplev.h \
259   system.h $(GGC_H)
260 java/jcf-depend.o: java/jcf-depend.c $(CONFIG_H) system.h java/jcf.h
261 java/jcf-parse.o: java/jcf-parse.c $(CONFIG_H) $(JAVA_TREE_H) flags.h \
262   input.h java/java-except.h system.h toplev.h java/parse.h $(GGC_H)
263 java/jcf-write.o: java/jcf-write.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
264   $(RTL_H) java/java-opcodes.h java/parse.h java/buffer.h system.h \
265   toplev.h $(GGC_H)
266 java/jv-scan.o: java/jv-scan.c $(CONFIG_H) system.h version.h
267 java/jvgenmain.o: java/jvgenmain.c $(CONFIG_H) $(JAVA_TREE_H) system.h
268 java/lang.o: java/lang.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h input.h \
269   toplev.h system.h $(RTL_H) $(EXPR_H)
270 java/mangle.o: java/mangle.c $(CONFIG_H) java/jcf.h $(JAVA_TREE_H) system.h \
271   toplev.h $(GGC_H)
272 java/parse-scan.o: $(CONFIG_H) system.h toplev.h $(JAVA_LEX_C) java/parse.h \
273   java/lex.h
274 java/typeck.o: java/typeck.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
275   java/convert.h toplev.h system.h $(GGC_H)
276 java/verify.o: java/verify.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
277   java/javaop.h java/java-opcodes.h java/java-except.h toplev.h system.h
278 java/xref.o: java/xref.c java/xref.h $(CONFIG_H) $(JAVA_TREE_H) toplev.h \
279   system.h
280 java/zextract.o: java/zextract.c $(CONFIG_H) system.h java/zipfile.h
281
282 # jcf-io.o needs $(ZLIBINC) added to cflags.
283 java/jcf-io.o: java/jcf-io.c $(CONFIG_H) system.h $(JAVA_TREE_H)
284         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ZLIBINC) \
285                 $(srcdir)/java/jcf-io.c $(OUTPUT_OPTION)
286
287 # jcf-path.o needs a -D.
288 java/jcf-path.o: java/jcf-path.c $(CONFIG_H) system.h java/jcf.h
289         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
290           -DLIBGCJ_ZIP_FILE='"$(prefix)/share/libgcj.jar"' \
291           $(srcdir)/java/jcf-path.c $(OUTPUT_OPTION)
292
293 # Documentation
294 $(srcdir)/java/gcj.info: $(srcdir)/java/gcj.texi
295         if test "x$(BUILD_INFO)" = xinfo; then \
296           rm -f $(srcdir)/java/gcc.info*; \
297           cd $(srcdir)/java && $(MAKEINFO) -o gcj.info gcj.texi; \
298         else true; fi
299
300 java/gcj.dvi: $(srcdir)/java/gcj.texi
301         TEXINPUTS=${texidir}:$(srcdir)/java:$$TEXINPUTS tex gcj.texi
302         texindex gcj.??
303         TEXINPUTS=${texidir}:$(srcdir)/java:$$TEXINPUTS tex gcj.texi