[official-gcc.git] / gcc / java / Makefile.in
blobd7e009d4a49f83c23d29192e4d9938a415e537d3
1 # Makefile for GNU compiler for the Java(TM) language.
2 # Copyright (C) 1987, 88, 90-4, 1995, 1998 Free Software Foundation, Inc.
4 #This file is part of GNU CC.
6 #GNU CC is free software; you can redistribute it and/or modify
7 #it under the terms of the GNU General Public License as published by
8 #the Free Software Foundation; either version 2, or (at your option)
9 #any later version.
11 #GNU CC is distributed in the hope that it will be useful,
12 #but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 #GNU General Public License for more details.
16 #You should have received a copy of the GNU General Public License
17 #along with GNU CC; see the file COPYING. If not, write to
18 #the Free Software Foundation, 59 Temple Place - Suite 330,
19 #Boston, MA 02111-1307, USA.
21 #Java and all Java-based marks are trademarks or registered trademarks
22 #of Sun Microsystems, Inc. in the United States and other countries.
23 #The Free Software Foundation is independent of Sun Microsystems, Inc.
25 # The makefile built from this file lives in the language subdirectory.
26 # Its purpose is to provide support for:
28 # 1) recursion where necessary, and only then (building .o's), and
29 # 2) building and debugging cc1 from the language subdirectory, and
30 # 3) nothing else.
32 # The parent makefile handles all other chores, with help from the
33 # language makefile fragment, of course.
35 # The targets for external use are:
36 # all, TAGS, ???mostlyclean, ???clean.
38 # Suppress smart makes who think they know how to automake Yacc files
39 .y.c:
41 # Variables that exist for you to override.
42 # See below for how to change them for certain systems.
44 ALLOCA =
46 # Various ways of specifying flags for compilations:
47 # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
48 # BOOT_CFLAGS is the value of CFLAGS to pass
49 # to the stage2 and stage3 compilations
50 # XCFLAGS is used for most compilations but not when using the GCC just built.
51 XCFLAGS =
52 CFLAGS = -g
53 BOOT_CFLAGS = -O $(CFLAGS)
54 # These exists to be overridden by the x-* and t-* files, respectively.
55 X_CFLAGS =
56 T_CFLAGS =
58 X_CPPFLAGS =
59 T_CPPFLAGS =
61 CC = @CC@
62 BISON = `if [ -f ../../bison/bison ] ; then echo ../../bison/bison -L $(srcdir)/../../bison/ ; else echo bison ; fi`
63 BISONFLAGS =
64 JAVABISONFLAGS = --name-prefix=java_
65 LEX = `if [ -f ../../flex/flex ] ; then echo ../../flex/flex ; else echo flex ; fi`
66 LEXFLAGS =
67 AR = ar
68 AR_FLAGS = rc
69 SHELL = /bin/sh
70 MAKEINFO = makeinfo
71 TEXI2DVI = texi2dvi
73 # Define this as & to perform parallel make on a Sequent.
74 # Note that this has some bugs, and it seems currently necessary
75 # to compile all the gen* files first by hand to avoid erroneous results.
76 P =
78 # This is used in the definition of SUBDIR_USE_ALLOCA.
79 # ??? Perhaps it would be better if it just looked for *gcc*.
80 OLDCC = cc
82 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
83 # It omits XCFLAGS, and specifies -B./.
84 # It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
85 GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
87 # Tools to use when building a cross-compiler.
88 # These are used because `configure' appends `cross-make'
89 # to the makefile when making a cross-compiler.
91 # We don't use cross-make. Instead we use the tools
92 # from the build tree, if they are available.
93 # program_transform_name and objdir are set by configure.in.
94 program_transform_name =
95 objdir = .
97 +target=@target@
98 +xmake_file=@dep_host_xmake_file@
99 +tmake_file=@dep_tmake_file@
100 #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
101 #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
103 # Directory where sources are, from where we are.
104 srcdir = @srcdir@
105 VPATH = @srcdir@
107 # Additional system libraries to link with.
108 CLIB=
110 # Change this to a null string if obstacks are installed in the
111 # system library.
112 OBSTACK=obstack.o
114 # Choose the real default target.
115 ALL=all
117 # End of variables for you to override.
119 # Definition of `all' is here so that new rules inserted by sed
120 # do not specify the default target.
121 all: all.indirect
123 # This tells GNU Make version 3 not to put all variables in the environment.
124 .NOEXPORT:
126 # sed inserts variable overrides after the following line.
127 ####target overrides
128 @target_overrides@
129 ####host overrides
130 @host_overrides@
131 ####cross overrides
132 @cross_overrides@
133 ####build overrides
134 @build_overrides@
135 ####site overrides
137 # Now figure out from those variables how to compile and link.
139 all.indirect: Makefile ../jc1$(exeext) ../jcf-dump$(exeext) \
140 ../jvgenmain$(exeext) ../gcjh$(exeext) ../jv-scan$(exeext)
142 # IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
143 INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@
145 # This is the variable actually used when we compile.
146 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
148 # Likewise.
149 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
151 # CYGNUS LOCAL: SUBDIR_USE_ALLOCA is different from FSF.
152 # Even if ALLOCA is set, don't use it if compiling with GCC.
154 SUBDIR_OBSTACK = `if [ x$(OBSTACK) != x ]; then echo ../$(OBSTACK); else true; fi`
155 #SUBDIR_USE_ALLOCA = `case "${CC}" in "${OLDCC}") if [ x$(ALLOCA) != x ]; then echo ../$(ALLOCA); else true; fi ;; esac`
156 SUBDIR_USE_ALLOCA = `if [ x$(ALLOCA) != x ]; then echo ../$(ALLOCA); else true; fi`
157 SUBDIR_MALLOC = `if [ x$(MALLOC) != x ]; then echo ../$(MALLOC); else true; fi`
159 # How to link with both our special library facilities
160 # and the system's installed libraries.
161 LIBS = $(SUBDIR_OBSTACK) $(SUBDIR_USE_ALLOCA) $(SUBDIR_MALLOC) $(CLIB)
163 # Specify the directories to be searched for header files.
164 # Both . and srcdir are used, in that order,
165 # so that tm.h and config.h will be found in the compilation
166 # subdirectory rather than in the source directory.
167 INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config -I$(srcdir)/../../include
169 # Always use -I$(srcdir)/config when compiling.
170 .c.o:
171 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
173 # This tells GNU make version 3 not to export all the variables
174 # defined in this file into the environment.
175 .NOEXPORT:
177 # Lists of files for various purposes.
179 # Language-specific object files for Gcc/Java:
181 # Remember to keep this list in sync with JAVA_SRCS in Make-lang.in!!!
183 JAVA_OBJS = parse.o class.o decl.o expr.o constants.o lang.o typeck.o \
184 except.o verify.o zextract.o jcf-io.o jcf-parse.o mangle.o jcf-write.o \
185 buffer.o memmove.o
187 JAVA_OBJS_LITE = parse-scan.o jv-scan.o
189 # Language-independent object files.
190 OBJS = `cat ../stamp-objlist`
191 OBJDEPS = ../stamp-objlist
193 compiler: ../jc1$(exeext) ../jv-scan$(exeext)
194 ../jc1$(exeext): $(P) $(JAVA_OBJS) $(OBJDEPS) $(LIBDEPS)
195 rm -f ../jc1$(exeext)
196 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
197 $(JAVA_OBJS) $(OBJS) $(LIBS)
198 ../jv-scan$(exeext): $(P) $(JAVA_OBJS_LITE) $(OBJDEPS) $(LIBDEPS)
199 rm -f ../jv-scan$(exeext)
200 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
201 $(JAVA_OBJS_LITE) $(LIBS)
203 ../jcf-dump$(exeext): jcf-dump.o jcf-io.o zextract.o memmove.o
204 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ jcf-dump.o jcf-io.o zextract.o memmove.o
206 # Dependencies here must be kept in sync with dependencies in Make-lang.in.
207 ../jvgenmain$(exeext): jvgenmain.o mangle.o
208 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ jvgenmain.o mangle.o ../obstack.o
210 ../gcjh$(exeext): gjavah.o jcf-io.o zextract.o memmove.o
211 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gjavah.o jcf-io.o zextract.o memmove.o
213 Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
214 cd ..; $(SHELL) config.status
216 memmove.o: $(srcdir)/../../libiberty/memmove.c
217 rm -f memmove.c
218 $(LN_S) $(srcdir)/../../libiberty/memmove.c memmove.c
219 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) memmove.c
221 native: config.status ../jc1$(exeext)
223 # Compiling object files from source files.
224 TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../tree.def \
225 $(srcdir)/../machmode.h $(srcdir)/../machmode.def
226 JAVA_TREE_H = $(TREE_H) java-tree.h java-tree.def
227 RTL_H = $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
228 $(srcdir)/../machmode.h $(srcdir)/../machmode.def
229 EXPR_H = $(srcdir)/../expr.h ../insn-codes.h
231 # CYGNUS LOCAL: we put these files into the build dir.
232 PARSE_C = parse.c
233 PARSE_SCAN_C = parse-scan.c
234 PARSE_H = $(srcdir)/parse.h
236 $(PARSE_C): $(srcdir)/parse.y $(srcdir)/lex.c $(PARSE_H) $(srcdir)/lex.h
237 $(BISON) -t -v $(BISONFLAGS) $(JAVABISONFLAGS) -o $(PARSE_C) \
238 $(srcdir)/parse.y
239 $(PARSE_SCAN_C): $(srcdir)/parse-scan.y $(srcdir)/lex.c $(PARSE_H) \
240 $(srcdir)/lex.h
241 $(BISON) -t -v $(BISONFLAGS) -o $(PARSE_SCAN_C) $(srcdir)/parse-scan.y
243 lex.c: keyword.h lex.h
245 lang.o: $(srcdir)/java-tree.def
247 keyword.h: keyword.gperf
248 gperf -L KR-C -F ', 0' -p -t -j1 -i 1 -g -o -N java_keyword -k1,3,$$ \
249 keyword.gperf > keyword.h
251 # These exist for maintenance purposes.
253 # Update the tags table.
254 TAGS: force
255 cd $(srcdir) ; \
256 etags *.c *.h ; \
257 echo 'l' | tr 'l' '\f' >> TAGS ; \
258 echo 'parse.y,0' >> TAGS ; \
259 etags -a ../*.h ../*.c;
261 .PHONY: TAGS
263 mostlyclean:
264 rm -f *.o
266 # CYGNUS LOCAL: Remove these files, as they are in the build dir.
267 clean: mostlyclean
268 rm -f parse.c parse-scan.c
270 force:
272 parse.o: $(PARSE_C) jcf-reader.c
273 jcf-dump.o: jcf-reader.c jcf.h javaop.h javaop.def
274 gjavah.o: jcf-reader.c jcf.h javaop.h
275 buffer.o : buffer.c $(CONFIG_H) buffer.h $(srcdir)/../gansidecl.h \
276 $(srcdir)/../system.h $(srcdir)/../toplev.h
277 class.o : class.c $(CONFIG_H) $(JAVA_TREE_H) $(RTL_H) jcf.h \
278 $(srcdir)/../gansidecl.h $(srcdir)/../toplev.h $(srcdir)/../system.h
279 constants.o : constants.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h \
280 $(srcdir)/../toplev.h $(srcdir)/../system.h
281 decl.o : decl.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h \
282 $(srcdir)/../toplev.h $(srcdir)/../system.h
283 except.o : except.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h $(srcdir)/../real.h \
284 $(RTL_H) javaop.h java-opcodes.h $(srcdir)/../except.h java-except.h \
285 $(srcdir)/../eh-common.h $(srcdir)/../toplev.h $(srcdir)/../system.h
286 expr.o : expr.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h $(srcdir)/../real.h \
287 $(RTL_H) $(EXPR_H) javaop.h java-opcodes.h $(srcdir)/../except.h \
288 java-except.h java-except.h parse.h $(srcdir)/../toplev.h \
289 $(srcdir)/../system.h
290 jcf-io.o: jcf-io.c $(CONFIG_H) $(srcdir)/../system.h
291 jcf-parse.o : jcf-parse.c $(CONFIG_H) $(JAVA_TREE_H) $(srcdir)/../flags.h \
292 $(srcdir)/../input.h java-except.h $(srcdir)/../system.h
293 jcf-write.o : jcf-write.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h $(RTL_H) \
294 java-opcodes.h parse.h buffer.h $(srcdir)/../system.h
295 jvgenmain.o : jvgenmain.c $(CONFIG_H) $(srcdir)/../system.h
296 lang.o : lang.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h $(srcdir)/../input.h \
297 $(srcdir)/../toplev.h $(srcdir)/../system.h
298 mangle.o : mangle.c $(CONFIG_H) jcf.h $(srcdir)/../system.h
299 typeck.o : typeck.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h convert.h \
300 $(srcdir)/../toplev.h $(srcdir)/../system.h
301 verify.o : verify.c $(CONFIG_H) $(JAVA_TREE_H) jcf.h javaop.h java-opcodes.h \
302 java-except.h $(srcdir)/../toplev.h $(srcdir)/../system.h