OSDN Git Service

* Makefile.in (INCLUDES): Update for recent toplevel gcc changes.
[pf3gnuchains/gcc-fork.git] / gcc / java / Makefile.in
1 # Makefile for GNU compiler for the Java(TM) language.
2 #   Copyright (C) 1987, 88, 90-4, 1995, 1998 Free Software Foundation, Inc.
3
4 #This file is part of GNU CC.
5
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.
10
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.
15
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.
20
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.
24
25 # The makefile built from this file lives in the language subdirectory.
26 # Its purpose is to provide support for:
27 #
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.
31 #
32 # The parent makefile handles all other chores, with help from the
33 # language makefile fragment, of course.
34 #
35 # The targets for external use are:
36 # all, TAGS, ???mostlyclean, ???clean.
37
38 # Suppress smart makes who think they know how to automake Yacc files
39 .y.c:
40
41 # Variables that exist for you to override.
42 # See below for how to change them for certain systems.
43
44 ALLOCA =
45
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 =
57
58 X_CPPFLAGS =
59 T_CPPFLAGS =
60
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
72
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 =
77
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
81
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)
86
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.
90
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 = .
96
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`
102
103 # Directory where sources are, from where we are.
104 srcdir = @srcdir@
105 VPATH = @srcdir@
106
107 # Additional system libraries to link with.
108 CLIB=
109
110 # Change this to a null string if obstacks are installed in the
111 # system library.
112 OBSTACK=obstack.o
113
114 # Choose the real default target.
115 ALL=all
116
117 # End of variables for you to override.
118
119 # Definition of `all' is here so that new rules inserted by sed
120 # do not specify the default target.
121 all: all.indirect
122
123 # This tells GNU Make version 3 not to put all variables in the environment.
124 .NOEXPORT:
125
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
136 \f
137 # Now figure out from those variables how to compile and link.
138
139 all.indirect: Makefile ../jc1$(exeext) ../jcf-dump$(exeext) \
140         ../jvgenmain$(exeext) ../gcjh$(exeext) ../jv-scan$(exeext)
141
142 # IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
143 INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@
144
145 # This is the variable actually used when we compile.
146 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
147
148 # Likewise.
149 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
150
151 # Even if ALLOCA is set, don't use it if compiling with GCC.
152
153 SUBDIR_OBSTACK = `if [ x$(OBSTACK) != x ]; then echo ../$(OBSTACK); else true; fi`
154 SUBDIR_USE_ALLOCA = `case "${CC}" in "${OLDCC}") if [ x$(ALLOCA) != x ]; then echo ../$(ALLOCA); else true; fi ;; esac`
155 SUBDIR_MALLOC = `if [ x$(MALLOC) != x ]; then echo ../$(MALLOC); else true; fi`
156
157 # How to link with both our special library facilities
158 # and the system's installed libraries.
159 LIBS = $(SUBDIR_OBSTACK) $(SUBDIR_USE_ALLOCA) $(SUBDIR_MALLOC) $(CLIB)
160
161 # Specify the directories to be searched for header files.
162 # Both . and srcdir are used, in that order,
163 # so that tm.h and config.h will be found in the compilation
164 # subdirectory rather than in the source directory.
165 INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config -I$(srcdir)/../../include
166
167 # Always use -I$(srcdir)/config when compiling.
168 .c.o:
169         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
170
171 # This tells GNU make version 3 not to export all the variables
172 # defined in this file into the environment.
173 .NOEXPORT:
174 \f
175 # Lists of files for various purposes.
176
177 # Language-specific object files for Gcc/Java:
178
179 # Remember to keep this list in sync with JAVA_SRCS in Make-lang.in!!!
180 #
181 JAVA_OBJS = parse.o class.o decl.o expr.o constants.o lang.o typeck.o \
182   except.o verify.o zextract.o jcf-io.o jcf-parse.o mangle.o jcf-write.o \
183   buffer.o
184
185 JAVA_OBJS_LITE = parse-scan.o jv-scan.o
186
187 # Language-independent object files.
188 OBJS = `cat ../stamp-objlist`
189 OBJDEPS = ../stamp-objlist
190
191 compiler: ../jc1$(exeext) ../jv-scan$(exeext)
192 ../jc1$(exeext): $(P) $(JAVA_OBJS) $(OBJDEPS) $(LIBDEPS)
193         rm -f ../jc1$(exeext)
194         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
195               $(JAVA_OBJS) $(OBJS) $(LIBS)
196 ../jv-scan$(exeext): $(P) $(JAVA_OBJS_LITE) $(OBJDEPS) $(LIBDEPS)
197         rm -f ../jv-scan$(exeext)
198         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
199               $(JAVA_OBJS_LITE) $(LIBS)
200
201 ../jcf-dump$(exeext): jcf-dump.o jcf-io.o zextract.o
202         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ jcf-dump.o jcf-io.o zextract.o
203
204 # Dependencies here must be kept in sync with dependencies in Make-lang.in.
205 ../jvgenmain$(exeext):  jvgenmain.o mangle.o
206         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ jvgenmain.o mangle.o ../obstack.o
207
208 ../gcjh$(exeext): gjavah.o jcf-io.o zextract.o
209         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gjavah.o jcf-io.o zextract.o
210
211 Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
212         cd ..; $(SHELL) config.status
213
214 native: config.status ../jc1$(exeext)
215 \f
216 # Compiling object files from source files.
217
218 PARSE_H = $(srcdir)/parse.h
219 PARSE_C = $(srcdir)/parse.c
220 PARSE_SCAN_C = $(srcdir)/parse-scan.c
221
222 $(PARSE_H): $(PARSE_C)
223 $(PARSE_C):  $(srcdir)/parse.y $(srcdir)/lex.c $(PARSE_H) $(srcdir)/lex.h
224         $(BISON) -t -v $(BISONFLAGS) $(JAVABISONFLAGS) -o $(PARSE_C) \
225           $(srcdir)/parse.y
226 $(PARSE_SCAN_C):  $(srcdir)/parse-scan.y $(srcdir)/lex.c $(PARSE_H) \
227                 $(srcdir)/lex.h
228         $(BISON) -t -v $(BISONFLAGS) -o $(PARSE_SCAN_C) $(srcdir)/parse-scan.y
229
230 lex.c: keyword.h lex.h
231
232 keyword.h: keyword.gperf
233         gperf -p -t -j1 -i 1 -g -o -N java_keyword -k1,3,$$ \
234         keyword.gperf > keyword.h
235
236 # These exist for maintenance purposes.
237
238 # Update the tags table.
239 TAGS: force
240         cd $(srcdir) ;                          \
241         etags *.c *.h ;                         \
242         echo 'l' | tr 'l' '\f' >> TAGS ;        \
243         echo 'parse.y,0' >> TAGS ;              \
244         etags -a ../*.h ../*.c;
245
246 .PHONY: TAGS
247
248 mostlyclean:
249         rm -f *.o
250
251 clean:  mostlyclean
252         rm -f parse.c
253
254 force:
255
256 parse.o: $(PARSE_C) jcf-reader.c
257 jcf-dump.o: jcf-reader.c jcf.h javaop.h javaop.def
258 gjavah.o: jcf-reader.c jcf.h javaop.h