OSDN Git Service

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