1 # Makefile for GNU compiler for the Java(TM) language.
2 # Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1998,
3 # 1999 Free Software Foundation, Inc.
5 #This file is part of GNU CC.
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)
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.
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.
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.
26 # The makefile built from this file lives in the language subdirectory.
27 # Its purpose is to provide support for:
29 # 1) recursion where necessary, and only then (building .o's), and
30 # 2) building and debugging cc1 from the language subdirectory, and
33 # The parent makefile handles all other chores, with help from the
34 # language makefile fragment, of course.
36 # The targets for external use are:
37 # all, TAGS, ???mostlyclean, ???clean.
39 # Suppress smart makes who think they know how to automake Yacc files
42 # Variables that exist for you to override.
43 # See below for how to change them for certain systems.
45 # Various ways of specifying flags for compilations:
46 # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
47 # BOOT_CFLAGS is the value of CFLAGS to pass
48 # to the stage2 and stage3 compilations
49 # XCFLAGS is used for most compilations but not when using the GCC just built.
52 BOOT_CFLAGS
= -O
$(CFLAGS
)
53 # These exists to be overridden by the x-* and t-* files, respectively.
61 SET_BISON
= here
=`pwd`; sdir
=`cd $(srcdir) && pwd`; if
test -f ..
/..
/bison
; then bison
="$$here/../../bison/bison -L $$sdir"; else bison
=bison
; fi
63 JAVABISONFLAGS
= --name-prefix
=java_
70 # Define this as & to perform parallel make on a Sequent.
71 # Note that this has some bugs, and it seems currently necessary
72 # to compile all the gen* files first by hand to avoid erroneous results.
75 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
76 # It omits XCFLAGS, and specifies -B./.
77 # It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
78 GCC_CFLAGS
=$(INTERNAL_CFLAGS
) $(X_CFLAGS
) $(T_CFLAGS
) $(CFLAGS
)
80 # Tools to use when building a cross-compiler.
81 # These are used because `configure' appends `cross-make'
82 # to the makefile when making a cross-compiler.
84 # We don't use cross-make. Instead we use the tools
85 # from the build tree, if they are available.
86 # program_transform_name and objdir are set by configure.in.
87 program_transform_name
=
90 #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
91 #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
93 # Directory where sources are, from where we are.
97 # Directory holding libgcj.zip.
100 libgcj_zip
= $(datadir)/libgcj.zip
102 # Additional system libraries to link with.
105 # Choose the real default target.
108 # End of variables for you to override.
110 # Definition of `all' is here so that new rules inserted by sed
111 # do not specify the default target.
114 # This tells GNU Make version 3 not to put all variables in the environment.
117 # sed inserts variable overrides after the following line.
128 # Now figure out from those variables how to compile and link.
130 all.indirect
: Makefile ..
/jc1
$(exeext
) ..
/jcf-dump
$(exeext
) \
131 ..
/jvgenmain
$(exeext
) ..
/gcjh
$(exeext
) ..
/jv-scan
$(exeext
)
133 # IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
134 INTERNAL_CFLAGS
= $(CROSS
) -DIN_GCC @extra_c_flags@
136 # This is the variable actually used when we compile.
137 ALL_CFLAGS
= $(INTERNAL_CFLAGS
) $(X_CFLAGS
) $(T_CFLAGS
) $(CFLAGS
) $(XCFLAGS
) -W
-Wall
140 ALL_CPPFLAGS
= $(CPPFLAGS
) $(X_CPPFLAGS
) $(T_CPPFLAGS
)
142 # This is where we get libiberty.a from.
143 LIBIBERTY
= ..
/..
/libiberty
/libiberty.a
145 # How to link with both our special library facilities
146 # and the system's installed libraries.
147 LIBS
= $(LIBIBERTY
) $(CLIB
)
148 LIBDEPS
= $(LIBIBERTY
) ..
/errors.o
150 # Specify the directories to be searched for header files.
151 # Both . and srcdir are used, in that order,
152 # so that tm.h and config.h will be found in the compilation
153 # subdirectory rather than in the source directory.
154 INCLUDES
= -I.
-I..
-I
$(srcdir) -I
$(srcdir)/..
-I
$(srcdir)/..
/config
-I
$(srcdir)/..
/..
/include
156 # Always use -I$(srcdir)/config when compiling.
158 $(CC
) -c
$(ALL_CFLAGS
) $(ALL_CPPFLAGS
) $(INCLUDES
) $<
161 # Lists of files for various purposes.
163 # Language-specific object files for Gcc/Java:
165 # Remember to keep this list in sync with JAVA_SRCS in Make-lang.in!!!
167 JAVA_OBJS
= parse.o class.o decl.o expr.o constants.o lang.o typeck.o \
168 except.o verify.o zextract.o jcf-io.o jcf-parse.o mangle.o jcf-write.o \
169 buffer.o check-init.o jcf-depend.o jcf-path.o xref.o boehm.o
171 JAVA_OBJS_LITE
= parse-scan.o jv-scan.o
173 # Language-independent object files.
174 OBJS
= `cat ../stamp-objlist` ..
/ggc-callbacks.o
175 OBJDEPS
= ..
/stamp-objlist ..
/ggc-callbacks.o
177 compiler
: ..
/jc1
$(exeext
) ..
/jv-scan
$(exeext
)
178 ..
/jc1
$(exeext
): $(P
) $(JAVA_OBJS
) $(OBJDEPS
) $(LIBDEPS
)
179 rm -f ..
/jc1
$(exeext
)
180 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
$@
$(JAVA_OBJS
) $(OBJS
) $(LIBS
)
181 ..
/jv-scan
$(exeext
): $(P
) $(JAVA_OBJS_LITE
) $(OBJDEPS
) ..
/version.o
$(LIBDEPS
)
182 rm -f ..
/jv-scan
$(exeext
)
183 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
$@
$(JAVA_OBJS_LITE
) ..
/version.o
$(LIBS
)
185 ..
/jcf-dump
$(exeext
): jcf-dump.o jcf-io.o jcf-depend.o jcf-path.o \
186 zextract.o ..
/version.o
$(LIBDEPS
)
187 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
$@ jcf-dump.o jcf-io.o \
188 jcf-depend.o jcf-path.o zextract.o ..
/errors.o ..
/version.o
$(LIBS
)
190 # Dependencies here must be kept in sync with dependencies in Make-lang.in.
191 ..
/jvgenmain
$(exeext
): jvgenmain.o mangle.o
$(LIBDEPS
)
192 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
$@ jvgenmain.o mangle.o
$(LIBS
)
194 ..
/gcjh
$(exeext
): gjavah.o jcf-io.o jcf-depend.o jcf-path.o \
195 zextract.o ..
/version.o
$(LIBDEPS
)
196 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
$@ gjavah.o jcf-io.o \
197 jcf-depend.o jcf-path.o zextract.o ..
/errors.o ..
/version.o
$(LIBS
)
199 Makefile
: $(srcdir)/Makefile.in
$(srcdir)/..
/configure
200 cd ..
; $(SHELL
) config.status
202 native
: config.status ..
/jc1
$(exeext
)
204 # Compiling object files from source files.
205 TREE_H
= $(srcdir)/..
/tree.h
$(srcdir)/..
/real.h
$(srcdir)/..
/tree.def \
206 $(srcdir)/..
/machmode.h
$(srcdir)/..
/machmode.def ..
/tree-check.h
207 JAVA_TREE_H
= $(TREE_H
) java-tree.h java-tree.def
208 RTL_H
= $(srcdir)/..
/rtl.h
$(srcdir)/..
/rtl.def \
209 $(srcdir)/..
/machmode.h
$(srcdir)/..
/machmode.def ..
/genrtl.h
210 EXPR_H
= $(srcdir)/..
/expr.h ..
/insn-codes.h
212 # Separating PARSE_DIR from PARSE_RELDIR lets us easily change the
213 # code to support building parse.c in the build directory, at some
214 # expense in readability.
215 PARSE_DIR
= $(srcdir)
217 PARSE_C
= $(PARSE_DIR
)/parse.c
218 PARSE_SCAN_C
= $(PARSE_DIR
)/parse-scan.c
219 PARSE_H
= $(srcdir)/parse.h
221 $(PARSE_C
): $(srcdir)/parse.y
223 cd
$(PARSE_DIR
) && $$bison -t
$(BISONFLAGS
) $(JAVABISONFLAGS
) \
224 -o parse.c
$(PARSE_RELDIR
)/parse.y
225 $(PARSE_SCAN_C
): $(srcdir)/parse-scan.y
227 cd
$(PARSE_DIR
) && $$bison -t
$(BISONFLAGS
) -o parse-scan.c \
228 $(PARSE_RELDIR
)/parse-scan.y
230 lex.c
: keyword.h
lex.h
232 lang.o
: $(srcdir)/java-tree.def
234 keyword.h
: keyword.gperf
235 gperf
-L C
-F
', 0' -p
-t
-j1
-i
1 -g
-o
-N java_keyword
-k1
,3,$$ \
236 keyword.gperf
> keyword.h ||
( \
237 echo
"Please update your 'gperf' from the GCC infrastructure" >&2 ; \
238 echo
" ftp://sourceware.cygnus.com/pub/egcs/infrastructure/gperf*" >&2 ; \
241 jcf-path.o
: jcf-path.c
$(CONFIG_H
) $(srcdir)/..
/system.h jcf.h
242 $(CC
) -c
$(ALL_CFLAGS
) $(ALL_CPPFLAGS
) $(INCLUDES
) \
243 -DLIBGCJ_ZIP_FILE
='"$(libgcj_zip)"' $(srcdir)/jcf-path.c
245 # These exist for maintenance purposes.
247 # Update the tags table.
251 echo
'l' | tr
'l' '\f' >> TAGS
; \
252 echo
'parse.y,0' >> TAGS
; \
253 etags
-a ..
/*.h ..
/*.c
;
264 parse.o
: $(PARSE_C
) jcf-reader.c
$(CONFIG_H
) $(srcdir)/..
/system.h \
265 $(srcdir)/..
/function.h
$(JAVA_TREE_H
) $(srcdir)/lex.c
$(PARSE_H
) \
267 jcf-dump.o
: $(CONFIG_H
) $(srcdir)/..
/system.h
$(JAVA_TREE_H
) jcf-dump.c \
268 jcf-reader.c jcf.h javaop.h javaop.def
$(srcdir)/..
/version.h
269 gjavah.o
: $(CONFIG_H
) $(srcdir)/..
/system.h
$(JAVA_TREE_H
) gjavah.c \
270 jcf-reader.c jcf.h javaop.h
$(srcdir)/..
/version.h
271 boehm.o
: boehm.c
$(CONFIG_H
) $(srcdir)/..
/system.h
$(TREE_H
) $(JAVA_TREE_H
) \
273 buffer.o
: buffer.c
$(CONFIG_H
) buffer.h
$(srcdir)/..
/gansidecl.h \
274 $(srcdir)/..
/system.h
$(srcdir)/..
/toplev.h
275 check-init.o
: check-init.c
$(CONFIG_H
) $(srcdir)/..
/gansidecl.h \
276 $(JAVA_TREE_H
) $(srcdir)/..
/system.h
$(srcdir)/..
/toplev.h
277 class.o
: class.c
$(CONFIG_H
) $(JAVA_TREE_H
) $(RTL_H
) jcf.h
$(PARSE_H
) \
278 $(srcdir)/..
/gansidecl.h
$(srcdir)/..
/toplev.h
$(srcdir)/..
/system.h \
279 $(srcdir)/..
/output.h
280 constants.o
: constants.c
$(CONFIG_H
) $(JAVA_TREE_H
) jcf.h \
281 $(srcdir)/..
/toplev.h
$(srcdir)/..
/system.h
282 decl.o
: decl.c
$(CONFIG_H
) $(JAVA_TREE_H
) jcf.h \
283 $(srcdir)/..
/toplev.h
$(srcdir)/..
/system.h
$(srcdir)/..
/function.h \
284 $(srcdir)/..
/defaults.h
285 except.o
: except.c
$(CONFIG_H
) $(JAVA_TREE_H
) jcf.h
$(srcdir)/..
/real.h \
286 $(RTL_H
) javaop.h java-opcodes.h
$(srcdir)/..
/except.h java-except.h \
287 $(srcdir)/..
/eh-common.h
$(srcdir)/..
/toplev.h
$(srcdir)/..
/system.h \
288 $(srcdir)/..
/function.h
289 expr.o
: expr.c
$(CONFIG_H
) $(JAVA_TREE_H
) jcf.h
$(srcdir)/..
/real.h \
290 $(RTL_H
) $(EXPR_H
) javaop.h java-opcodes.h
$(srcdir)/..
/except.h \
291 java-except.h java-except.h parse.h
$(srcdir)/..
/toplev.h \
292 $(srcdir)/..
/system.h
293 jcf-depend.o
: jcf-depend.c
$(CONFIG_H
) $(srcdir)/..
/system.h jcf.h
294 jcf-io.o
: jcf-io.c
$(CONFIG_H
) $(srcdir)/..
/system.h
$(JAVA_TREE_H
)
295 jcf-parse.o
: jcf-parse.c
$(CONFIG_H
) $(JAVA_TREE_H
) $(srcdir)/..
/flags.h \
296 $(srcdir)/..
/input.h java-except.h
$(srcdir)/..
/system.h \
297 $(srcdir)/..
/toplev.h
$(PARSE_H
)
298 jcf-write.o
: jcf-write.c
$(CONFIG_H
) $(JAVA_TREE_H
) jcf.h
$(RTL_H
) \
299 java-opcodes.h parse.h buffer.h
$(srcdir)/..
/system.h
$(srcdir)/..
/toplev.h
300 jv-scan.o
: jv-scan.c
$(CONFIG_H
) $(srcdir)/..
/system.h
$(srcdir)/..
/version.h
301 jvgenmain.o
: jvgenmain.c
$(CONFIG_H
) $(srcdir)/..
/system.h
302 lang.o
: lang.c
$(CONFIG_H
) $(JAVA_TREE_H
) jcf.h
$(srcdir)/..
/input.h \
303 $(srcdir)/..
/toplev.h
$(srcdir)/..
/system.h
$(RTL_H
) $(EXPR_H
)
304 mangle.o
: mangle.c
$(CONFIG_H
) jcf.h
$(JAVA_TREE_H
) $(srcdir)/..
/system.h \
305 $(srcdir)/..
/toplev.h
306 parse-scan.o
: $(CONFIG_H
) $(srcdir)/..
/system.h
$(srcdir)/..
/toplev.h \
307 $(srcdir)/lex.c
$(PARSE_H
) $(srcdir)/lex.h
308 typeck.o
: typeck.c
$(CONFIG_H
) $(JAVA_TREE_H
) jcf.h convert.h \
309 $(srcdir)/..
/toplev.h
$(srcdir)/..
/system.h
310 verify.o
: verify.c
$(CONFIG_H
) $(JAVA_TREE_H
) jcf.h javaop.h java-opcodes.h \
311 java-except.h
$(srcdir)/..
/toplev.h
$(srcdir)/..
/system.h
312 xref.o
: xref.c xref.h
$(CONFIG_H
) $(JAVA_TREE_H
) $(srcdir)/..
/toplev.h \
313 $(srcdir)/..
/system.h
314 zextract.o
: zextract.c
$(CONFIG_H
) $(srcdir)/..
/system.h zipfile.h