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 # Top build directory, relative to here.
108 # Internationalization library.
109 INTLLIBS
= @INTLLIBS@
111 # Choose the real default target.
114 # End of variables for you to override.
116 # Definition of `all' is here so that new rules inserted by sed
117 # do not specify the default target.
120 # This tells GNU Make version 3 not to put all variables in the environment.
123 # sed inserts variable overrides after the following line.
134 # Now figure out from those variables how to compile and link.
136 all.indirect
: Makefile ..
/jc1
$(exeext
) ..
/jcf-dump
$(exeext
) \
137 ..
/jvgenmain
$(exeext
) ..
/gcjh
$(exeext
) ..
/jv-scan
$(exeext
)
139 # IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
140 INTERNAL_CFLAGS
= $(CROSS
) -DIN_GCC @extra_c_flags@
142 # This is the variable actually used when we compile.
143 ALL_CFLAGS
= $(INTERNAL_CFLAGS
) $(X_CFLAGS
) $(T_CFLAGS
) $(CFLAGS
) $(XCFLAGS
) -W
-Wall
146 ALL_CPPFLAGS
= $(CPPFLAGS
) $(X_CPPFLAGS
) $(T_CPPFLAGS
)
148 # This is where we get libiberty.a from.
149 LIBIBERTY
= ..
/..
/libiberty
/libiberty.a
151 # This is where we get zlib from. zlibdir is -L../../zlib by default,
152 # and is nothing when configured with --enable-system-zlib.
155 # How to link with both our special library facilities
156 # and the system's installed libraries.
157 LIBS
= $(ZLIB
) $(INTLLIBS
) $(LIBIBERTY
) $(CLIB
)
158 LIBDEPS
= $(INTLLIBS
) $(LIBIBERTY
) ..
/errors.o
160 # Specify the directories to be searched for header files.
161 # Both . and srcdir are used, in that order,
162 # so that tm.h and config.h will be found in the compilation
163 # subdirectory rather than in the source directory.
164 INCLUDES
= -I.
-I..
-I
$(srcdir) -I
$(srcdir)/..
-I
$(srcdir)/..
/config
-I
$(srcdir)/..
/..
/include @zlibinc@
166 # Always use -I$(srcdir)/config when compiling.
168 $(CC
) -c
$(ALL_CFLAGS
) $(ALL_CPPFLAGS
) $(INCLUDES
) $<
171 # Lists of files for various purposes.
173 # Language-specific object files for Gcc/Java:
175 # Remember to keep this list in sync with JAVA_SRCS in Make-lang.in!!!
177 JAVA_OBJS
= parse.o class.o decl.o expr.o constants.o lang.o typeck.o \
178 except.o verify.o zextract.o jcf-io.o jcf-parse.o mangle.o jcf-write.o \
179 buffer.o check-init.o jcf-depend.o jcf-path.o xref.o boehm.o
181 JAVA_OBJS_LITE
= parse-scan.o jv-scan.o
183 # Language-independent object files.
184 BACKEND
= ..
/toplev.o ..
/libbackend.a
186 compiler
: ..
/jc1
$(exeext
) ..
/jv-scan
$(exeext
)
187 ..
/jc1
$(exeext
): $(P
) $(JAVA_OBJS
) $(BACKEND
) $(LIBDEPS
)
188 rm -f ..
/jc1
$(exeext
)
189 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
$@
$(JAVA_OBJS
) $(BACKEND
) $(LIBS
)
190 ..
/jv-scan
$(exeext
): $(P
) $(JAVA_OBJS_LITE
) ..
/version.o
$(LIBDEPS
)
191 rm -f ..
/jv-scan
$(exeext
)
192 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
$@
$(JAVA_OBJS_LITE
) ..
/version.o
$(LIBS
)
194 ..
/jcf-dump
$(exeext
): jcf-dump.o jcf-io.o jcf-depend.o jcf-path.o \
195 zextract.o ..
/version.o
$(LIBDEPS
)
196 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
$@ jcf-dump.o jcf-io.o \
197 jcf-depend.o jcf-path.o zextract.o ..
/errors.o ..
/version.o
$(LIBS
)
199 # Dependencies here must be kept in sync with dependencies in Make-lang.in.
200 ..
/jvgenmain
$(exeext
): jvgenmain.o mangle.o
$(LIBDEPS
)
201 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
$@ jvgenmain.o mangle.o
$(LIBS
)
203 ..
/gcjh
$(exeext
): gjavah.o jcf-io.o jcf-depend.o jcf-path.o \
204 zextract.o ..
/version.o
$(LIBDEPS
)
205 $(CC
) $(ALL_CFLAGS
) $(LDFLAGS
) -o
$@ gjavah.o jcf-io.o \
206 jcf-depend.o jcf-path.o zextract.o ..
/errors.o ..
/version.o
$(LIBS
)
208 Makefile
: $(srcdir)/Makefile.in
$(srcdir)/..
/configure
209 cd ..
; $(SHELL
) config.status
211 native
: config.status ..
/jc1
$(exeext
)
213 # Compiling object files from source files.
214 TREE_H
= $(srcdir)/..
/tree.h
$(srcdir)/..
/real.h
$(srcdir)/..
/tree.def \
215 $(srcdir)/..
/machmode.h
$(srcdir)/..
/machmode.def ..
/tree-check.h
216 JAVA_TREE_H
= $(TREE_H
) java-tree.h java-tree.def
217 RTL_H
= $(srcdir)/..
/rtl.h
$(srcdir)/..
/rtl.def \
218 $(srcdir)/..
/machmode.h
$(srcdir)/..
/machmode.def ..
/genrtl.h
219 EXPR_H
= $(srcdir)/..
/expr.h ..
/insn-codes.h
221 # Separating PARSE_DIR from PARSE_RELDIR lets us easily change the
222 # code to support building parse.c in the build directory, at some
223 # expense in readability.
224 # This code must be kept in sync with Make-lang.in.
225 PARSE_DIR
= $(srcdir)
227 PARSE_C
= $(PARSE_DIR
)/parse.c
228 PARSE_SCAN_C
= $(PARSE_DIR
)/parse-scan.c
229 PARSE_H
= $(srcdir)/parse.h
231 $(PARSE_C
): $(srcdir)/parse.y
233 cd
$(PARSE_DIR
) && $$bison -t
$(BISONFLAGS
) $(JAVABISONFLAGS
) \
234 -o parse.c
$(PARSE_RELDIR
)/parse.y
235 $(PARSE_SCAN_C
): $(srcdir)/parse-scan.y
237 cd
$(PARSE_DIR
) && $$bison -t
$(BISONFLAGS
) -o parse-scan.c \
238 $(PARSE_RELDIR
)/parse-scan.y
240 lex.c
: keyword.h
lex.h
242 lang.o
: $(srcdir)/java-tree.def
244 keyword.h
: keyword.gperf
245 gperf
-L C
-F
', 0' -p
-t
-j1
-i
1 -g
-o
-N java_keyword
-k1
,3,$$ \
246 keyword.gperf
> keyword.h ||
( \
247 echo
"Please update your 'gperf' from the GCC infrastructure" >&2 ; \
248 echo
" ftp://sourceware.cygnus.com/pub/egcs/infrastructure/gperf*" >&2 ; \
251 jcf-path.o
: jcf-path.c
$(CONFIG_H
) $(srcdir)/..
/system.h jcf.h
252 $(CC
) -c
$(ALL_CFLAGS
) $(ALL_CPPFLAGS
) $(INCLUDES
) \
253 -DLIBGCJ_ZIP_FILE
='"$(libgcj_zip)"' $(srcdir)/jcf-path.c
255 # These exist for maintenance purposes.
257 # Update the tags table.
261 echo
'l' | tr
'l' '\f' >> TAGS
; \
262 echo
'parse.y,0' >> TAGS
; \
263 etags
-a ..
/*.h ..
/*.c
;
274 parse.o
: $(PARSE_C
) jcf-reader.c
$(CONFIG_H
) $(srcdir)/..
/system.h \
275 $(srcdir)/..
/function.h
$(JAVA_TREE_H
) $(srcdir)/lex.c
$(PARSE_H
) \
276 $(srcdir)/lex.h
$(srcdir)/..
/ggc.h
277 jcf-dump.o
: $(CONFIG_H
) $(srcdir)/..
/system.h
$(JAVA_TREE_H
) jcf-dump.c \
278 jcf-reader.c jcf.h javaop.h javaop.def
$(srcdir)/..
/version.h
279 gjavah.o
: $(CONFIG_H
) $(srcdir)/..
/system.h
$(JAVA_TREE_H
) gjavah.c \
280 jcf-reader.c jcf.h javaop.h
$(srcdir)/..
/version.h
281 boehm.o
: boehm.c
$(CONFIG_H
) $(srcdir)/..
/system.h
$(TREE_H
) $(JAVA_TREE_H
) \
283 buffer.o
: buffer.c
$(CONFIG_H
) buffer.h
$(srcdir)/..
/gansidecl.h \
284 $(srcdir)/..
/system.h
$(srcdir)/..
/toplev.h
285 check-init.o
: check-init.c
$(CONFIG_H
) $(srcdir)/..
/gansidecl.h \
286 $(JAVA_TREE_H
) $(srcdir)/..
/system.h
$(srcdir)/..
/toplev.h
287 class.o
: class.c
$(CONFIG_H
) $(JAVA_TREE_H
) $(RTL_H
) jcf.h
$(PARSE_H
) \
288 $(srcdir)/..
/gansidecl.h
$(srcdir)/..
/toplev.h
$(srcdir)/..
/system.h \
289 $(srcdir)/..
/output.h
$(srcdir)/..
/ggc.h
290 constants.o
: constants.c
$(CONFIG_H
) $(JAVA_TREE_H
) jcf.h \
291 $(srcdir)/..
/toplev.h
$(srcdir)/..
/system.h
$(srcdir)/..
/ggc.h
292 decl.o
: decl.c
$(CONFIG_H
) $(JAVA_TREE_H
) jcf.h \
293 $(srcdir)/..
/toplev.h
$(srcdir)/..
/system.h
$(srcdir)/..
/function.h \
294 $(srcdir)/..
/defaults.h
$(srcdir)/..
/gcc.h
295 except.o
: except.c
$(CONFIG_H
) $(JAVA_TREE_H
) jcf.h
$(srcdir)/..
/real.h \
296 $(RTL_H
) javaop.h java-opcodes.h
$(srcdir)/..
/except.h java-except.h \
297 $(srcdir)/..
/eh-common.h
$(srcdir)/..
/toplev.h
$(srcdir)/..
/system.h \
298 $(srcdir)/..
/function.h
299 expr.o
: expr.c
$(CONFIG_H
) $(JAVA_TREE_H
) jcf.h
$(srcdir)/..
/real.h \
300 $(RTL_H
) $(EXPR_H
) javaop.h java-opcodes.h
$(srcdir)/..
/except.h \
301 java-except.h java-except.h parse.h
$(srcdir)/..
/toplev.h \
302 $(srcdir)/..
/system.h
$(srcdir)/..
/ggc.h
303 jcf-depend.o
: jcf-depend.c
$(CONFIG_H
) $(srcdir)/..
/system.h jcf.h
304 jcf-io.o
: jcf-io.c
$(CONFIG_H
) $(srcdir)/..
/system.h
$(JAVA_TREE_H
)
305 jcf-parse.o
: jcf-parse.c
$(CONFIG_H
) $(JAVA_TREE_H
) $(srcdir)/..
/flags.h \
306 $(srcdir)/..
/input.h java-except.h
$(srcdir)/..
/system.h \
307 $(srcdir)/..
/toplev.h
$(PARSE_H
) $(srcdir)/..
/ggc.h
308 jcf-write.o
: jcf-write.c
$(CONFIG_H
) $(JAVA_TREE_H
) jcf.h
$(RTL_H
) \
309 java-opcodes.h parse.h buffer.h
$(srcdir)/..
/system.h \
310 $(srcdir)/..
/toplev.h
$(srcdir)/..
/ggc.h
311 jv-scan.o
: jv-scan.c
$(CONFIG_H
) $(srcdir)/..
/system.h
$(srcdir)/..
/version.h
312 jvgenmain.o
: jvgenmain.c
$(CONFIG_H
) $(srcdir)/..
/system.h
313 lang.o
: lang.c
$(CONFIG_H
) $(JAVA_TREE_H
) jcf.h
$(srcdir)/..
/input.h \
314 $(srcdir)/..
/toplev.h
$(srcdir)/..
/system.h
$(RTL_H
) $(EXPR_H
)
315 mangle.o
: mangle.c
$(CONFIG_H
) jcf.h
$(JAVA_TREE_H
) $(srcdir)/..
/system.h \
316 $(srcdir)/..
/toplev.h
$(srcdir)/..
/ggc.h
317 parse-scan.o
: $(CONFIG_H
) $(srcdir)/..
/system.h
$(srcdir)/..
/toplev.h \
318 $(srcdir)/lex.c
$(PARSE_H
) $(srcdir)/lex.h
319 typeck.o
: typeck.c
$(CONFIG_H
) $(JAVA_TREE_H
) jcf.h convert.h \
320 $(srcdir)/..
/toplev.h
$(srcdir)/..
/system.h
$(srcdir)/..
/ggc.h
321 verify.o
: verify.c
$(CONFIG_H
) $(JAVA_TREE_H
) jcf.h javaop.h java-opcodes.h \
322 java-except.h
$(srcdir)/..
/toplev.h
$(srcdir)/..
/system.h
323 xref.o
: xref.c xref.h
$(CONFIG_H
) $(JAVA_TREE_H
) $(srcdir)/..
/toplev.h \
324 $(srcdir)/..
/system.h
325 zextract.o
: zextract.c
$(CONFIG_H
) $(srcdir)/..
/system.h zipfile.h