OSDN Git Service

* defaults.h: Provide default definitions for: CHAR_TYPE_SIZE,
[pf3gnuchains/gcc-fork.git] / gcc / cp / Makefile.in
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.
4
5 #This file is part of GNU CC.
6
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.
11
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.
16
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.
21
22 # The makefile built from this file lives in the language subdirectory.
23 # Its purpose is to provide support for:
24 #
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.
28 #
29 # The parent makefile handles all other chores, with help from the
30 # language makefile fragment, of course.
31 #
32 # The targets for external use are:
33 # all, TAGS, ???mostlyclean, ???clean.
34
35 # Suppress smart makes who think they know how to automake Yacc files
36 .y.c:
37
38 # It defines the c++ interface name. It should be changed when the
39 # c++ interface is changed.
40 INTERFACE = 2
41
42 # Variables that exist for you to override.
43 # See below for how to change them for certain systems.
44
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 =
56
57 X_CPPFLAGS =
58 T_CPPFLAGS =
59
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
70
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 =
75
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)
80
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.
84
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 = .
90
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`
96
97 # Directory where sources are, from where we are.
98 srcdir = @srcdir@
99 VPATH = @srcdir@
100
101 # Additional system libraries to link with.
102 CLIB=
103  
104 # Top build directory, relative to here.
105 top_builddir = ..
106
107 # Internationalization library.
108 INTLLIBS = @INTLLIBS@
109
110 # Choose the real default target.
111 ALL=all
112
113 # End of variables for you to override.
114
115 # Definition of `all' is here so that new rules inserted by sed
116 # do not specify the default target.
117 all: all.indirect
118
119 # This tells GNU Make version 3 not to put all variables in the environment.
120 .NOEXPORT:
121
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@
132 #\f
133 # Now figure out from those variables how to compile and link.
134
135 all.indirect: Makefile ../cc1plus$(exeext)
136
137 # IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
138 INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@
139
140 # This is the variable actually used when we compile.
141 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS) -W -Wall
142
143 # Likewise.
144 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
145
146 # This is where we get libiberty.a from.
147 LIBIBERTY = ../../libiberty/libiberty.a
148
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)
153
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
159
160 # Always use -I$(srcdir)/config when compiling.
161 .c.o:
162         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
163
164 # The only suffixes we want for implicit rules are .c and .o.
165 .SUFFIXES:
166 .SUFFIXES: .c .o
167
168 # This tells GNU make version 3 not to export all the variables
169 # defined in this file into the environment.
170 .NOEXPORT:
171 #\f
172 # Lists of files for various purposes.
173
174 # Shared with C front end:
175 C_OBJS = ../c-common.o ../c-pragma.o ../c-semantics.o ../c-lex.o
176
177 # Language-specific object files for g++
178
179 CXX_OBJS = call.o decl.o errfn.o expr.o pt.o typeck2.o \
180  class.o decl2.o error.o lex.o parse.o ptree.o rtti.o spew.o typeck.o cvt.o \
181  except.o friend.o init.o method.o search.o semantics.o tree.o xref.o \
182  repo.o dump.o optimize.o mangle.o @extra_cxx_objs@
183
184 # Language-independent object files.
185 BACKEND = ../toplev.o ../libbackend.a
186
187 compiler: ../cc1plus$(exeext)
188 ../cc1plus$(exeext): $(P) $(CXX_OBJS) $(C_OBJS) $(BACKEND) $(LIBDEPS)
189         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
190               $(CXX_OBJS) $(C_OBJS) $(BACKEND) $(LIBS)
191
192 Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure
193         cd ..; $(SHELL) config.status
194
195 native: config.status ../cc1plus$(exeext)
196 #\f
197 # Compiling object files from source files.
198
199 # Note that dependencies on obstack.h are not written
200 # because that file is not part of GCC.
201
202 # C++ language specific files.
203
204 RTL_H = $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
205         $(srcdir)/../machmode.h $(srcdir)/../machmode.def
206 TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../tree.def \
207         $(srcdir)/../machmode.h $(srcdir)/../machmode.def
208 CXX_TREE_H = $(TREE_H) cp-tree.h $(srcdir)/../c-common.h cp-tree.def \
209         $(srcdir)/../c-common.def $(srcdir)/../function.h $(srcdir)/../varray.h \
210         $(srcdir)/../../include/splay-tree.h \
211         $(srcdir)/../system.h $(CONFIG_H) $(HTAB_H)
212 PARSE_H = $(srcdir)/parse.h
213 PARSE_C = $(srcdir)/parse.c
214 EXPR_H = $(srcdir)/../expr.h ../insn-codes.h
215 GGC_H = $(srcdir)/../ggc.h $(srcdir)/../varray.h
216 HTAB_H = $(srcdir)/../../include/hashtab.h
217 TIMEVAR_H = $(srcdir)/../timevar.h $(srcdir)/../timevar.def
218
219 parse.o : $(PARSE_C) $(CXX_TREE_H) $(srcdir)/../flags.h lex.h \
220         $(srcdir)/../except.h $(srcdir)/../output.h $(srcdir)/../system.h \
221         $(srcdir)/../toplev.h $(GGC_H)
222         $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
223   `echo $(PARSE_C) | sed 's,^\./,,'`
224
225 CONFLICTS = expect 33 shift/reduce conflicts and 58 reduce/reduce conflicts.
226 $(PARSE_H) $(PARSE_C) : $(srcdir)/parse.y
227         @echo $(CONFLICTS)
228         cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o parse.c parse.y
229         cd $(srcdir); grep '^#define[   ]*YYEMPTY' parse.c >>parse.h
230 #$(PARSE_C) $(PARSE_H) : stamp-parse ; @true
231 #stamp-parse: $(srcdir)/parse.y
232 #       @echo $(CONFLICTS)
233 #       $(BISON) $(BISONFLAGS) -d $(srcdir)/parse.y
234 #       grep '^#define[         ]*YYEMPTY' y.tab.c >>y.tab.h
235 #       $(SHELL) $(srcdir)/../move-if-change y.tab.c $(PARSE_C)
236 #       $(SHELL) $(srcdir)/../move-if-change y.tab.h $(PARSE_H)
237 #       cp $(PARSE_C) y.tab.c
238 #       touch stamp-parse
239
240 $(srcdir)/cfns.h: $(srcdir)/cfns.gperf
241         gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' \
242                 $(srcdir)/cfns.gperf > $(srcdir)/cfns.h
243
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) $(srcdir)/../flags.h lex.h \
248   $(srcdir)/../c-pragma.h $(srcdir)/../toplev.h \
249   $(srcdir)/../output.h $(srcdir)/../mbchar.h $(GGC_H) \
250   $(srcdir)/../input.h $(srcdir)/../diagnostic.h operators.def
251 decl.o : decl.c $(CXX_TREE_H) $(srcdir)/../flags.h \
252   lex.h decl.h $(srcdir)/../stack.h $(srcdir)/../output.h $(srcdir)/../expr.h \
253   $(srcdir)/../except.h $(srcdir)/../toplev.h \
254   $(srcdir)/../hash.h $(GGC_H) $(RTL_H) operators.def
255 decl2.o : decl2.c $(CXX_TREE_H) $(srcdir)/../flags.h \
256   lex.h decl.h $(EXPR_H) $(srcdir)/../output.h $(srcdir)/../except.h \
257   $(srcdir)/../toplev.h $(srcdir)/../dwarf2out.h $(srcdir)/../dwarfout.h \
258   $(GGC_H) $(RTL_H)
259 typeck2.o : typeck2.c $(CXX_TREE_H) $(srcdir)/../flags.h \
260   $(srcdir)/../toplev.h $(srcdir)/../output.h
261 typeck.o : typeck.c $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
262   $(EXPR_H) $(srcdir)/../toplev.h 
263 class.o : class.c $(CXX_TREE_H) $(srcdir)/../flags.h \
264   $(srcdir)/../toplev.h $(RTL_H)
265 call.o : call.c $(CXX_TREE_H) $(srcdir)/../flags.h \
266   $(srcdir)/../toplev.h $(RTL_H) $(EXPR_H) $(GGC_H)
267 friend.o : friend.c $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
268   $(srcdir)/../toplev.h
269 init.o : init.c $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
270   $(EXPR_H) $(srcdir)/../toplev.h $(GGC_H) \
271   $(srcdir)/../except.h
272 method.o : method.c $(CXX_TREE_H) \
273   $(srcdir)/../toplev.h $(GGC_H) $(RTL_H)
274 cvt.o : cvt.c $(CXX_TREE_H) decl.h \
275   $(srcdir)/../flags.h $(srcdir)/../toplev.h $(srcdir)/../convert.h
276 search.o : search.c $(CXX_TREE_H) $(srcdir)/../stack.h \
277   $(srcdir)/../flags.h $(srcdir)/../toplev.h $(RTL_H)
278 tree.o : tree.c $(CXX_TREE_H) $(srcdir)/../flags.h \
279   $(srcdir)/../toplev.h $(GGC_H) $(RTL_H) \
280   ../insn-config.h $(srcdir)/../integrate.h
281 ptree.o : ptree.c $(CXX_TREE_H) $(srcdir)/../system.h
282 rtti.o : rtti.c $(CXX_TREE_H) $(srcdir)/../flags.h \
283   $(srcdir)/../toplev.h $(srcdir)/../defaults.h
284 except.o : except.c $(CXX_TREE_H) $(srcdir)/../flags.h $(RTL_H) \
285   $(srcdir)/../except.h $(srcdir)/../toplev.h cfns.h
286 expr.o : expr.c $(CXX_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
287   $(EXPR_H) $(srcdir)/../toplev.h $(srcdir)/../except.h
288 xref.o : xref.c $(CXX_TREE_H) $(srcdir)/../input.h \
289   $(srcdir)/../toplev.h
290 pt.o : pt.c $(CXX_TREE_H) decl.h $(PARSE_H) lex.h \
291   $(srcdir)/../toplev.h $(GGC_H) $(RTL_H) \
292   $(srcdir)/../except.h
293 error.o : error.c $(CXX_TREE_H) \
294   $(srcdir)/../toplev.h $(srcdir)/../diagnostic.h
295 errfn.o : errfn.c $(CXX_TREE_H) \
296   $(srcdir)/../toplev.h
297 repo.o : repo.c $(CXX_TREE_H) \
298   $(srcdir)/../toplev.h $(GGC_H)
299 semantics.o: semantics.c $(CXX_TREE_H) lex.h \
300   $(srcdir)/../except.h $(srcdir)/../toplev.h \
301   $(srcdir)/../flags.h $(GGC_H) \
302   $(srcdir)/../output.h $(RTL_H) $(TIMEVAR_H)
303 dump.o: dump.c $(CXX_TREE_H)
304 optimize.o: optimize.c $(CXX_TREE_H) \
305   $(srcdir)/../rtl.h $(srcdir)/../integrate.h ../insn-config.h \
306   $(srcdir)/../input.h
307 mangle.o: mangle.c $(CXX_TREE_H) $(srcdir)/../toplev.h
308
309 #\f
310 # These exist for maintenance purposes.
311
312 # Update the tags table.
313 TAGS: force
314         cd $(srcdir) ;                          \
315         etags *.c *.h ;                         \
316         echo 'l' | tr 'l' '\f' >> TAGS ;        \
317         echo 'parse.y,0' >> TAGS ;              \
318         etags -a ../*.h ../*.c;
319
320 .PHONY: TAGS
321
322 force: