* gcc_update (files_and_dependencies): Remove generated YACC files.
[official-gcc.git] / gcc / cp / Makefile.in
blobefd65bde3941fa3f07ec402d75e661b13136a436
1 # Makefile for GNU C++ compiler.
2 # Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1998,
3 # 1999, 2000 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)
10 #any later version.
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 # The makefile built from this file lives in the language subdirectory.
23 # Its purpose is to provide support for:
25 # 1) recursion where necessary, and only then (building .o's), and
26 # 2) building and debugging cc1 from the language subdirectory, and
27 # 3) nothing else.
29 # The parent makefile handles all other chores, with help from the
30 # language makefile fragment, of course.
32 # The targets for external use are:
33 # all, TAGS, ???mostlyclean, ???clean.
35 # Suppress smart makes who think they know how to automake Yacc files
36 .y.c:
38 # It defines the c++ interface name. It should be changed when the
39 # c++ interface is changed.
40 INTERFACE = 2
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.
50 XCFLAGS =
51 CFLAGS = -g
52 BOOT_CFLAGS = -O $(CFLAGS)
53 # These exists to be overridden by the x-* and t-* files, respectively.
54 X_CFLAGS =
55 T_CFLAGS =
57 X_CPPFLAGS =
58 T_CPPFLAGS =
60 CC = @CC@
61 BISON = `if [ -f ../../bison/bison ] ; then echo ../../bison/bison -L $(srcdir)/../../bison/ ; else echo bison ; fi`
62 BISONFLAGS =
63 LEX = `if [ -f ../../flex/flex ] ; then echo ../../flex/flex ; else echo flex ; fi`
64 LEXFLAGS =
65 AR = ar
66 AR_FLAGS = rc
67 SHELL = /bin/sh
68 MAKEINFO = makeinfo
69 TEXI2DVI = texi2dvi
71 # Define this as & to perform parallel make on a Sequent.
72 # Note that this has some bugs, and it seems currently necessary
73 # to compile all the gen* files first by hand to avoid erroneous results.
74 P =
76 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
77 # It omits XCFLAGS, and specifies -B./.
78 # It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
79 GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
81 # Tools to use when building a cross-compiler.
82 # These are used because `configure' appends `cross-make'
83 # to the makefile when making a cross-compiler.
85 # We don't use cross-make. Instead we use the tools
86 # from the build tree, if they are available.
87 # program_transform_name and objdir are set by configure.in.
88 program_transform_name =
89 objdir = .
91 target=@target@
92 xmake_file=@dep_host_xmake_file@
93 tmake_file=@dep_tmake_file@
94 #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
95 #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
97 # Directory where sources are, from where we are.
98 srcdir = @srcdir@
99 VPATH = @srcdir@
101 # Additional system libraries to link with.
102 CLIB=
104 # Top build directory, relative to here.
105 top_builddir = ..
107 # Internationalization library.
108 INTLLIBS = @INTLLIBS@
110 # Choose the real default target.
111 ALL=all
113 # End of variables for you to override.
115 # Definition of `all' is here so that new rules inserted by sed
116 # do not specify the default target.
117 all: all.indirect
119 # This tells GNU Make version 3 not to put all variables in the environment.
120 .NOEXPORT:
122 # sed inserts variable overrides after the following line.
123 ####target overrides
124 @target_overrides@
125 ####host overrides
126 @host_overrides@
127 ####cross overrides
128 @cross_defines@
129 @cross_overrides@
130 ####build overrides
131 @build_overrides@
133 # Now figure out from those variables how to compile and link.
135 all.indirect: Makefile ../cc1plus$(exeext)
137 # IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
138 INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@
140 # This is the variable actually used when we compile.
141 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS) -W -Wall
143 # Likewise.
144 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
146 # This is where we get libiberty.a from.
147 LIBIBERTY = ../../libiberty/libiberty.a
149 # How to link with both our special library facilities
150 # and the system's installed libraries.
151 LIBS = $(INTLLIBS) $(LIBIBERTY) $(CLIB)
152 LIBDEPS = $(INTLLIBS) $(LIBIBERTY)
154 # Specify the directories to be searched for header files.
155 # Both . and srcdir are used, in that order,
156 # so that tm.h and config.h will be found in the compilation
157 # subdirectory rather than in the source directory.
158 INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config -I$(srcdir)/../../include
160 # Always use -I$(srcdir)/config when compiling.
161 .c.o:
162 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
164 # The only suffixes we want for implicit rules are .c and .o.
165 .SUFFIXES:
166 .SUFFIXES: .c .o
168 # This tells GNU make version 3 not to export all the variables
169 # defined in this file into the environment.
170 .NOEXPORT:
172 # Lists of files for various purposes.
174 # Language-specific object files for g++
176 CXX_OBJS = call.o decl.o errfn.o expr.o pt.o typeck2.o \
177 class.o decl2.o error.o lex.o parse.o ptree.o rtti.o spew.o typeck.o cvt.o \
178 except.o friend.o init.o method.o search.o semantics.o tree.o xref.o \
179 repo.o dump.o optimize.o mangle.o @extra_cxx_objs@
181 # Language-independent object files.
182 OBJS = `cat ../stamp-objlist` ../c-common.o ../c-pragma.o ../c-semantics.o
183 OBJDEPS = ../stamp-objlist ../c-common.o ../c-pragma.o ../c-semantics.o
185 compiler: ../cc1plus$(exeext)
186 ../cc1plus$(exeext): $(P) $(OBJDEPS) $(CXX_OBJS) $(LIBDEPS)
187 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(CXX_OBJS) $(LIBS)
189 Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
190 cd ..; $(SHELL) config.status
192 native: config.status ../cc1plus$(exeext)
194 # Compiling object files from source files.
196 # Note that dependencies on obstack.h are not written
197 # because that file is not part of GCC.
199 # C++ language specific files.
201 RTL_H = $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
202 $(srcdir)/../machmode.h $(srcdir)/../machmode.def
203 TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../tree.def \
204 $(srcdir)/../machmode.h $(srcdir)/../machmode.def
205 CXX_TREE_H = $(TREE_H) cp-tree.h $(srcdir)/../c-common.h cp-tree.def \
206 $(srcdir)/../c-common.def $(srcdir)/../function.h $(srcdir)/../varray.h \
207 $(srcdir)/../../include/splay-tree.h \
208 $(srcdir)/../system.h $(CONFIG_H)
209 PARSE_H = $(srcdir)/parse.h
210 PARSE_C = $(srcdir)/parse.c
211 EXPR_H = $(srcdir)/../expr.h ../insn-codes.h
212 GGC_H = $(srcdir)/../ggc.h $(srcdir)/../varray.h
213 HTAB_H = $(srcdir)/../../include/hashtab.h
214 TIMEVAR_H = $(srcdir)/../timevar.h $(srcdir)/../timevar.def
216 parse.o : $(PARSE_C) $(CXX_TREE_H) $(srcdir)/../flags.h lex.h \
217 $(srcdir)/../except.h $(srcdir)/../output.h $(srcdir)/../system.h \
218 $(srcdir)/../toplev.h $(GGC_H)
219 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
220 `echo $(PARSE_C) | sed 's,^\./,,'`
222 CONFLICTS = expect 33 shift/reduce conflicts and 58 reduce/reduce conflicts.
223 $(PARSE_H) $(PARSE_C) : $(srcdir)/parse.y
224 @echo $(CONFLICTS)
225 cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o parse.c parse.y
226 cd $(srcdir); grep '^#define[ ]*YYEMPTY' parse.c >>parse.h
227 #$(PARSE_C) $(PARSE_H) : stamp-parse ; @true
228 #stamp-parse: $(srcdir)/parse.y
229 # @echo $(CONFLICTS)
230 # $(BISON) $(BISONFLAGS) -d $(srcdir)/parse.y
231 # grep '^#define[ ]*YYEMPTY' y.tab.c >>y.tab.h
232 # $(SHELL) $(srcdir)/../move-if-change y.tab.c $(PARSE_C)
233 # $(SHELL) $(srcdir)/../move-if-change y.tab.h $(PARSE_H)
234 # cp $(PARSE_C) y.tab.c
235 # touch stamp-parse
237 # We used to try to protect people from having to rerun gperf. But,
238 # the C front-end already requires this if c-parse.gperf is changed,
239 # so we should be consistent.
240 $(srcdir)/hash.h: $(srcdir)/gxx.gperf
241 gperf -L C -F ', 0, 0' -p -j1 -g -o -t -N is_reserved_word \
242 '-k1,4,7,$$' $(srcdir)/gxx.gperf >$(srcdir)/hash.h || ( \
243 echo "Please update your 'gperf' from the GCC infrastructure" >&2 ; \
244 echo " ftp://sourceware.cygnus.com/pub/egcs/infrastructure/gperf*" >&2 ; \
245 exit 1 )
247 $(srcdir)/cfns.h: $(srcdir)/cfns.gperf
248 gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' \
249 $(srcdir)/cfns.gperf > $(srcdir)/cfns.h
251 spew.o : spew.c $(CXX_TREE_H) $(PARSE_H) $(srcdir)/../flags.h \
252 lex.h $(srcdir)/../toplev.h
253 lex.o : lex.c $(CXX_TREE_H) \
254 $(PARSE_H) input.c $(srcdir)/../flags.h hash.h lex.h \
255 $(srcdir)/../c-pragma.h $(srcdir)/../toplev.h \
256 $(srcdir)/../output.h $(srcdir)/../mbchar.h $(GGC_H) \
257 $(srcdir)/../input.h $(srcdir)/../diagnostic.h operators.def
258 decl.o : decl.c $(CXX_TREE_H) $(srcdir)/../flags.h \
259 lex.h decl.h $(srcdir)/../stack.h $(srcdir)/../output.h $(srcdir)/../expr.h \
260 $(srcdir)/../except.h $(srcdir)/../toplev.h \
261 $(srcdir)/../hash.h $(GGC_H) $(RTL_H) operators.def
262 decl2.o : decl2.c $(CXX_TREE_H) $(srcdir)/../flags.h \
263 lex.h decl.h $(EXPR_H) $(srcdir)/../output.h $(srcdir)/../except.h \
264 $(srcdir)/../toplev.h $(srcdir)/../dwarf2out.h $(srcdir)/../dwarfout.h \
265 $(GGC_H) $(RTL_H)
266 typeck2.o : typeck2.c $(CXX_TREE_H) $(srcdir)/../flags.h \
267 $(srcdir)/../toplev.h $(srcdir)/../output.h
268 typeck.o : typeck.c $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
269 $(EXPR_H) $(srcdir)/../toplev.h
270 class.o : class.c $(CXX_TREE_H) $(srcdir)/../flags.h \
271 $(srcdir)/../toplev.h $(RTL_H)
272 call.o : call.c $(CXX_TREE_H) $(srcdir)/../flags.h \
273 $(srcdir)/../toplev.h $(RTL_H) $(EXPR_H) $(GGC_H)
274 friend.o : friend.c $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
275 $(srcdir)/../toplev.h
276 init.o : init.c $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
277 $(EXPR_H) $(srcdir)/../toplev.h $(GGC_H) \
278 $(srcdir)/../except.h
279 method.o : method.c $(CXX_TREE_H) \
280 $(srcdir)/../toplev.h $(GGC_H) $(RTL_H)
281 cvt.o : cvt.c $(CXX_TREE_H) decl.h \
282 $(srcdir)/../flags.h $(srcdir)/../toplev.h $(srcdir)/../convert.h
283 search.o : search.c $(CXX_TREE_H) $(srcdir)/../stack.h \
284 $(srcdir)/../flags.h $(srcdir)/../toplev.h $(RTL_H)
285 tree.o : tree.c $(CXX_TREE_H) $(srcdir)/../flags.h \
286 $(srcdir)/../toplev.h $(GGC_H) $(RTL_H) \
287 ../insn-config.h $(srcdir)/../integrate.h
288 ptree.o : ptree.c $(CXX_TREE_H) $(srcdir)/../system.h
289 rtti.o : rtti.c $(CXX_TREE_H) $(srcdir)/../flags.h \
290 $(srcdir)/../toplev.h
291 except.o : except.c $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
292 $(srcdir)/../except.h $(srcdir)/../toplev.h cfns.h
293 expr.o : expr.c $(CXX_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
294 $(EXPR_H) $(srcdir)/../toplev.h $(srcdir)/../except.h
295 xref.o : xref.c $(CXX_TREE_H) $(srcdir)/../input.h \
296 $(srcdir)/../toplev.h
297 pt.o : pt.c $(CXX_TREE_H) decl.h $(PARSE_H) lex.h \
298 $(srcdir)/../toplev.h $(GGC_H) $(RTL_H) \
299 $(srcdir)/../except.h $(HTAB_H)
300 error.o : error.c $(CXX_TREE_H) \
301 $(srcdir)/../toplev.h
302 errfn.o : errfn.c $(CXX_TREE_H) \
303 $(srcdir)/../toplev.h
304 repo.o : repo.c $(CXX_TREE_H) \
305 $(srcdir)/../toplev.h $(GGC_H)
306 semantics.o: semantics.c $(CXX_TREE_H) lex.h \
307 $(srcdir)/../except.h $(srcdir)/../toplev.h \
308 $(srcdir)/../flags.h $(GGC_H) \
309 $(srcdir)/../output.h $(RTL_H) $(TIMEVAR_H)
310 dump.o: dump.c $(CXX_TREE_H)
311 optimize.o: optimize.c $(CXX_TREE_H) \
312 $(srcdir)/../rtl.h $(srcdir)/../integrate.h ../insn-config.h \
313 $(srcdir)/../input.h
314 mangle.o: mangle.c $(CXX_TREE_H) $(srcdir)/../toplev.h
317 # These exist for maintenance purposes.
319 # Update the tags table.
320 TAGS: force
321 cd $(srcdir) ; \
322 etags *.c *.h ; \
323 echo 'l' | tr 'l' '\f' >> TAGS ; \
324 echo 'parse.y,0' >> TAGS ; \
325 etags -a ../*.h ../*.c;
327 .PHONY: TAGS
329 force: