* cp-tree.def (SCOPE_STMT): Take one operand.
[official-gcc.git] / gcc / cp / Makefile.in
blobd0a13975663b07d8f6de04480e1dd0cb0c8c5cf9
1 # Makefile for GNU C++ compiler.
2 # Copyright (C) 1987, 88, 90-5, 1998, 1999 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 # The makefile built from this file lives in the language subdirectory.
22 # Its purpose is to provide support for:
24 # 1) recursion where necessary, and only then (building .o's), and
25 # 2) building and debugging cc1 from the language subdirectory, and
26 # 3) nothing else.
28 # The parent makefile handles all other chores, with help from the
29 # language makefile fragment, of course.
31 # The targets for external use are:
32 # all, TAGS, ???mostlyclean, ???clean.
34 # Suppress smart makes who think they know how to automake Yacc files
35 .y.c:
37 # It defines the c++ interface name. It should be changed when the
38 # c++ interface is changed.
39 INTERFACE = 2
41 # Variables that exist for you to override.
42 # See below for how to change them for certain systems.
44 # Various ways of specifying flags for compilations:
45 # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
46 # BOOT_CFLAGS is the value of CFLAGS to pass
47 # to the stage2 and stage3 compilations
48 # XCFLAGS is used for most compilations but not when using the GCC just built.
49 XCFLAGS =
50 CFLAGS = -g
51 BOOT_CFLAGS = -O $(CFLAGS)
52 # These exists to be overridden by the x-* and t-* files, respectively.
53 X_CFLAGS =
54 T_CFLAGS =
56 X_CPPFLAGS =
57 T_CPPFLAGS =
59 CC = @CC@
60 BISON = `if [ -f ../../bison/bison ] ; then echo ../../bison/bison -L $(srcdir)/../../bison/ ; else echo bison ; fi`
61 BISONFLAGS =
62 LEX = `if [ -f ../../flex/flex ] ; then echo ../../flex/flex ; else echo flex ; fi`
63 LEXFLAGS =
64 AR = ar
65 AR_FLAGS = rc
66 SHELL = /bin/sh
67 MAKEINFO = makeinfo
68 TEXI2DVI = texi2dvi
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.
73 P =
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 =
88 objdir = .
90 target=@target@
91 xmake_file=@dep_host_xmake_file@
92 tmake_file=@dep_tmake_file@
93 #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
94 #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
96 # Directory where sources are, from where we are.
97 srcdir = @srcdir@
98 VPATH = @srcdir@
100 # Additional system libraries to link with.
101 CLIB=
103 # Top build directory, relative to here.
104 top_builddir = ..
106 # Internationalization library.
107 INTLLIBS = @INTLLIBS@
109 # Choose the real default target.
110 ALL=all
112 # End of variables for you to override.
114 # Definition of `all' is here so that new rules inserted by sed
115 # do not specify the default target.
116 all: all.indirect
118 # This tells GNU Make version 3 not to put all variables in the environment.
119 .NOEXPORT:
121 # sed inserts variable overrides after the following line.
122 ####target overrides
123 @target_overrides@
124 ####host overrides
125 @host_overrides@
126 ####cross overrides
127 @cross_defines@
128 @cross_overrides@
129 ####build overrides
130 @build_overrides@
132 # Now figure out from those variables how to compile and link.
134 all.indirect: Makefile ../cc1plus$(exeext)
136 # IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
137 INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@
139 # This is the variable actually used when we compile.
140 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS) -W -Wall
142 # Likewise.
143 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
145 # This is where we get libiberty.a from.
146 LIBIBERTY = ../../libiberty/libiberty.a
148 # How to link with both our special library facilities
149 # and the system's installed libraries.
150 LIBS = $(INTLLIBS) $(LIBIBERTY) $(CLIB)
151 LIBDEPS = $(INTLLIBS) $(LIBIBERTY)
153 # Specify the directories to be searched for header files.
154 # Both . and srcdir are used, in that order,
155 # so that tm.h and config.h will be found in the compilation
156 # subdirectory rather than in the source directory.
157 INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config -I$(srcdir)/../../include
159 # Always use -I$(srcdir)/config when compiling.
160 .c.o:
161 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
163 # The only suffixes we want for implicit rules are .c and .o.
164 .SUFFIXES:
165 .SUFFIXES: .c .o
167 # This tells GNU make version 3 not to export all the variables
168 # defined in this file into the environment.
169 .NOEXPORT:
171 # Lists of files for various purposes.
173 # Language-specific object files for g++
175 CXX_OBJS = call.o decl.o errfn.o expr.o pt.o typeck2.o \
176 class.o decl2.o error.o lex.o parse.o ptree.o rtti.o spew.o typeck.o cvt.o \
177 except.o friend.o init.o method.o search.o semantics.o tree.o xref.o \
178 repo.o dump.o optimize.o @extra_cxx_objs@
180 # Language-independent object files.
181 OBJS = `cat ../stamp-objlist` ../c-common.o ../c-pragma.o
182 OBJDEPS = ../stamp-objlist ../c-common.o ../c-pragma.o
184 compiler: ../cc1plus$(exeext)
185 ../cc1plus$(exeext): $(P) $(OBJDEPS) $(CXX_OBJS) $(LIBDEPS)
186 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(CXX_OBJS) $(LIBS)
188 Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
189 cd ..; $(SHELL) config.status
191 native: config.status ../cc1plus$(exeext)
193 # Compiling object files from source files.
195 # Note that dependencies on obstack.h are not written
196 # because that file is not part of GCC.
198 # C++ language specific files.
200 RTL_H = $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
201 $(srcdir)/../machmode.h $(srcdir)/../machmode.def
202 TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../tree.def \
203 $(srcdir)/../machmode.h $(srcdir)/../machmode.def
204 CXX_TREE_H = $(TREE_H) cp-tree.h $(srcdir)/../c-common.h cp-tree.def \
205 $(srcdir)/../function.h $(srcdir)/../varray.h \
206 $(srcdir)/../../include/splay-tree.h \
207 $(srcdir)/../system.h $(CONFIG_H)
208 PARSE_H = $(srcdir)/parse.h
209 PARSE_C = $(srcdir)/parse.c
210 EXPR_H = $(srcdir)/../expr.h ../insn-codes.h
212 parse.o : $(PARSE_C) $(CXX_TREE_H) $(srcdir)/../flags.h lex.h \
213 $(srcdir)/../except.h $(srcdir)/../output.h $(srcdir)/../system.h \
214 $(srcdir)/../toplev.h $(srcdir)/../ggc.h
215 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
216 `echo $(PARSE_C) | sed 's,^\./,,'`
218 CONFLICTS = expect 31 shift/reduce conflicts and 42 reduce/reduce conflicts.
219 $(PARSE_H) : $(PARSE_C)
220 $(PARSE_C) : $(srcdir)/parse.y
221 @echo $(CONFLICTS)
222 cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o parse.c parse.y
223 cd $(srcdir); grep '^#define[ ]*YYEMPTY' parse.c >>parse.h
224 #$(PARSE_C) $(PARSE_H) : stamp-parse ; @true
225 #stamp-parse: $(srcdir)/parse.y
226 # @echo $(CONFLICTS)
227 # $(BISON) $(BISONFLAGS) -d $(srcdir)/parse.y
228 # grep '^#define[ ]*YYEMPTY' y.tab.c >>y.tab.h
229 # $(SHELL) $(srcdir)/../move-if-change y.tab.c $(PARSE_C)
230 # $(SHELL) $(srcdir)/../move-if-change y.tab.h $(PARSE_H)
231 # cp $(PARSE_C) y.tab.c
232 # touch stamp-parse
234 # We used to try to protect people from having to rerun gperf. But,
235 # the C front-end already requires this if c-parse.gperf is changed,
236 # so we should be consistent.
237 $(srcdir)/hash.h: $(srcdir)/gxx.gperf
238 gperf -L C -F ', 0, 0' -p -j1 -g -o -t -N is_reserved_word \
239 '-k1,4,7,$$' $(srcdir)/gxx.gperf >$(srcdir)/hash.h || ( \
240 echo "Please update your 'gperf' from the GCC infrastructure" >&2 ; \
241 echo " ftp://sourceware.cygnus.com/pub/egcs/infrastructure/gperf*" >&2 ; \
242 exit 1 )
244 spew.o : spew.c $(CXX_TREE_H) $(PARSE_H) $(srcdir)/../flags.h \
245 lex.h $(srcdir)/../toplev.h
246 lex.o : lex.c $(CXX_TREE_H) \
247 $(PARSE_H) input.c $(srcdir)/../flags.h hash.h lex.h \
248 $(srcdir)/../c-pragma.h $(srcdir)/../toplev.h \
249 $(srcdir)/../output.h $(srcdir)/../mbchar.h $(srcdir)/../ggc.h
250 decl.o : decl.c $(CXX_TREE_H) $(srcdir)/../flags.h \
251 lex.h decl.h $(srcdir)/../stack.h $(srcdir)/../output.h \
252 $(srcdir)/../except.h $(srcdir)/../toplev.h \
253 $(srcdir)/../hash.h $(srcdir)/../ggc.h $(RTL_H)
254 decl2.o : decl2.c $(CXX_TREE_H) $(srcdir)/../flags.h \
255 lex.h decl.h $(EXPR_H) $(srcdir)/../output.h $(srcdir)/../except.h \
256 $(srcdir)/../toplev.h $(srcdir)/../dwarf2out.h $(srcdir)/../dwarfout.h \
257 $(srcdir)/../ggc.h $(RTL_H)
258 typeck2.o : typeck2.c $(CXX_TREE_H) $(srcdir)/../flags.h \
259 $(srcdir)/../toplev.h $(srcdir)/../output.h
260 typeck.o : typeck.c $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
261 $(EXPR_H) $(srcdir)/../toplev.h
262 class.o : class.c $(CXX_TREE_H) $(srcdir)/../flags.h \
263 $(srcdir)/../toplev.h $(RTL_H)
264 call.o : call.c $(CXX_TREE_H) $(srcdir)/../flags.h \
265 $(srcdir)/../toplev.h $(RTL_H)
266 friend.o : friend.c $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
267 $(srcdir)/../toplev.h
268 init.o : init.c $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
269 $(EXPR_H) $(srcdir)/../toplev.h $(srcdir)/../ggc.h \
270 $(srcdir)/../except.h
271 method.o : method.c $(CXX_TREE_H) \
272 $(srcdir)/../toplev.h $(srcdir)/../ggc.h $(RTL_H)
273 cvt.o : cvt.c $(CXX_TREE_H) decl.h \
274 $(srcdir)/../flags.h $(srcdir)/../toplev.h $(srcdir)/../convert.h
275 search.o : search.c $(CXX_TREE_H) $(srcdir)/../stack.h \
276 $(srcdir)/../flags.h $(srcdir)/../toplev.h $(RTL_H)
277 tree.o : tree.c $(CXX_TREE_H) $(srcdir)/../flags.h \
278 $(srcdir)/../toplev.h $(srcdir)/../ggc.h $(RTL_H) \
279 ../insn-config.h $(srcdir)/../integrate.h
280 ptree.o : ptree.c $(CXX_TREE_H) $(srcdir)/../system.h
281 rtti.o : rtti.c $(CXX_TREE_H) $(srcdir)/../flags.h \
282 $(srcdir)/../toplev.h
283 except.o : except.c $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
284 $(srcdir)/../except.h $(srcdir)/../toplev.h
285 expr.o : expr.c $(CXX_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
286 $(EXPR_H) $(srcdir)/../toplev.h $(srcdir)/../except.h
287 xref.o : xref.c $(CXX_TREE_H) $(srcdir)/../input.h \
288 $(srcdir)/../toplev.h
289 pt.o : pt.c $(CXX_TREE_H) decl.h $(PARSE_H) lex.h \
290 $(srcdir)/../toplev.h $(srcdir)/../ggc.h $(RTL_H) \
291 $(srcdir)/../except.h
292 error.o : error.c $(CXX_TREE_H) \
293 $(srcdir)/../toplev.h
294 errfn.o : errfn.c $(CXX_TREE_H) \
295 $(srcdir)/../toplev.h
296 repo.o : repo.c $(CXX_TREE_H) \
297 $(srcdir)/../toplev.h $(srcdir)/../ggc.h
298 semantics.o: semantics.c $(CXX_TREE_H) lex.h \
299 $(srcdir)/../except.h $(srcdir)/../toplev.h \
300 $(srcdir)/../flags.h $(srcdir)/../ggc.h $(RTL_H)
301 dump.o: dump.c $(CXX_TREE_H)
302 optimize.o: optimize.c $(CXX_TREE_H) \
303 $(srcdir)/../rtl.h $(srcdir)/../integrate.h ../insn-config.h
306 # These exist for maintenance purposes.
308 # Update the tags table.
309 TAGS: force
310 cd $(srcdir) ; \
311 etags *.c *.h ; \
312 echo 'l' | tr 'l' '\f' >> TAGS ; \
313 echo 'parse.y,0' >> TAGS ; \
314 etags -a ../*.h ../*.c;
316 .PHONY: TAGS
318 force: