1 # Makefile for GNU C++ compiler.
2 # Copyright (C) 1987, 1988 Free Software Foundation, Inc.
3 # Hacked by Michael Tiemann (tiemann@mcc.com)
5 #This file is part of GNU CC.
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 1, or (at your option)
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.
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, 675 Mass Ave, Cambridge, MA 02139, USA.
22 # Variables that exist for you to override.
23 # See below for how to change them for certain systems.
25 # These files depend on -DSOS:
26 # cplus-class.o cplus-decl.o cplus-decl2.o cplus-init.o \
27 # cplus-method.o cplus-typeck.o
29 # This file depends on -DESKIT: cplus-class.o
31 # These files depend on -DGATHER_STATISTICS: tree.c cplus-lex.c \
32 # cplus-class.c cplus-search.c
34 # This file depends on -DCADILLAC
36 CADILLAC_OBJS = cplus-cadillac.o ../cadillac/code/connection/libconn.a
38 # Defining NDEBUG will cause assertion macros to do nothing.
40 # This file depends on -DYYDEBUG: cplus-tab.c. Without, you cannot
43 # On COFF systems, use one of the definitions below. (see collect.c)
44 # COFFLAGS = -DUSE_COLLECT -DCOFF
45 # COFFLAGS = -DUSE_COLLECT -DEXTENDED_COFF
47 # On some BSD systems (like Vax, unlike Sun), there is no file
48 # /usr/include/unistd.h. If this is the case for your system
49 # uncomment the following line.
50 # HAVE_UNISTD_H = -DNO_UNISTD_H
52 # CFLAGS = -g -DSOS -DESKIT -O
53 CFLAGS = -g -DGATHER_STATISTICS -O $(COFFLAGS) -B../gcc-test/ -DFIELD_XREF
59 # on sysV, define this as cp.
61 # on sysV, define this as ln.
64 # Compiler to use for compiling gnulib.
65 # OLDCC should not be the GNU C compiler.
68 # CFLAGS for use with OLDCC, for compiling gnulib.
69 # NOTE: -O does not work on some Unix systems!
70 # If you use it here, you are asking for trouble.
73 # USG_STDIO if for machines which use System V stdio.
74 # In general, if USG is #defined by your system, you should
75 # uncomment the following line. But turncoats who claim officially
76 # to support System V, but really try to be Berkeley (and thus
77 # break with USG defined), may need to define this.
78 # USG_STDIO = -DUSG_STDIO
82 # Directory where sources are, from where we are.
84 # Directory in which to put the executable for the command `g++'
85 bindir = $(prefix)/bin
86 # Directory in which to put the subprograms used by the compiler.
87 libdir = $(prefix)/lib
88 # Directory in which to put the crt0+.o, crt1+.o, and other such files.
89 startdir = $(prefix)/lib
90 # Directory in which to put man pages.
91 mandir = $(prefix)/man/man1
92 # Number to put in man-page filename.
95 # Additional system libraries to link with.
98 # Change this to a null string if obstacks are installed in the
102 # Directory to link to, when using the target `maketest'.
104 # this is the GNU CC build directory
107 # End of variables for you to override.
110 # Variables you should change for certain systems.
112 # These are what you would need on HPUX:
113 # CFLAGS = -Wc,-Ns2000 -Wc,-Ne700 -Wc,-Np300 -Wc,-Nw1000
114 # If you are using the GNU assembler and linker on HPUX,
115 # add -I../hp-include to CFLAGS.
116 # -g is desirable in CFLAGS, but a compiler bug in HPUX version 5
117 # bites whenever tree.def, rtl.def or machmode.def is included
118 # (ie., on every source file).
119 # CCLIBFLAGS = -Wc,-Ns2000 -Wc,-Ne700
120 # For CCLIBFLAGS you might want to specify the switch that
121 # forces only 68000 instructions to be used.
123 # If you are making gcc for the first time, and if you are compiling it with
124 # a non-gcc compiler, and if your system doesn't have a working alloca() in any
125 # of the standard libraries (as is true for HP/UX or Genix),
126 # then get alloca.c from GNU Emacs and un-comment the following line:
128 # But don't do that if compiling using GCC.
130 # If your system has alloca() in /lib/libPW.a, un-comment the following line:
133 # If your system's malloc() routine fails for any reason (as it does on
134 # certain versions of Genix), try getting the files
135 # malloc.c and getpagesize.h from GNU Emacs and un-comment the following line:
138 # If you are running GCC on an Apollo (SR10.x),
139 # go into a Berkeley environment and use this:
140 # CFLAGS = -g -A nansi -A cpu,3000 -A runtype,bsd4.3 -A systype,any -DSHORT_ENUM_BUG
141 # (Says vasta@apollo.com.)
144 # Dependency on obstack, alloca, malloc or whatever library facilities
145 # are not installed in the system libraries.
146 LIBDEPS= $(OBSTACK) $(ALLOCA) $(MALLOC)
148 # How to link with both our special library facilities
149 # and the system's installed libraries.
150 LIBS = $(OBSTACK) $(ALLOCA) $(MALLOC) $(CLIB)
152 # Specify the directories to be searched for header files.
153 # Both . and srcdir are used, in that order,
154 # so that tm.h and config.h will be found in the compilation
155 # subdirectory rather than in the source directory.
156 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config
157 SUBDIR_INCLUDES = -I.. -I../$(srcdir) -I../$(srcdir)/config
159 # Always use -I$(srcdir)/config when compiling.
161 $(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCLUDES) $<
163 # Language-specific object files for C.
164 C_OBJS = c-parse.tab.o c-decl.o c-typeck.o c-convert.o
166 # Language-specific object files for C++.
167 CPLUS_OBJS = cplus-tab.o cplus-decl.o cplus-decl2.o cplus-typeck.o cplus-type2.o \
168 cplus-tree.o cplus-lex.o cplus-class.o cplus-init.o cplus-except.o \
169 cplus-method.o cplus-cvt.o cplus-search.o cplus-ptree.o cplus-expr.o \
172 # Language-independent object files.
173 OBJS = toplev.o version.o tree.o print-tree.o stor-layout.o \
174 fold-const.o rtl.o rtlanal.o expr.o stmt.o case.o expmed.o explow.o \
175 optabs.o varasm.o symout.o dbxout.o sdbout.o emit-rtl.o insn-emit.o \
176 integrate.o jump.o cse.o loop.o flow.o stupid.o combine.o \
177 regclass.o local-alloc.o global-alloc.o reload.o reload1.o caller-save.o \
178 insn-peep.o final.o recog.o insn-recog.o insn-extract.o insn-output.o
180 # Files to be copied away after each stage in building.
182 STAGESTUFF = *.o insn-flags.h insn-config.h insn-codes.h \
183 insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
184 stamp-flags.h stamp-config.h stamp-codes.h \
185 stamp-output.c stamp-recog.c stamp-emit.c stamp-extract.c stamp-peep.c \
186 genemit genoutput genrecog genextract genflags gencodes genconfig genpeep \
189 # Header files that are made available to programs compiled with gcc.
190 USER_H = stddef.h stdarg.h assert.h va-*.h limits.h
192 # The files that "belong" in CONFIG_H are deliberately omitted
193 # because having them there would not be useful in actual practice.
194 # All they would do is cause complete recompilation every time
195 # one of the machine description files is edited.
196 # That may or may not be what one wants to do.
197 # If it is, rm *.o is an easy way to do it.
198 # CONFIG_H = config.h tm.h
200 RTL_H = rtl.h rtl.def machmode.def
201 TREE_H = tree.h real.h tree.def machmode.def
202 CPLUS_TREE_H = $(TREE_H) cplus-tree.h cplus-tree.def
204 # Note that dependencies on obstack.h are not written
205 # because that file is not part of GCC.
206 # Dependencies on gvarargs.h are not written
207 # because all that file does, when not compiling with GCC,
208 # is include the system varargs.h.
210 # gnulib is not a target because a proper installation of GNU CC
211 # will place it where g++ can find it. Same with cpp
212 all: crt1+.o g++ cc1plus ld++ g++filt # collect crt0+.o
213 # On COFF systems, use the target below.
214 # all: g++ cc1plus collect # crt0+.o crt1+.o
216 doc: $(srcdir)/cpp.info $(srcdir)/g++.info
218 compilations: ${OBJS} ${CPLUS_OBJS}
220 g++: gcc.o version.o $(LIBDEPS)
221 $(CC) $(CFLAGS) $(LDFLAGS) -o g++ gcc.o version.o $(LIBS)
223 # Note: If you have SunOS 4.0, you can't use GNU LD to link programs
224 # which use shared libraries. You could add -DNO_GNU_LD to this
225 # command line, but be warned that collect is not really powerful
226 # enough to do right by all C++ static constructors, and it would
227 # be better if you could just add support to GNU LD to handle
229 gcc.o: gcc.c $(CONFIG_H)
230 $(CC) $(CFLAGS) $(INCLUDES) \
231 -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
232 -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-\" -c \
233 `echo $(srcdir)/gcc.c | sed 's,^\./,,'`
239 if cmp -s tm.h config/tm-sun3.h; then \
240 OPTS='-Dmc68020 -DSUN3=3 -DTARGET=SUN3'; \
241 DFLTS='"$(libdir)", "/lib", "/usr/lib", "/usr/local/lib"'; \
242 elif cmp -s tm.h config/tm-sun3-fpa.h; then \
243 OPTS='-Dmc68020 -DSUN3=3 -DTARGET=SUN3'; \
244 DFLTS='"$(libdir)", "/lib", "/usr/lib", "/usr/local/lib"'; \
245 elif cmp -s tm.h config/tm-sun3-nfp.h; then \
246 OPTS='-Dmc68020 -DSUN3=3 -DTARGET=SUN3'; \
247 DFLTS='"$(libdir)", "/lib", "/usr/lib", "/usr/local/lib"'; \
248 elif cmp -s tm.h config/tm-sun2.h; then \
249 OPTS='-Dmc68010 -DSUN2=2 -DTARGET=SUN2'; \
250 DFLTS='"$(libdir)", "/lib", "/usr/lib", "/usr/local/lib"'; \
251 elif cmp -s tm.h config/tm-sun4os3.h; then \
252 OPTS='-DSUN4=4 -DTARGET=SUN4'; \
253 DFLTS='"$(libdir)", "/lib", "/usr/lib", "/usr/local/lib"'; \
254 elif cmp -s tm.h config/tm-sun4os4.h; then \
255 OPTS='-DSUN4=4 -DTARGET=SUN4'; \
256 DFLTS='"$(libdir)", "/lib", "/usr/lib", "/usr/local/lib"'; \
257 elif cmp -s tm.h config/tm-sparc.h; then \
258 OPTS='-DSUN4=4 -DTARGET=SUN4'; \
259 DFLTS='"$(libdir)", "/lib", "/usr/lib", "/usr/local/lib"'; \
260 elif cmp -s tm.h config/tm-encore.h; then \
261 CRT0_OPTIONS='-DUMAX'; \
262 DFLTS='"$(libdir)", "/lib", "/usr/lib", "/usr/local/lib"'; \
263 elif cmp -s tm.h config/tm-hp9k320g.h; then \
264 OPTS='-Dmc68020 -DNON_NATIVE -DUSG' \
265 DFLTS='"$(libdir)/gnu", "/lib", "/usr/lib", "/usr/local/lib"'; \
266 elif cmp -s tm.h config/tm-altos3068.h; then \
267 OPTS='-DCOFF_ENCAPSULATE -DNON_NATIVE -DUSG -DPORTAR'; \
268 elif cmp -s tm.h config/tm-newsgas.h; then \
269 CRT0_OPTIONS='-DCRT0_DUMMIES=bogus_fp, -DDOT_GLOBAL_START'; \
270 elif cmp -s tm.h config/tm-i386gas.h; then \
271 OPTS='-DUSG -DCOFF_ENCAPSULATE -DNON_NATIVE -DPORTAR'; \
273 OPTS='-DTARGET=-1'; \
274 DFLTS='"$(libdir)", "/lib", "/usr/lib", "/usr/local/lib"'; \
276 echo $$OPTS $$DFLTS; \
277 if [ "$$DFLTS" = "" ] ; \
279 $(CC) -c -v $$OPTS $(PROFILE) $(CFLAGS) $(CFLAGS) ld.c ; \
281 $(CC) -c -v $$OPTS -DSTANDARD_SEARCH_DIRS="$$DFLTS" $(PROFILE) $(CFLAGS) ld.c ; \
284 ld++: ld.o cplus-dem.o
285 $(CC) -o ld++ $(PROFILE) ld.o cplus-dem.o -lg -lc
287 collect: collect.c config.h $(LIBDEPS)
288 COLLECT_LIBS="-lld"; \
289 if cmp -s tm.h config/tm-encore.h; then \
290 COLLECT_OPTIONS='-DUMAX'; \
292 COLLECT_OPTIONS=''; \
294 $(CC) -o collect $(PROFILE) $$COLLECT_OPTIONS $(CFLAGS) $(INCLUDES) $< -lg -lc $$COLLECT_LIBS
296 collect2: collect2.c config.h
297 $(CC) -o collect2 collect2.c $(PROFILE) $$COLLECT_OPTIONS $(CFLAGS) $(INCLUDES) -lc
299 g++filt: g++filt.o cplus-dem.o
300 $(CC) -o g++filt g++filt.o cplus-dem.o
302 crt0+.o: crt0.c config.h
303 -if cmp -s tm.h config/tm-vax.h; then \
304 CRT0_OPTIONS='-DCRT0_DUMMIES='; \
305 elif cmp -s tm.h config/tm-vaxv.h; then \
306 CRT0_OPTIONS='-DCRT0_DUMMIES='; \
307 elif cmp -s tm.h config/tm-vms.h; then \
308 CRT0_OPTIONS='-DCRT0_DUMMIES='; \
309 elif cmp -s tm.h config/tm-hp9k320.h; then \
310 CRT0_OPTIONS='-Umc68000'; \
311 elif cmp -s tm.h config/tm-hp9k320g.h; then \
312 CRT0_OPTIONS='-Umc68000'; \
313 elif cmp -s tm.h config/tm-sequent.h; then \
314 CRT0_OPTIONS='-DCRT0_DUMMIES= -DDOT_GLOBAL_START'; \
315 elif cmp -s tm.h config/tm-altos3068.h; then \
316 CRT0_OPTIONS='-DCRT0_DUMMIES= -Umc68000 -Um68k'; \
317 elif cmp -s tm.h tm-i386gas.h; then \
318 CRT0_OPTIONS='-DCRT0_DUMMIES=bogus_fp, -DDOT_GLOBAL_START'; \
319 elif cmp -s tm.h config/tm-hp9k3bsd.h; then \
320 CRT0_OPTIONS='-DCRT0_DUMMIES=bogus_a6, -Uhp9000'; \
324 echo $$CRT0_OPTIONS; \
325 $(CC) -Um68k $$CRT0_OPTIONS $(CFLAGS) -c $(INCLUDES) crt0.c
328 CRT1_COMMAND=$(CC) -Um68k $(CFLAGS) -c $(INCLUDES) crt1.c
330 crt1+.o: crt1.c config.h
334 cc1plus: $(CPLUS_OBJS) $(OBJS) $(LIBDEPS) lastfile.o cplus-edsel.o
335 $(CC) $(CFLAGS) $(LDFLAGS) -o cc1plus lastfile.o $(CPLUS_OBJS) cplus-edsel.o $(OBJS) $(LIBS) -lm
337 cadillac-cc1plus: $(CPLUS_OBJS) $(CADILLAC_OBJS) $(OBJS) $(LIBDEPS) lastfile.o
338 $(CC) $(CFLAGS) $(LDFLAGS) -o cadillac-cc1plus lastfile.o $(CPLUS_OBJS) $(CADILLAC_OBJS) $(OBJS) $(LIBS)
340 cplus-decl.o : cplus-decl.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h \
341 cplus-parse.h cplus-decl.h stack.h rtl.h insn-flags.h
342 cplus-decl2.o : cplus-decl2.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h \
343 cplus-parse.h cplus-decl.h
344 cplus-typeck.o : cplus-typeck.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
345 cplus-type2.o : cplus-type2.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
346 cplus-tree.o : cplus-tree.c $(CONFIG_H) $(CPLUS_TREE_H)
347 cplus-class.o : cplus-class.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h
348 cplus-init.o : cplus-init.c $(CONFIG_H) $(CPLUS_TREE_H)
349 cplus-except.o : cplus-except.c $(CONFIG_H) $(CPLUS_TREE_H)
350 cplus-expr.o : cplus-expr.c $(CONFIG_H) $(CPLUS_TREE_H) $(RTL_H) insn-codes.h
351 cplus-method.o : cplus-method.c $(CONFIG_H) $(CPLUS_TREE_H)
352 cplus-cvt.o : cplus-cvt.c $(CONFIG_H) $(CPLUS_TREE_H)
353 cplus-search.o : cplus-search.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h
354 cplus-ptree.o : cplus-ptree.c $(CONFIG_H) $(TREE_H)
355 cplus-field.o : cplus-field.c $(CONFIG_H) $(TREE_H)
357 cplus-cadillac.o : cplus-cadillac.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h
358 $(CC) -c -DCADILLAC $(CFLAGS) $(INCLUDES) -I../cadillac/code/comp-dep -I../cadillac/code/connection $<
359 cplus-edsel.o : cplus-cadillac.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h
360 $(CC) -c $(CFLAGS) $(INCLUDES) -o cplus-edsel.o cplus-cadillac.c
362 cplus-tab.o : $(srcdir)/cplus-tab.c $(CONFIG_H) $(CPLUS_TREE_H) \
363 cplus-parse.h flags.h input.h
364 $(CC) -c $(CFLAGS) $(INCLUDES) -DPARSE_OUTPUT=\"$(PWD)/cplus-tab.out\" $<
366 $(srcdir)/cplus-tab.c : $(srcdir)/cplus-parse.y
367 @echo expect 24 shift/reduce conflicts and 12 reduce/reduce conflicts
369 $(BISON) $(BISONFLAGS) -o cplus-tab.c cplus-parse.y
371 cplus-lex.o : cplus-lex.c $(CONFIG_H) $(CPLUS_TREE_H) $(srcdir)/cplus-tab.h input.h
372 $(CC) -c $(CFLAGS) $(INCLUDES) $(USG_STDIO) $<
374 lastfile.o : lastfile.c
376 # Language-independent files.
378 tree.o : tree.c $(CONFIG_H) $(TREE_H) flags.h
379 print-tree.o : print-tree.c $(CONFIG_H) $(TREE_H)
380 stor-layout.o : stor-layout.c $(CONFIG_H) $(TREE_H) $(RTL_H)
381 fold-const.o : fold-const.c $(CONFIG_H) $(TREE_H)
382 toplev.o : toplev.c $(CONFIG_H) $(TREE_H) flags.h input.h
383 $(CC) -c $(CFLAGS) $(INCLUDES) $(HAVE_UNISTD_H) $<
385 rtl.o : rtl.c $(CONFIG_H) $(RTL_H)
387 rtlanal.o : rtlanal.c $(CONFIG_H) $(RTL_H)
389 varasm.o : varasm.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h expr.h \
390 insn-codes.h hard-reg-set.h
391 case.o : case.c $(CONFIG_H) $(RTL_H) $(TREE_H) insn-flags.h
392 stmt.o : stmt.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
393 insn-flags.h expr.h insn-config.h regs.h hard-reg-set.h insn-codes.h
394 expr.o : expr.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
395 insn-flags.h insn-codes.h expr.h insn-config.h recog.h
396 expmed.o : expmed.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
397 insn-flags.h insn-codes.h expr.h insn-config.h recog.h
398 explow.o : explow.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h insn-codes.h
399 optabs.o : optabs.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
400 insn-flags.h insn-codes.h expr.h insn-config.h recog.h
401 symout.o : symout.c $(CONFIG_H) $(TREE_H) $(RTL_H) symseg.h gdbfiles.h
402 dbxout.o : dbxout.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h $(CPLUS_TREE_H)
403 sdbout.o : sdbout.c $(CONFIG_H) $(TREE_H) $(RTL_H)
405 emit-rtl.o : emit-rtl.c $(CONFIG_H) $(RTL_H) regs.h insn-config.h real.h
407 integrate.o : integrate.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h \
408 insn-flags.h insn-codes.h
410 jump.o : jump.c $(CONFIG_H) $(RTL_H) flags.h regs.h
411 stupid.o : stupid.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h
413 cse.o : cse.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h real.h
414 loop.o : loop.c $(CONFIG_H) $(RTL_H) insn-config.h insn-codes.h \
415 regs.h hard-reg-set.h recog.h flags.h expr.h
416 flow.o : flow.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h hard-reg-set.h
417 combine.o : combine.c $(CONFIG_H) $(RTL_H) flags.h \
418 insn-config.h regs.h basic-block.h recog.h
419 regclass.o : regclass.c $(CONFIG_H) $(RTL_H) hard-reg-set.h flags.h \
420 basic-block.h regs.h insn-config.h recog.h
421 local-alloc.o : local-alloc.c $(CONFIG_H) $(RTL_H) flags.h basic-block.h regs.h \
422 hard-reg-set.h insn-config.h recog.h
423 global-alloc.o : global-alloc.c $(CONFIG_H) $(RTL_H) flags.h \
424 basic-block.h regs.h hard-reg-set.h insn-config.h
426 reload.o : reload.c $(CONFIG_H) $(RTL_H) flags.h \
427 reload.h recog.h hard-reg-set.h insn-config.h regs.h
428 reload1.o : reload1.c $(CONFIG_H) $(RTL_H) flags.h \
429 reload.h regs.h hard-reg-set.h insn-config.h basic-block.h recog.h
430 caller-save.o : caller-save.c $(CONFIG_H) $(RTL_H) flags.h \
431 reload.h regs.h hard-reg-set.h insn-config.h basic-block.h recog.h
432 final.o : final.c $(CONFIG_H) $(RTL_H) flags.h regs.h recog.h conditions.h \
433 gdbfiles.h insn-config.h real.h output.h
434 recog.o : recog.c $(CONFIG_H) $(RTL_H) \
435 regs.h recog.h hard-reg-set.h insn-config.h real.h
437 # Normally this target is not used; but it is used if you
438 # define ALLOCA=alloca.o. In that case, you must get a suitable alloca.c
439 # from the GNU Emacs distribution.
440 # Note some machines won't allow $(CC) without -S on this source file.
442 $(CC) $(CFLAGS) -S `echo $(srcdir)/alloca.c | sed 's,^\./,,'`
443 as alloca.s -o alloca.o
445 # Now the source files that are generated from the machine description.
447 .PRECIOUS: insn-config.h insn-flags.h insn-codes.h \
448 insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c
450 # The following pair of rules has this effect:
451 # genconfig is run only if the md has changed since genconfig was last run;
452 # but the file insn-config.h is touched only when its contents actually change.
454 # Each of the other insn-* files is handled by a similar pair of rules.
456 insn-config.h: stamp-config.h ;
457 stamp-config.h : md genconfig
458 ./genconfig md > tmp-insn-config.h
459 $(srcdir)/move-if-change tmp-insn-config.h insn-config.h
462 insn-flags.h: stamp-flags.h ;
463 stamp-flags.h : md genflags
464 ./genflags md > tmp-insn-flags.h
465 $(srcdir)/move-if-change tmp-insn-flags.h insn-flags.h
468 insn-codes.h: stamp-codes.h ;
469 stamp-codes.h : md gencodes
470 ./gencodes md > tmp-insn-codes.h
471 $(srcdir)/move-if-change tmp-insn-codes.h insn-codes.h
474 insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) expr.h real.h insn-codes.h \
475 insn-config.h insn-flags.h
476 $(CC) $(CFLAGS) $(INCLUDES) -c insn-emit.c
478 insn-emit.c: stamp-emit.c ;
479 stamp-emit.c : md genemit
480 ./genemit md > tmp-insn-emit.c
481 $(srcdir)/move-if-change tmp-insn-emit.c insn-emit.c
484 insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h real.h
485 $(CC) $(CFLAGS) $(INCLUDES) -c insn-recog.c
487 insn-recog.c: stamp-recog.c ;
488 stamp-recog.c : md genrecog
489 ./genrecog md > tmp-insn-recog.c
490 $(srcdir)/move-if-change tmp-insn-recog.c insn-recog.c
493 insn-extract.o : insn-extract.c $(RTL_H)
494 $(CC) $(CFLAGS) $(INCLUDES) -c insn-extract.c
496 insn-extract.c: stamp-extract.c ;
497 stamp-extract.c : md genextract
498 ./genextract md > tmp-insn-extract.c
499 $(srcdir)/move-if-change tmp-insn-extract.c insn-extract.c
500 touch stamp-extract.c
502 insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) regs.h real.h
503 $(CC) $(CFLAGS) $(INCLUDES) -c insn-peep.c
505 insn-peep.c: stamp-peep.c ;
506 stamp-peep.c : md genpeep
507 ./genpeep md > tmp-insn-peep.c
508 $(srcdir)/move-if-change tmp-insn-peep.c insn-peep.c
511 insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) regs.h real.h conditions.h \
512 hard-reg-set.h insn-config.h insn-flags.h output.h aux-output.c
513 $(CC) $(CFLAGS) $(INCLUDES) -c insn-output.c
515 insn-output.c: stamp-output.c ;
516 stamp-output.c : md genoutput
517 ./genoutput md > tmp-insn-output.c
518 $(srcdir)/move-if-change tmp-insn-output.c insn-output.c
521 # Now the programs that generate those files.
522 # $(CONFIG_H) is omitted from the deps of the gen*.o
523 # because these programs don't really depend on anything
524 # about the target machine. They do depend on config.h itself,
525 # since that describes the host machine.
527 genconfig : genconfig.o rtl.o $(LIBDEPS)
528 $(CC) $(CFLAGS) $(LDFLAGS) -o genconfig genconfig.o rtl.o $(LIBS)
530 genconfig.o : genconfig.c $(RTL_H) config.h
532 genflags : genflags.o rtl.o $(LIBDEPS)
533 $(CC) $(CFLAGS) $(LDFLAGS) -o genflags genflags.o rtl.o $(LIBS)
535 genflags.o : genflags.c $(RTL_H) config.h
537 gencodes : gencodes.o rtl.o $(LIBDEPS)
538 $(CC) $(CFLAGS) $(LDFLAGS) -o gencodes gencodes.o rtl.o $(LIBS)
540 gencodes.o : gencodes.c $(RTL_H) config.h
542 genemit : genemit.o rtl.o $(LIBDEPS)
543 $(CC) $(CFLAGS) $(LDFLAGS) -o genemit genemit.o rtl.o $(LIBS)
545 genemit.o : genemit.c $(RTL_H) config.h
547 genrecog : genrecog.o rtl.o $(LIBDEPS)
548 $(CC) $(CFLAGS) $(LDFLAGS) -o genrecog genrecog.o rtl.o $(LIBS)
550 genrecog.o : genrecog.c $(RTL_H) config.h
552 genextract : genextract.o rtl.o $(LIBDEPS)
553 $(CC) $(CFLAGS) $(LDFLAGS) -o genextract genextract.o rtl.o $(LIBS)
555 genextract.o : genextract.c $(RTL_H) config.h
557 genpeep : genpeep.o rtl.o $(LIBDEPS)
558 $(CC) $(CFLAGS) $(LDFLAGS) -o genpeep genpeep.o rtl.o $(LIBS)
560 genpeep.o : genpeep.c $(RTL_H) config.h
562 genoutput : genoutput.o rtl.o $(LIBDEPS)
563 $(CC) $(CFLAGS) $(LDFLAGS) -o genoutput genoutput.o rtl.o $(LIBS)
565 genoutput.o : genoutput.c $(RTL_H) config.h
567 # Making the preprocessor
571 cccp: cccp.o cexp.o version.o $(LIBDEPS)
572 $(CC) $(CFLAGS) $(LDFLAGS) -o cccp cccp.o cexp.o version.o $(LIBS)
578 $(CC) $(CFLAGS) $(INCLUDES) \
579 -DGCC_INCLUDE_DIR=\"$(libdir)/gcc-include\" \
580 -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" -c $<
582 $(srcdir)/g++.info: $(srcdir)/g++.texinfo
583 makeinfo `echo $(srcdir)/g++.texinfo | sed 's,^\./,,'`
585 # gnulib is not deleted because deleting it would be inconvenient
586 # for most uses of this target.
588 -rm -f $(STAGESTUFF) $(STAGE_GCC)
589 -rm -f stamp-*.[ch] tmp-insn-*
590 -rm -f *.s *.s[0-9] *.co *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop *.dbr *.jump2
591 -rm -f core hard-params
593 # Like clean but also delete the links made to configure gcc.
594 # Also removes gnulib, since that is desirable if you are changing cpus.
596 -rm -f tm.h aux-output.c config.h md config.status gnulib
598 # Get rid of every file that's generated from some other file (except INSTALL).
599 realclean: cleanconfig
600 -rm -f cpp.aux cpp.cps cpp.fns cpp.info cpp.kys cpp.pgs cpp.tps cpp.vrs
601 -rm -f cplus-tab.c cplus-tab.out cplus-tab.h
602 -rm -f errs gnulib cexp.c TAGS tm-*+.h
603 -rm -f g++.info* g++.?? g++.??s g++.log g++.toc g++.*aux
606 # Copy the files into directories where they will be run.
611 -if [ -f cc1plus ] ; then $(INSTALL) cc1plus $(libdir)/gcc-cc1plus ;fi
612 -if [ -f collect ] ; then $(INSTALL) collect $(libdir)/gcc-collect ;fi
613 -if [ -f collect2 ] ; then $(INSTALL) collect2 $(libdir)/gcc-ld ;fi
614 $(INSTALL) g++ $(bindir)
615 # -if [ -f crt0+.o ] ; then $(INSTALL) crt0+.o $(startdir)/crt0+.o ;fi
616 -if [ -f crt1+.o ] ; then $(INSTALL) crt1+.o $(startdir)/crt1+.o ;fi
617 -mkdir $(libdir)/g++-include
618 -chmod ugo+rx $(libdir)/g++-include
621 $(INSTALL) ld++ $(libdir)/gcc-ld
623 # do make -f Makefile maketest DIR=../gcc TDIR=../gcc-test
624 # in the intended test directory to make it a suitable test directory.
627 -$(LINK) $(DIR)/.gdbinit .
628 -$(LINK) $(DIR)/bison.simple .
629 -$(LINK) $(DIR)/config.gcc .
630 -$(LINK) $(DIR)/move-if-change .
633 -$(LINK) $(DIR)/genemit.c $(DIR)/genoutput.c $(DIR)/genrecog.c \
634 $(DIR)/genextract.c $(DIR)/genflags.c $(DIR)/gencodes.c \
635 $(DIR)/genconfig.c $(DIR)/genpeep.c .
636 -$(LINK) $(TDIR)/obstack.o $(TDIR)/rtl.o $(TDIR)/emit-rtl.o \
637 $(TDIR)/jump.o $(TDIR)/cse.o \
638 $(TDIR)/loop.o $(TDIR)/flow.o $(TDIR)/stupid.o $(TDIR)/combine.o \
639 $(TDIR)/regclass.o $(TDIR)/local-alloc.o $(TDIR)/global-alloc.o \
640 $(TDIR)/reload.o $(TDIR)/reload1.o $(TDIR)/caller-save.o \
641 $(TDIR)/final.o $(TDIR)/recog.o $(TDIR)/genemit \
642 $(TDIR)/genoutput $(TDIR)/genrecog $(TDIR)/genextract \
643 $(TDIR)/genflags $(TDIR)/gencodes $(TDIR)/genconfig \
645 -$(LINK) $(TDIR)/genemit.o $(TDIR)/genoutput.o $(TDIR)/genrecog.o \
646 $(TDIR)/genextract.o $(TDIR)/genflags.o $(TDIR)/gencodes.o \
647 $(TDIR)/genconfig.o $(TDIR)/genpeep.o .
648 -$(LINK) $(TDIR)/insn-emit.c $(TDIR)/insn-output.c $(TDIR)/insn-recog.c \
649 $(TDIR)/insn-extract.c $(TDIR)/insn-flags.h $(TDIR)/insn-codes.h \
650 $(TDIR)/insn-config.h $(TDIR)/insn-peep.c .
651 -rm tm.h aux-output.c config.h md
652 # You must then run config.g++ to set up for compilation.
655 echo GNU C++ does not bootstrap itself
657 .PHONY: stage1 stage2 stage3 #In GNU Make, ignore whether `stage*' exists.
662 -mv cplus-tab.c cexp.c c-*.c *.y insn-*.[ch] gen*.c temp
667 #In GNU Make, ignore whether `stage*' exists.
668 .PHONY: stage1 stage2 stage3 clean realclean TAGS bootstrap