cp-tree.def (PTRMEM_CST): New tree node.
[gcc.git] / gcc / cp / Makefile.in
1 # Makefile for GNU C++ compiler.
2 # Copyright (C) 1987, 88, 90-5, 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 # The makefile built from this file lives in the language subdirectory.
22 # Its purpose is to provide support for:
23 #
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.
27 #
28 # The parent makefile handles all other chores, with help from the
29 # language makefile fragment, of course.
30 #
31 # The targets for external use are:
32 # all, TAGS, ???mostlyclean, ???clean.
33
34 # Suppress smart makes who think they know how to automake Yacc files
35 .y.c:
36
37 # It defines the c++ interface name. It should be changed when the
38 # c++ interface is changed.
39 INTERFACE = 1
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 LEX = `if [ -f ../../flex/flex ] ; then echo ../../flex/flex ; else echo flex ; fi`
65 LEXFLAGS =
66 AR = ar
67 AR_FLAGS = rc
68 SHELL = /bin/sh
69 MAKEINFO = makeinfo
70 TEXI2DVI = texi2dvi
71
72 # Define this as & to perform parallel make on a Sequent.
73 # Note that this has some bugs, and it seems currently necessary
74 # to compile all the gen* files first by hand to avoid erroneous results.
75 P =
76
77 # This is used in the definition of SUBDIR_USE_ALLOCA.
78 # ??? Perhaps it would be better if it just looked for *gcc*.
79 OLDCC = cc
80
81 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
82 # It omits XCFLAGS, and specifies -B./.
83 # It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
84 GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
85
86 # Tools to use when building a cross-compiler.
87 # These are used because `configure' appends `cross-make'
88 # to the makefile when making a cross-compiler.
89
90 # We don't use cross-make. Instead we use the tools
91 # from the build tree, if they are available.
92 # program_transform_name and objdir are set by configure.in.
93 program_transform_name =
94 objdir = .
95
96 target=@target@
97 xmake_file=@dep_host_xmake_file@
98 tmake_file=@dep_tmake_file@
99 #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
100 #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
101
102 # Directory where sources are, from where we are.
103 srcdir = @srcdir@
104 VPATH = @srcdir@
105
106 # Additional system libraries to link with.
107 CLIB=
108
109 # Change this to a null string if obstacks are installed in the
110 # system library.
111 OBSTACK=obstack.o
112
113 # Choose the real default target.
114 ALL=all
115
116 # End of variables for you to override.
117
118 # Definition of `all' is here so that new rules inserted by sed
119 # do not specify the default target.
120 all: all.indirect
121
122 # This tells GNU Make version 3 not to put all variables in the environment.
123 .NOEXPORT:
124
125 # sed inserts variable overrides after the following line.
126 ####target overrides
127 @target_overrides@
128 ####host overrides
129 @host_overrides@
130 ####cross overrides
131 @cross_defines@
132 @cross_overrides@
133 ####build overrides
134 @build_overrides@
135 #\f
136 # Now figure out from those variables how to compile and link.
137
138 all.indirect: Makefile ../cc1plus$(exeext)
139
140 # IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
141 INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@
142
143 # This is the variable actually used when we compile.
144 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
145
146 # Likewise.
147 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
148
149 # Even if ALLOCA is set, don't use it if compiling with GCC.
150
151 SUBDIR_OBSTACK = `if [ x$(OBSTACK) != x ]; then echo ../$(OBSTACK); else true; fi`
152 SUBDIR_USE_ALLOCA = `case "${CC}" in "${OLDCC}") if [ x$(ALLOCA) != x ]; then echo ../$(ALLOCA); else true; fi ;; esac`
153 SUBDIR_MALLOC = `if [ x$(MALLOC) != x ]; then echo ../$(MALLOC); else true; fi`
154
155 # How to link with both our special library facilities
156 # and the system's installed libraries.
157 LIBS = $(SUBDIR_OBSTACK) $(SUBDIR_USE_ALLOCA) $(SUBDIR_MALLOC) $(CLIB)
158
159 # Specify the directories to be searched for header files.
160 # Both . and srcdir are used, in that order,
161 # so that tm.h and config.h will be found in the compilation
162 # subdirectory rather than in the source directory.
163 INCLUDES = -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config -I$(srcdir)/../../include
164
165 # Always use -I$(srcdir)/config when compiling.
166 .c.o:
167 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
168
169 # The only suffixes we want for implicit rules are .c and .o.
170 .SUFFIXES:
171 .SUFFIXES: .c .o
172
173 # This tells GNU make version 3 not to export all the variables
174 # defined in this file into the environment.
175 .NOEXPORT:
176 #\f
177 # Lists of files for various purposes.
178
179 # Language-specific object files for g++
180
181 CXX_OBJS = call.o decl.o errfn.o expr.o pt.o sig.o typeck2.o \
182 class.o decl2.o error.o lex.o parse.o ptree.o rtti.o spew.o typeck.o cvt.o \
183 except.o friend.o init.o method.o search.o semantics.o tree.o xref.o \
184 repo.o @extra_cxx_objs@
185
186 # Language-independent object files.
187 OBJS = `cat ../stamp-objlist` ../c-common.o ../c-pragma.o
188 OBJDEPS = ../stamp-objlist ../c-common.o ../c-pragma.o
189
190 compiler: ../cc1plus$(exeext)
191 ../cc1plus$(exeext): $(P) $(CXX_OBJS) $(OBJDEPS) $(LIBDEPS)
192 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
193 $(CXX_OBJS) $(OBJS) $(LIBS)
194
195 Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
196 cd ..; $(SHELL) config.status
197
198 native: config.status ../cc1plus$(exeext)
199 #\f
200 # Compiling object files from source files.
201
202 # Note that dependencies on obstack.h are not written
203 # because that file is not part of GCC.
204
205 # C++ language specific files.
206
207 RTL_H = $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
208 $(srcdir)/../machmode.h $(srcdir)/../machmode.def
209 TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../tree.def \
210 $(srcdir)/../machmode.h $(srcdir)/../machmode.def
211 CXX_TREE_H = $(TREE_H) cp-tree.h cp-tree.def
212 PARSE_H = $(srcdir)/parse.h
213 PARSE_C = $(srcdir)/parse.c
214 EXPR_H = $(srcdir)/../expr.h ../insn-codes.h
215
216 parse.o : $(PARSE_C) $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h lex.h \
217 $(srcdir)/../except.h $(srcdir)/../output.h $(srcdir)/../system.h \
218 $(srcdir)/../toplev.h
219 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
220 `echo $(PARSE_C) | sed 's,^\./,,'`
221
222 CONFLICTS = expect 25 shift/reduce conflicts and 42 reduce/reduce conflicts.
223 $(PARSE_H) : $(PARSE_C)
224 $(PARSE_C) : $(srcdir)/parse.y
225 @echo $(CONFLICTS)
226 cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o parse.c parse.y
227 cd $(srcdir); grep '^#define[ ]*YYEMPTY' parse.c >>parse.h
228 #$(PARSE_C) $(PARSE_H) : stamp-parse ; @true
229 #stamp-parse: $(srcdir)/parse.y
230 # @echo $(CONFLICTS)
231 # $(BISON) $(BISONFLAGS) -d $(srcdir)/parse.y
232 # grep '^#define[ ]*YYEMPTY' y.tab.c >>y.tab.h
233 # $(srcdir)/../move-if-change y.tab.c $(PARSE_C)
234 # $(srcdir)/../move-if-change y.tab.h $(PARSE_H)
235 # cp $(PARSE_C) y.tab.c
236 # touch stamp-parse
237
238 # hash.h really depends on $(srcdir)/gxx.gperf.
239 # But this would screw things for people that don't have gperf,
240 # if gxx.gpref got touched, say.
241 # Thus you have to remove hash.h to force it to be re-made.
242 $(srcdir)/hash.h:
243 gperf -p -j1 -g -o -t -N is_reserved_word '-k1,4,7,$$' \
244 $(srcdir)/gxx.gperf >$(srcdir)/hash.h
245
246 spew.o : spew.c $(CONFIG_H) $(CXX_TREE_H) $(PARSE_H) $(srcdir)/../flags.h \
247 lex.h $(srcdir)/../system.h $(srcdir)/../toplev.h
248 lex.o : lex.c $(CONFIG_H) $(CXX_TREE_H) \
249 $(PARSE_H) input.c $(srcdir)/../flags.h hash.h lex.h \
250 $(srcdir)/../c-pragma.h $(srcdir)/../system.h $(srcdir)/../toplev.h \
251 $(srcdir)/../output.h $(srcdir)/../mbchar.h
252 decl.o : decl.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
253 lex.h decl.h $(srcdir)/../stack.h $(srcdir)/../output.h \
254 $(srcdir)/../except.h $(srcdir)/../system.h $(srcdir)/../toplev.h
255 decl2.o : decl2.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
256 lex.h decl.h $(EXPR_H) $(srcdir)/../except.h \
257 $(srcdir)/../output.h $(srcdir)/../except.h $(srcdir)/../system.h \
258 $(srcdir)/../toplev.h $(srcdir)/../dwarf2out.h $(srcdir)/../dwarfout.h
259 typeck2.o : typeck2.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
260 $(srcdir)/../system.h $(srcdir)/../toplev.h
261 typeck.o : typeck.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
262 $(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h
263 class.o : class.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
264 $(srcdir)/../system.h $(srcdir)/../toplev.h
265 call.o : call.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
266 $(srcdir)/../system.h $(srcdir)/../toplev.h
267 friend.o : friend.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
268 $(srcdir)/../system.h $(srcdir)/../toplev.h
269 init.o : init.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
270 $(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h
271 method.o : method.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \
272 $(srcdir)/../toplev.h
273 cvt.o : cvt.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h
274 search.o : search.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../stack.h \
275 $(srcdir)/../flags.h $(srcdir)/../system.h $(srcdir)/../toplev.h
276 tree.o : tree.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
277 $(srcdir)/../system.h $(srcdir)/../toplev.h
278 ptree.o : ptree.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h
279 rtti.o : rtti.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
280 $(srcdir)/../system.h $(srcdir)/../toplev.h
281 except.o : except.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
282 $(srcdir)/../except.h $(srcdir)/../system.h $(srcdir)/../toplev.h
283 expr.o : expr.c $(CONFIG_H) $(CXX_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
284 $(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h
285 xref.o : xref.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../input.h \
286 $(srcdir)/../system.h $(srcdir)/../toplev.h
287 pt.o : pt.c $(CONFIG_H) $(CXX_TREE_H) decl.h $(PARSE_H) lex.h \
288 $(srcdir)/../system.h $(srcdir)/../toplev.h
289 error.o : error.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \
290 $(srcdir)/../toplev.h
291 errfn.o : errfn.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \
292 $(srcdir)/../toplev.h
293 sig.o : sig.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h \
294 $(srcdir)/../system.h $(srcdir)/../toplev.h
295 repo.o : repo.c $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../system.h \
296 $(srcdir)/../toplev.h
297 semantics.o: semantics.c $(CONFIG_H) $(CXX_TREE_H) lex.h \
298 $(srcdir)/../except.h $(srcdir)/../system.h $(srcdir)/../toplev.h
299
300
301 #\f
302 # These exist for maintenance purposes.
303
304 # Update the tags table.
305 TAGS: force
306 cd $(srcdir) ; \
307 etags *.c *.h ; \
308 echo 'l' | tr 'l' '\f' >> TAGS ; \
309 echo 'parse.y,0' >> TAGS ; \
310 etags -a ../*.h ../*.c;
311
312 .PHONY: TAGS
313
314 force:
315
316 g++FAQ.info: $(srcdir)/g++FAQ.texi
317 $(MAKEINFO) --no-split -o ./g++FAQ.info $(srcdir)/g++FAQ.texi
318
319 # Preprocess the texi file so that the final document will have
320 # hyperlinks.
321 # It would be nice if texi2html could do something like this itself.
322
323 # Assumption 1: the FAQ puts all http: and ftp: links in a @file{...}.
324 # Assumption 2: newsgroups are like @file{comp.foo}
325 # Assumption 3: email addresses match the regexp shown.
326
327 g++FAQ.html: $(srcdir)/g++FAQ.texi
328 mkdir work
329 sed -e 's?@file{\([fth]*p://[^}]*\)}?@strong{<A HREF="\1">\1</A>}?' \
330 -e 's?@file{\(comp\.[-a-z+.]*\)}?<A HREF="news:\1">\1</A>?' \
331 -e 's?@file{\(gnu\.[-a-z+.]*\)}?<A HREF="news:\1">\1</A>?' \
332 -e 's?\([.+a-zA-Z0-9-]*@@[.a-zA-Z0-9-]*[a-zA-Z0-9]\)?<A HREF="mailto:\1">\1</A>?' \
333 $(srcdir)/g++FAQ.texi > work/g++FAQ.texi
334 cd work; texi2html g++FAQ.texi
335 mv work/*.html .
336 rm -r work
337
338 # Make plain-text form.
339
340 g++FAQ.txt: $(srcdir)/g++FAQ.texi
341 $(MAKEINFO) --no-split --no-headers -o - $(srcdir)/g++FAQ.texi |\
342 sed '/^Concept Index/,$$d' > g++FAQ.txt
343