1 # Makefile for GNU C++ compiler.
2 # Copyright (C) 1987, 88, 90, 91, 92, 93, 1994 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)
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, 675 Mass Ave, Cambridge, MA 02139, USA.
20 # The targets for external use include:
21 # all, doc, TAGS, mostlyclean, clean, distclean, realclean,
23 # Suppress smart makes who think they know how to automake Yacc files
26 # Variables that exist for you to override.
27 # See below for how to change them for certain systems.
29 INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config
31 # Various ways of specifying flags for compilations:
32 # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
33 # BOOT_CFLAGS is the value of CFLAGS to pass
34 # to the stage2 and stage3 compilations
35 # XCFLAGS is used for most compilations but not when using the GCC just built.
38 BOOT_CFLAGS = -O $(CFLAGS)
39 # These exists to be overridden by the x-* and t-* files, respectively.
58 # Define this as & to perform parallel make on a Sequent.
59 # Note that this has some bugs, and it seems currently necessary
60 # to compile all the gen* files first by hand to avoid erroneous results.
63 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
64 # It omits XCFLAGS, and specifies -B./.
65 # It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
66 GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
68 # Tools to use when building a cross-compiler.
69 # These are used because `configure' appends `cross-make'
70 # to the makefile when making a cross-compiler.
72 # CYGNUS LOCAL: we don't use cross-make. Instead we use the tools
73 # from the build tree, if they are available.
74 # program_transform_name and objdir are set by configure.in.
75 program_transform_name =
78 target= ... `configure' substitutes actual target name here.
79 xmake_file= ... `configure' substitutes actual x- file name here.
80 tmake_file= ... `configure' substitutes actual t- file name here.
81 #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
82 #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
84 # Directory where sources are, from where we are.
87 # Change this to a null string if obstacks are installed in the
91 # Directory to link to, when using the target `maketest'.
94 # Choose the real default target.
97 # End of variables for you to override.
99 # Definition of `all' is here so that new rules inserted by sed
100 # do not specify the default target.
103 # This tells GNU Make version 3 not to put all variables in the environment.
106 # sed inserts variable overrides after the following line.
113 # Now figure out from those variables how to compile and link.
115 all.indirect: Makefile ../cc1plus
117 # IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
118 INTERNAL_CFLAGS = $(CROSS) -DIN_GCC
120 # This is the variable actually used when we compile.
121 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
124 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
126 SUBDIR_OBSTACK = `if [ x$(OBSTACK) != x ]; then echo ../$(OBSTACK); else true; fi`
127 SUBDIR_USE_ALLOCA = `if [ x$(USE_ALLOCA) != x ]; then echo ../$(USE_ALLOCA); else true; fi`
128 SUBDIR_MALLOC = `if [ x$(MALLOC) != x ]; then echo ../$(MALLOC); else true; fi`
130 # How to link with both our special library facilities
131 # and the system's installed libraries.
132 LIBS = $(SUBDIR_OBSTACK) $(SUBDIR_USE_ALLOCA) $(SUBDIR_MALLOC) $(CLIB)
134 # Always use -I$(srcdir)/config when compiling.
136 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
138 # This tells GNU make version 3 not to export all the variables
139 # defined in this file into the environment.
142 # Lists of files for various purposes.
144 # Language-specific object files for g++
146 CXX_OBJS = call.o decl.o errfn.o expr.o pt.o sig.o typeck2.o \
147 class.o decl2.o error.o gc.o lex.o parse.o ptree.o spew.o typeck.o cvt.o \
148 edsel.o except.o init.o method.o search.o tree.o xref.o
150 # Files specific to the C interpreter bytecode compiler(s).
151 BC_OBJS = ../bc-emit.o ../bc-optab.o
153 # Language-independent object files.
154 OBJS = ../toplev.o ../version.o ../tree.o ../print-tree.o ../stor-layout.o ../fold-const.o \
155 ../function.o ../stmt.o ../expr.o ../calls.o ../expmed.o ../explow.o ../optabs.o ../varasm.o \
156 ../rtl.o ../print-rtl.o ../rtlanal.o ../emit-rtl.o ../real.o \
157 ../dbxout.o ../sdbout.o ../dwarfout.o ../xcoffout.o \
158 ../integrate.o ../jump.o ../cse.o ../loop.o ../unroll.o ../flow.o ../stupid.o ../combine.o \
159 ../regclass.o ../local-alloc.o ../global.o ../reload.o ../reload1.o ../caller-save.o \
160 ../insn-peep.o ../reorg.o ../sched.o ../final.o ../recog.o ../reg-stack.o \
161 ../insn-opinit.o ../insn-recog.o ../insn-extract.o ../insn-output.o ../insn-emit.o \
162 ../insn-attrtab.o ../aux-output.o ../getpwd.o ../convert.o \
166 ../cc1plus: $(P) $(CXX_OBJS) $(OBJS) $(BC_OBJS) $(LIBDEPS)
167 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o ../cc1plus \
168 $(CXX_OBJS) $(OBJS) $(BC_OBJS) $(LIBS)
171 Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
172 cd ..; $(SHELL) config.status
174 native: config.status ../cc1plus
176 # Really, really stupid make features, such as SUN's KEEP_STATE, may force
177 # a target to build even if it is up-to-date. So we must verify that
178 # config.status does not exist before failing.
180 @if [ ! -f config.status ] ; then \
181 echo You must configure gcc. Look at the ../INSTALL file for details.; \
188 # Compiling object files from source files.
190 # Note that dependencies on obstack.h are not written
191 # because that file is not part of GCC.
193 # C++ language specific files.
195 TREE_H = ../tree.h ../real.h ../tree.def ../machmode.h ../machmode.def
196 CXX_TREE_H = $(TREE_H) cp-tree.h tree.def
198 parse.o : $(srcdir)/parse.c $(CONFIG_H) $(CXX_TREE_H) ../flags.h lex.h
199 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
200 `echo $(srcdir)/parse.c | sed 's,^\./,,'`
202 $(srcdir)/parse.c $(srcdir)/parse.h : $(srcdir)/parse.y
203 @echo expect 33 reduce/reduce conflicts.
204 cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o parse.c parse.y
205 cd $(srcdir); grep '^#define[ ]*YYEMPTY' parse.c >>parse.h
207 # hash.h really depends on $(srcdir)/gxx.gperf.
208 # But this would screw things for people that don't have gperf,
209 # if gxx.gpref got touched, say.
210 # Thus you have to remove hash.h to force it to be re-made.
212 gperf -p -j1 -g -o -t -N is_reserved_word '-k1,4,7,$$' \
213 $(srcdir)/gxx.gperf >$(srcdir)/hash.h
215 spew.o : spew.c $(CONFIG_H) $(CXX_TREE_H) \
216 parse.h ../flags.h lex.h
217 lex.o : lex.c $(CONFIG_H) $(CXX_TREE_H) \
218 parse.h input.c ../flags.h hash.h lex.h
219 decl.o : decl.c $(CONFIG_H) $(CXX_TREE_H) ../flags.h \
220 lex.h decl.h ../stack.h
221 decl2.o : decl2.c $(CONFIG_H) $(CXX_TREE_H) ../flags.h \
223 typeck2.o : typeck2.c $(CONFIG_H) $(CXX_TREE_H) ../flags.h
224 typeck.o : typeck.c $(CONFIG_H) $(CXX_TREE_H) ../flags.h $(RTL_H)
225 class.o : class.c $(CONFIG_H) $(CXX_TREE_H) ../flags.h
226 call.o : call.c $(CONFIG_H) $(CXX_TREE_H) ../flags.h class.h
227 init.o : init.c $(CONFIG_H) $(CXX_TREE_H) ../flags.h $(RTL_H)
228 method.o : method.c $(CONFIG_H) $(CXX_TREE_H) class.h
229 cvt.o : cvt.c $(CONFIG_H) $(CXX_TREE_H) class.h
230 search.o : search.c $(CONFIG_H) $(CXX_TREE_H) ../stack.h ../flags.h
231 tree.o : tree.c $(CONFIG_H) $(CXX_TREE_H) ../flags.h
232 ptree.o : ptree.c $(CONFIG_H) $(CXX_TREE_H)
233 gc.o : gc.c $(CONFIG_H) $(CXX_TREE_H) ../flags.h
234 except.o : except.c $(CONFIG_H) $(CXX_TREE_H) ../flags.h $(RTL_H)
235 expr.o : expr.c $(CONFIG_H) $(CXX_TREE_H) $(RTL_H) ../flags.h \
236 ../expr.h ../insn-codes.h
237 edsel.o : edsel.c $(CONFIG_H) $(CXX_TREE_H) ../stack.h ../flags.h
238 xref.o : xref.c $(CONFIG_H) $(CXX_TREE_H) ../input.h
239 pt.o : pt.c $(CONFIG_H) $(CXX_TREE_H) decl.h parse.h
240 error.o : error.c $(CONFIG_H) $(CXX_TREE_H)
241 errfn.o : errfn.c $(CONFIG_H) $(CXX_TREE_H)
242 sig.o : sig.c $(CONFIG_H) $(CXX_TREE_H) ../flags.h
250 # Deletion of files made during compilation.
251 # There are four levels of this:
252 # `mostlyclean', `clean', `distclean' and `realclean'.
253 # `mostlyclean' is useful while working on a particular type of machine.
254 # It deletes most, but not all, of the files made by compilation.
255 # It does not delete libgcc.a or its parts, so it won't have to be recompiled.
256 # `clean' deletes everything made by running `make all'.
257 # `distclean' also deletes the files made by config.
258 # `realclean' also deletes everything that could be regenerated automatically.
262 # Delete the stamp files.
264 # Delete debugging dump files.
265 -rm -f *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop
266 -rm -f *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack
267 # Delete unwanted output files from TeX.
268 -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
269 # Delete sorted indices we don't actually use.
270 -rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns
271 -rm -f *.o ../cc1plus
273 # Delete all files made by compilation
274 # that don't exist in the distribution.
278 # Delete all files that users would normally create
279 # while building and installing GCC.
281 -rm -f config.status Makefile *.oaux
284 # Delete anything likely to be found in the source directory
285 # that shouldn't be in the distribution.
286 extraclean: distclean
287 -rm -rf =* ./"#"* *~*
288 -rm -f patch* *.orig *.rej
289 -rm -f *.dvi *.oaux *.d *.[zZ] *.gz
290 -rm -f *.s *.s[0-9] *.i
292 # Get rid of every file that's generated from some other file.
293 # Most of these files ARE PRESENT in the GCC distribution.
296 -rm -f parse.c parse.h parse.output
298 # These exist for maintenance purposes.
300 # This target creates the files that can be rebuilt, but go in the
301 # distribution anyway.
302 distdir: parse.c hash.h
304 # Update the tags table.
308 echo 'l' | tr 'l' '\f' >> TAGS ; \
309 echo 'parse.y,0' >> TAGS ; \
310 etags -a ../*.h ../*.c;
312 .PHONY: clean realclean TAGS