Move *-*-gnu* pattern below *-*-linux*.
[official-gcc.git] / gcc / cp / Makefile.in
blob091898ecaebf56a846d732e6839f4633d154be91
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 @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 PARSE_H = $(srcdir)/parse.h
206 PARSE_C = $(srcdir)/parse.c
207 EXPR_H = $(srcdir)/../expr.h ../insn-codes.h
209 parse.o : $(PARSE_C) $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h lex.h \
210 $(srcdir)/../except.h $(srcdir)/../output.h $(srcdir)/../system.h \
211 $(srcdir)/../toplev.h
212 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
213 `echo $(PARSE_C) | sed 's,^\./,,'`
215 CONFLICTS = expect 30 shift/reduce conflicts and 42 reduce/reduce conflicts.
216 $(PARSE_H) : $(PARSE_C)
217 $(PARSE_C) : $(srcdir)/parse.y
218 @echo $(CONFLICTS)
219 cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o parse.c parse.y
220 cd $(srcdir); grep '^#define[ ]*YYEMPTY' parse.c >>parse.h
221 #$(PARSE_C) $(PARSE_H) : stamp-parse ; @true
222 #stamp-parse: $(srcdir)/parse.y
223 # @echo $(CONFLICTS)
224 # $(BISON) $(BISONFLAGS) -d $(srcdir)/parse.y
225 # grep '^#define[ ]*YYEMPTY' y.tab.c >>y.tab.h
226 # $(srcdir)/../move-if-change y.tab.c $(PARSE_C)
227 # $(srcdir)/../move-if-change y.tab.h $(PARSE_H)
228 # cp $(PARSE_C) y.tab.c
229 # touch stamp-parse
231 # We used to try to protect people from having to rerun gperf. But,
232 # the C front-end already requires this if c-parse.gperf is changed,
233 # so we should be consistent.
234 $(srcdir)/hash.h: $(srcdir)/gxx.gperf
235 gperf -L C -F ', 0, 0' -p -j1 -g -o -t -N is_reserved_word \
236 '-k1,4,7,$$' $(srcdir)/gxx.gperf >$(srcdir)/hash.h
238 spew.o : spew.c $(CONFIG_H) $(CXX_TREE_H) $(PARSE_H) $(srcdir)/../flags.h \
239 lex.h $(srcdir)/../system.h $(srcdir)/../toplev.h
240 lex.o : lex.c $(CONFIG_H) $(CXX_TREE_H) \
241 $(PARSE_H) input.c $(srcdir)/../flags.h hash.h lex.h \
242 $(srcdir)/../c-pragma.h $(srcdir)/../system.h $(srcdir)/../toplev.h \
243 $(srcdir)/../output.h $(srcdir)/../mbchar.h
244 decl.o : decl.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
245 lex.h decl.h $(srcdir)/../stack.h $(srcdir)/../output.h \
246 $(srcdir)/../except.h $(srcdir)/../system.h $(srcdir)/../toplev.h \
247 $(srcdir)/../hash.h $(srcdir)/../function.h
248 decl2.o : decl2.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
249 lex.h decl.h $(EXPR_H) $(srcdir)/../except.h $(srcdir)/../function.h \
250 $(srcdir)/../output.h $(srcdir)/../except.h $(srcdir)/../system.h \
251 $(srcdir)/../toplev.h $(srcdir)/../dwarf2out.h $(srcdir)/../dwarfout.h \
252 $(srcdir)/../../include/splay-tree.h $(srcdir)/../varray.h
253 typeck2.o : typeck2.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
254 $(srcdir)/../system.h $(srcdir)/../toplev.h
255 typeck.o : typeck.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
256 $(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h \
257 $(srcdir)/../function.h
258 class.o : class.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
259 $(srcdir)/../system.h $(srcdir)/../toplev.h \
260 $(srcdir)/../../include/splay-tree.h
261 call.o : call.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
262 $(srcdir)/../system.h $(srcdir)/../toplev.h
263 friend.o : friend.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
264 $(srcdir)/../system.h $(srcdir)/../toplev.h
265 init.o : init.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
266 $(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h \
267 $(srcdir)/../function.h
268 method.o : method.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \
269 $(srcdir)/../toplev.h $(srcdir)/../function.h
270 cvt.o : cvt.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h decl.h \
271 $(srcdir)/../flags.h $(srcdir)/../toplev.h $(srcdir)/../convert.h
272 search.o : search.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../stack.h \
273 $(srcdir)/../flags.h $(srcdir)/../system.h $(srcdir)/../toplev.h \
274 $(srcdir)/../varray.h
275 tree.o : tree.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
276 $(srcdir)/../system.h $(srcdir)/../toplev.h
277 ptree.o : ptree.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h
278 rtti.o : rtti.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
279 $(srcdir)/../system.h $(srcdir)/../toplev.h
280 except.o : except.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
281 $(srcdir)/../except.h $(srcdir)/../system.h $(srcdir)/../toplev.h
282 expr.o : expr.c $(CONFIG_H) $(CXX_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
283 $(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h
284 xref.o : xref.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../input.h \
285 $(srcdir)/../system.h $(srcdir)/../toplev.h
286 pt.o : pt.c $(CONFIG_H) $(CXX_TREE_H) decl.h $(PARSE_H) lex.h \
287 $(srcdir)/../system.h $(srcdir)/../toplev.h
288 error.o : error.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \
289 $(srcdir)/../toplev.h
290 errfn.o : errfn.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \
291 $(srcdir)/../toplev.h
292 repo.o : repo.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \
293 $(srcdir)/../toplev.h
294 semantics.o: semantics.c $(CONFIG_H) $(CXX_TREE_H) lex.h \
295 $(srcdir)/../except.h $(srcdir)/../system.h $(srcdir)/../toplev.h
296 dump.o: dump.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h
299 # These exist for maintenance purposes.
301 # Update the tags table.
302 TAGS: force
303 cd $(srcdir) ; \
304 etags *.c *.h ; \
305 echo 'l' | tr 'l' '\f' >> TAGS ; \
306 echo 'parse.y,0' >> TAGS ; \
307 etags -a ../*.h ../*.c;
309 .PHONY: TAGS
311 force: