]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/Makefile.in
*** empty log message ***
[thirdparty/gcc.git] / gcc / Makefile.in
CommitLineData
32e6d418 1# Makefile for GNU C compiler.
2# Copyright (C) 1987, 1988, 1990, 1991 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, 675 Mass Ave, Cambridge, MA 02139, USA.
19
20# The targets for external use include:
21# all, doc, proto, install, install-cross, install-cross-rest,
c6396a0b 22# uninstall, TAGS, mostlyclean, clean, distclean, realclean,
32e6d418 23# stage1, stage2, stage3, stage4.
24
c6396a0b 25# Suppress smart makes who think they know how to automake Yacc files
26.y.c:
27
32e6d418 28.NOEXPORT: # This tells GNU Make version 3
29 # not to put all the variables in the environment.
30
31# Variables that exist for you to override.
32# See below for how to change them for certain systems.
33
34# Selection of languages to be made.
35LANGUAGES = c c++ objective-c proto
36
37ALLOCA =
38ALLOCA_FLAGS = -S -Demacs
39ALLOCA_FINISH = as -o alloca.o alloca.s
40
41# Various ways of specifying flags for compilations:
42# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
43# BOOT_CFLAGS is the value of CFLAGS to pass
44# to the stage2 and stage3 compilations
45# XCFLAGS is used for most compilations but not when using the GCC just built.
46XCFLAGS =
47CFLAGS = -g
48BOOT_CFLAGS = -O $(CFLAGS)
49# These exists to be overridden by the x-* and t-* files, respectively.
50X_CFLAGS =
51T_CFLAGS =
52
53X_CPPFLAGS =
54T_CPPFLAGS =
55
56CC = cc
57BISON = bison
58BISONFLAGS =
59AR = ar
60OLDAR_FLAGS = qc
61AR_FLAGS = rc
62SHELL = /bin/sh
63# on sysV, define this as cp.
64INSTALL = install -c
65# These permit overriding just for certain files.
66INSTALL_PROGRAM = $(INSTALL)
67INSTALL_DATA = $(INSTALL)
68SYMLINK = ln -s
69
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.
73P =
74
75# How to invoke ranlib.
76RANLIB = ranlib
77# Test to use to see whether ranlib exists on the system.
78RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
79
80# Compiler to use for compiling libgcc1.a.
81# OLDCC should not be the GNU C compiler,
82# since that would compile typical libgcc1.a functions such as mulsi3
83# into infinite recursions.
84OLDCC = cc
85
86# CFLAGS for use with OLDCC, for compiling libgcc1.a.
87# NOTE: -O does not work on some Unix systems!
88CCLIBFLAGS = -O
89
c6396a0b 90# Version of ar to use when compiling libgcc1.a.
32e6d418 91OLDAR = ar
92
93# The GCC to use for compiling libgcc2.a. Usually the one we just built.
94# Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
95GCC_FOR_TARGET = ./gcc
96
97# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
98# It omits XCFLAGS, and specifies -B./.
99GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) -B./
100
101# Special flags for compiling enquire.
102# We disable optimization to make floating point more reliable.
103ENQUIRE_CFLAGS = -DNO_SC -DNO_MEM -DNO_STDDEF -O0
104ENQUIRE_LDFLAGS = $(LDFLAGS)
105
106# Tools to use when building a cross-compiler.
107# These are used because `configure' appends `cross-make'
108# to the makefile when making a cross-compiler.
109
110TARGET_TOOLPREFIX = $(tooldir)/bin/
111AR_FOR_TARGET = $(TARGET_TOOLPREFIX)ar
112AR_FOR_TARGET_FLAGS = rc
113RANLIB_FOR_TARGET = $(TARGET_TOOLPREFIX)ranlib
114RANLIB_TEST_FOR_TARGET = [ -f $(TARGET_TOOLPREFIX)ranlib ]
115CROSS_TOOLS =
116
8bd8ea06 117# There may be a premade insn-attrtab.c for this machine.
118# (You could rebuild it with genattrtab as usual, but it takes a long time.)
119# PREMADE_ATTRTAB is the file name of the file to use.
120# PREMADE_ATTRTAB_MD is the md file it corresponds to.
121PREMADE_ATTRTAB_MD = Makefile # Guaranteed not to cmp equal to md.
122PREMADE_ATTRTAB =
123
32e6d418 124target= ... `configure' substitutes actual target name here.
125xmake_file= ... `configure' substitutes actual x- file name here.
126tmake_file= ... `configure' substitutes actual t- file name here.
127version=`awk '{printf "%s", substr ($$4, 2, length ($$4) - 3); }' $(srcdir)/version.c`
128
129# Directory where sources are, from where we are.
130srcdir = .
131# Common prefix for installation directories.
132# NOTE: This directory must exist when you start installation.
133prefix = /usr/local
c6396a0b 134# Directory in which to put host dependent programs and libraries
135exec_prefix = $(prefix)
32e6d418 136# Directory in which to put the executable for the command `gcc'
c6396a0b 137bindir = $(exec_prefix)/bin
32e6d418 138# Directory in which to put the directories used by the compiler.
c6396a0b 139libdir = $(exec_prefix)/lib
32e6d418 140# Directory in which the compiler finds executables, libraries, etc.
c6396a0b 141libsubdir = $(libdir)/gcc-lib/$(target)/$(version)
32e6d418 142# Extension (if any) to put in installed man-page filename.
143manext = .1
144# Directory in which to put man pages.
145mandir = $(prefix)/man/man1
146# Directory in which to find other cross-compilation tools and headers.
147# Used in install-cross.
148tooldir = $(prefix)/$(target)
149
150# Additional system libraries to link with.
151CLIB=
152
153# Change this to a null string if obstacks are installed in the
154# system library.
155OBSTACK=obstack.o
156
157# Specify the rule for actually making libgcc1.a.
c6396a0b 158# The value may be empty; that means to do absolutely nothing
159# with or for libgcc1.a.
32e6d418 160LIBGCC1 = libgcc1.a
161
162# Specify the rule for actually making libgcc2.a.
163LIBGCC2 = libgcc2.a
164
165# Options to use when compiling libgcc2.a.
166# -g1 causes output of debug info only for file-scope entities.
167# we use this here because that should be enough, and also
168# so that -g1 will be tested.
169LIBGCC2_CFLAGS = -O2 $(GCC_CFLAGS) -g1
170
171# List of extra executables that should be compiled for this target machine
172# that are used for compiling from source code to object code.
173# The rules for compiling them should be in the t-* file for the machine.
174EXTRA_PASSES =
175
c6396a0b 176# Like EXTRA_PASSES, but these are used when linking.
177EXTRA_PROGRAMS =
178
179# List of extra object files that should be compiled for this target machine.
32e6d418 180# The rules for compiling them should be in the t-* file for the machine.
181EXTRA_PARTS =
182
c6396a0b 183# List of extra object files that should be compiled and linked with
184# compiler proper (cc1, cc1obj, cc1plus).
185EXTRA_OBJS =
186
630c76ba 187# List of additional header files to install.
188# Often this is edited directly by `configure'.
189EXTRA_HEADERS =
190
79f818d0 191# Set this to `ld' to enable use of collect2.
192# USE_COLLECT2 =
193# It is convenient for configure to add the assignment at the beginning,
194# so don't override it here.
195
32e6d418 196# List of extra C and assembler files to add to libgcc1.a.
197# Assembler files should have names ending in `.asm'.
198LIB1FUNCS_EXTRA =
199
200# List of extra C and assembler files to add to libgcc2.a.
201# Assembler files should have names ending in `.asm'.
202LIB2FUNCS_EXTRA =
203
204# Program to convert libraries.
205LIBCONVERT =
206
207# Control whether header files are installed.
208# We will change this to install-fixincludes eventually.
209# It would be useful for people to try this now.
210INSTALL_HEADERS=install-headers
211
212# Select which version of fixincludes to use (I.E. regular versus SVR4)
213FIXINCLUDES=fixincludes
214
215# List of things which should already be built whenever we try to use gcc
216# to compile anything (without linking).
217GCC_PASSES=gcc cc1 cpp $(EXTRA_PASSES)
218
219# List of things which should already be built whenever we try to use gcc
220# to link anything.
79f818d0 221GCC_PARTS=$(GCC_PASSES) libgcc.a $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS)
32e6d418 222
223# Change this to empty to prevent installing limits.h.
c6396a0b 224# Actually, this currently has no effect,
32e6d418 225# and if that causes no problems, it can be deleted.
c6396a0b 226# Otherwise, it must be replaced so as to control
32e6d418 227# the actions of install-limits-h.
228LIMITS_H = limits.h
229
230# Directory to link to, when using the target `maketest'.
231DIR = ../gcc
232
233# Flags to use when cross-building GCC.
234# Prefix to apply to names of object files when using them
235# to run on the machine we are compiling on.
236HOST_PREFIX=
237# Prefix to apply to names of object files when compiling them
238# to run on the machine we are compiling on.
239# The default for this variable is chosen to keep these rules
240# out of the way of the other rules for compiling the same source files.
241HOST_PREFIX_1=loser-
242HOST_CC=$(CC)
243HOST_CFLAGS=$(ALL_CFLAGS)
c6396a0b 244HOST_CLIB=$(CLIB)
32e6d418 245HOST_LDFLAGS=$(LDFLAGS)
246HOST_CPPFLAGS=$(ALL_CPPFLAGS)
c6396a0b 247HOST_ALLOCA=$(ALLOCA)
248HOST_MALLOC=$(MALLOC)
249HOST_OBSTACK=$(OBSTACK)
32e6d418 250
251# Choose the real default target.
252ALL=all.internal
253
254# Choose the real install target.
255INSTALL_TARGET=install-native
256
257# End of variables for you to override.
258
259# Definition of `all' is here so that new rules inserted by sed
260# do not specify the default target.
261# The real definition is under `all.internal' (for native compilers)
262# or `all.cross' (for cross compilers).
c6396a0b 263all: all.indirect
32e6d418 264
265# sed inserts variable overrides after the following line.
266####
267\f
268# Now figure out from those variables how to compile and link.
269
c6396a0b 270all.indirect: $(ALL)
271
32e6d418 272INTERNAL_CFLAGS = $(CROSS)
273
274# This is the variable actually used when we compile.
275ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
276
277# Likewise.
278ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
279
280# Even if ALLOCA is set, don't use it if compiling with GCC.
c6396a0b 281USE_ALLOCA= ` case "${CC}" in "${OLDCC}") echo ${ALLOCA} ;; esac `
282USE_HOST_ALLOCA= ` case "${HOST_CC}"@"${HOST_ALLOCA}" in "${OLDCC}"@?*) echo ${HOST_PREFIX}${HOST_ALLOCA} ;; esac `
283USE_HOST_MALLOC= ` case "${HOST_MALLOC}" in ?*) echo ${HOST_PREFIX}${HOST_MALLOC} ;; esac `
284USE_HOST_OBSTACK= ` case "${HOST_OBSTACK}" in ?*) echo ${HOST_PREFIX}${HOST_OBSTACK} ;; esac `
32e6d418 285
286# Dependency on obstack, alloca, malloc or whatever library facilities
287# are not installed in the system libraries.
288# We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
289LIBDEPS= $(OBSTACK) $(ALLOCA) $(MALLOC)
290
291# Likewise, for use in the tools that must run on this machine
292# even if we are cross-building GCC.
293# We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
c6396a0b 294HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_ALLOCA) $(HOST_PREFIX)$(HOST_MALLOC)
32e6d418 295
296# How to link with both our special library facilities
297# and the system's installed libraries.
298LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(CLIB)
299
300# Likewise, for use in the tools that must run on this machine
301# even if we are cross-building GCC.
c6396a0b 302HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC) \
303 $(HOST_CLIB)
32e6d418 304
305HOST_RTL = $(HOST_PREFIX)rtl.o
306HOST_RTLANAL = $(HOST_PREFIX)rtlanal.o
262d46de 307HOST_PRINT = $(HOST_PREFIX)print-rtl.o
32e6d418 308
309# Specify the directories to be searched for header files.
310# Both . and srcdir are used, in that order,
311# so that tm.h and config.h will be found in the compilation
312# subdirectory rather than in the source directory.
313INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config
314SUBDIR_INCLUDES = -I.. -I../$(srcdir) -I../$(srcdir)/config
315
316# Always use -I$(srcdir)/config when compiling.
317.c.o:
318 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
319
320# This tells GNU make version 3 not to export all the variables
321# defined in this file into the environment.
322.NOEXPORT:
323\f
324# Lists of files for various purposes.
325
326# A list of all the language-specific executables.
327COMPILERS = cc1 cc1plus cc1obj
328
329# Language-specific object files for C.
330C_OBJS = c-parse.o c-lang.o \
331 c-lex.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o
332
333# Language-specific object files for Objectionable C.
334OBJC_OBJS = objc-parse.o objc-actions.o \
335 c-lex.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o
336
337# Language-specific object files for C++.
338CPLUS_OBJS = cp-parse.o cp-decl.o cp-decl2.o \
339 cp-typeck.o cp-type2.o cp-tree.o cp-ptree.o \
340 cp-cvt.o cp-search.o cp-lex.o cp-gc.o cp-call.o \
341 cp-class.o cp-init.o cp-method.o cp-except.o \
342 cp-expr.o cp-pt.o cp-edsel.o cp-xref.o \
343 $(CPLUS_INPUT) cp-spew.o c-common.o
344
345# Language-independent object files.
346OBJS = toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
347 function.o stmt.o expr.o calls.o expmed.o explow.o optabs.o varasm.o \
79f818d0 348 rtl.o print-rtl.o rtlanal.o emit-rtl.o \
349 dbxout.o sdbout.o dwarfout.o xcoffout.o \
32e6d418 350 integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o \
351 regclass.o local-alloc.o global-alloc.o reload.o reload1.o caller-save.o \
352 insn-peep.o reorg.o sched.o final.o recog.o reg-stack.o \
353 insn-recog.o insn-extract.o insn-output.o insn-emit.o \
79f818d0 354 insn-attrtab.o aux-output.o getpwd.o $(EXTRA_OBJS)
32e6d418 355
356# GEN files are listed separately, so they can be built before doing parallel
357# makes for cc1 or cc1plus. Otherwise sequent parallel make attempts to load
358# them before rtl.o is compiled.
359GEN= genemit genoutput genrecog genextract genflags gencodes genconfig genpeep
360
361# Files to be copied away after each stage in building.
362STAGESTUFF = *.o insn-flags.h insn-config.h insn-codes.h \
363 insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
364 insn-attr.h insn-attrtab.c \
365 stamp-flags stamp-config stamp-codes \
366 stamp-output stamp-recog stamp-emit stamp-extract stamp-peep \
d7330690 367 stamp-attr stamp-attrtab stamp-proto \
32e6d418 368 genemit genoutput genrecog genextract genflags gencodes genconfig genpeep \
369 genattrtab genattr \
79f818d0 370 $(GCC_PASSES) $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross cccp \
0b20f012 371 cc1plus cc1obj enquire protoize unprotoize specs collect2 $(USE_COLLECT2)
32e6d418 372
373# Members of libgcc1.a.
374LIB1FUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
375 _lshrsi3 _lshlsi3 _ashrsi3 _ashlsi3 \
376 _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 \
377 _fixdfsi _fixsfsi _floatsidf _floatsisf _truncdfsf2 _extendsfdf2 \
378 _addsf3 _negsf2 _subsf3 _mulsf3 _divsf3 \
379 _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \
380 _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2
381
382# Library members defined in libgcc2.c.
383LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
384 _lshrdi3 _lshldi3 _ashldi3 _ashrdi3 \
385 _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \
386 _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \
387 _varargs _eprintf _builtin_new _builtin_New _builtin_del \
388 _bb _shtab _clear_cache _trampoline __main _exit
389
390# Header files that are made available under the same name
391# to programs compiled with gcc.
392USER_H = assert.h va-hp800.h va-i860.h va-mips.h va-pyr.h va-sparc.h \
630c76ba 393 va-spur.h va-m88k.h va-i960.h proto.h $(EXTRA_HEADERS)
32e6d418 394
395# All the header files that are installed for users from GCC itself.
396INSTALLED_H = float.h stddef.h stdarg.h varargs.h $(USER_H) limits.h
397
398# The files that "belong" in CONFIG_H are deliberately omitted
399# because having them there would not be useful in actual practice.
400# All they would do is cause complete recompilation every time
401# one of the machine description files is edited.
402# That may or may not be what one wants to do.
403# If it is, rm *.o is an easy way to do it.
404# CONFIG_H = config.h tm.h
405CONFIG_H =
406RTL_H = rtl.h rtl.def machmode.h machmode.def
407TREE_H = tree.h real.h tree.def machmode.h machmode.def
408CPLUS_TREE_H = $(TREE_H) cp-tree.h cp-tree.def
409\f
410# Avoid a lot of time thinking about remaking Makefile.in and *.def.
411.SUFFIXES: .in .def
412
79f818d0 413Makefile: $(srcdir)/Makefile.in $(srcdir)/configure $(srcdir)/version.c \
32e6d418 414 $(srcdir)/config/$(xmake_file) $(srcdir)/config/$(tmake_file)
415 sh config.status
416
417all.internal: start.encap rest.encap
418# This is what to compile if making a cross-compiler.
d7330690 419all.cross: native gcc-cross cross-test
32e6d418 420# This is what must be made before installing GCC and converting libraries.
421start.encap: native gcc $(LIBGCC1_TARGET)
422# Use this to make a GCC that will be used only to recompile GCC.
423for-bootstrap: start.encap libgcc.a
424# These can't be made, with COFF encapsulation, until after GCC can run.
c6396a0b 425rest.encap: libgcc.a float.h $(EXTRA_PARTS)
32e6d418 426# This is what is made with the host's compiler
427# whether making a cross compiler or not.
79f818d0 428native: config.status cpp $(LANGUAGES) $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2)
32e6d418 429
430# Define the names for selecting languages in LANGUAGES.
431C c: cc1
432C++ c++: cc1plus
433OBJC objc: cc1obj
434OBJECTIVE-C objective-c: cc1obj
435PROTO: proto
436
c6396a0b 437# Really, really stupid make features, such as SUN's KEEP_STATE, may force
438# a target to build even if it is up-to-date. So we must verify that
439# config.status does not exist before failing.
32e6d418 440config.status:
c6396a0b 441 @if [ ! -f config.status ] ; then \
442 echo You must configure gcc. Look at the INSTALL file for details.; \
443 false; \
444 else \
445 true; \
446 fi
32e6d418 447
d7330690 448# Verify that it works to compile and link cross-test.
449# If it does, then there are sufficient replacements for libgcc1.a.
450cross-test: cross-test.o native gcc-cross
451 $(GCC_FOR_TARGET) $(GCC_CFLAGS) cross-test.o -o $@
452cross-test.o: cross-test.c native gcc-cross
453 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -c $(srcdir)/cross-test.c
454
32e6d418 455compilations: ${OBJS}
456
457gcc: gcc.o version.o $(LIBDEPS)
458 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o gccnew gcc.o version.o $(LIBS)
459# Go via `gccnew' to avoid `file busy' if $(CC) is `gcc'.
460 mv -f gccnew gcc
461# Dump a specs file to make -B./ read these specs over installed ones
462 ./gcc -dumpspecs > specs
463
464# We do want to create an executable named `gcc', so we can use it to
465# compile libgcc2.a.
466# Also create gcc-cross, so that install-common will install properly.
467gcc-cross: gcc
468 cp gcc gcc-cross
469
470cc1:$(P) $(C_OBJS) $(OBJS) $(LIBDEPS)
471 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1 $(C_OBJS) $(OBJS) $(LIBS)
472
473cc1plus:$(P) $(CPLUS_OBJS) $(OBJS) $(LIBDEPS)
474 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1plus $(CPLUS_OBJS) $(OBJS) $(LIBS)
475
476cc1obj:$(P) $(OBJC_OBJS) $(OBJS) $(LIBDEPS)
477 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1obj $(OBJC_OBJS) $(OBJS) $(LIBS)
478
479float.h: enquire
480 -./enquire -f > tmp-float.h
481 mv tmp-float.h float.h
482
483# Used to compile enquire with standard cc, but have forgotten why.
484# Let's try with GCC.
485enquire: enquire.o $(GCC_PARTS)
486 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ENQUIRE_LDFLAGS) enquire.o -o $@
487enquire.o: $(srcdir)/enquire.c $(GCC_PASSES)
41f63c60 488 -if [ "$(srcdir)" != "." ]; then rm -f enquire.c; else true; fi
32e6d418 489 -cp $(srcdir)/enquire.c . > /dev/null 2>&1
c6396a0b 490# Breaking this line caused a problem with one version of GNU make.
491 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(ENQUIRE_CFLAGS) -I. -c enquire.c
32e6d418 492\f
493# Build libgcc.a.
494# This is done in two parts because some functions, in libgcc1.c,
495# must be compiled with something other than gcc,
496# while the rest, in libgcc2.c, must be compiled with gcc.
497# That means we can't do libgcc2.c until after gcc, cc1, etc.
498
499# Use this as value of LIBGCC1 to cause conversion to GNU library format.
500# LIBCONVERT should put its output in libgcc1.conv.
501libgcc1.conv: libgcc1.a
502 $(LIBCONVERT) libgcc1.a libgcc1.conv
503
504# Use this as value of LIBGCC1 to inhibit use of libgcc1.c entirely.
505# Make an empty file instead.
506libgcc1.null: $(CROSS_TOOLS) $(GCC_PASSES)
507 echo "__foo () {}" > dummy.c
508 $(GCC_FOR_TARGET) $(GCC_CFLAGS) -c dummy.c
509 $(OLDAR) $(OLDAR_FLAGS) libgcc1.null dummy.o
510 rm -f dummy.o dummy.c
511
512# Compile the library of arithmetic subroutines with the native compiler.
513# Don't compile it with gcc!
514# (That would cause most arithmetic functions to call themselves.)
515libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1FUNCS_EXTRA) config.status
516 -rm -f tmplibgcc1.a
517# Actually build it in tmplibgcc1.a, then rename at end,
518# so that libgcc1.a itself remains nonexistent if compilation is aborted.
519# -e causes any failing command to make this rule fail.
520# -e doesn't work in certain shells, so we test $$? as well.
521 set -e; \
522 for name in $(LIB1FUNCS); \
523 do \
524 echo $${name}; \
525 rm -f $${name}.o; \
526 $(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -c -DL$${name} $(srcdir)/libgcc1.c; \
527 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
528 mv libgcc1.o $${name}.o; \
529 $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}.o; \
530 rm -f $${name}.o; \
531 done
532# Some shells crash when a loop has no items.
533# So make sure there is always at least one--`..'.
534# Then ignore it.
535# We don't use -e here because there are if statements
536# that should not make the command give up when the if condition is false.
537# Instead, we test for failure after each command where it matters.
c6396a0b 538 -for file in .. $(LIB1FUNCS_EXTRA); \
32e6d418 539 do \
540 if [ x$${file} != x.. ]; then \
541 name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
542 echo $${name}; \
543 if [ $${name}.asm = $${file} ]; then \
544 cp $${file} $${name}.s; file=$${name}.s; \
545 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
546 else true; fi; \
547 $(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -c $${file}; \
548 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
549 $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}.o; \
550 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
551 rm -f $${name}.[so]; \
552 else true; \
553 fi; \
554 done
555 mv tmplibgcc1.a libgcc1.a
556
557# Compiling libgcc2.a requires making sure that cc1, etc. have been compiled.
558# But recompiling cc1 should not force recompilation of libgcc2.a.
559# If you want to force recompilation, delete libgcc2.a.
560# Depend on install-cross-tools to make sure we set up properly
561# to run the assembler before we try compiling anything.
562# install-cross-tools does nothing if not cross compiling.
563libgcc2.ready: $(GCC_PASSES) $(CROSS_TOOLS)
564 -if [ -f libgcc2.ready ] ; then \
565 true; \
566 else \
567 touch libgcc2.ready; \
568 fi
569
570libgcc2.a: libgcc2.c libgcc2.ready $(CONFIG_H) $(LIB2FUNCS_EXTRA) \
571 longlong.h gbl-ctors.h config.status
572# Actually build it in tmplibgcc2.a, then rename at end,
573# so that libgcc2.a itself remains nonexistent if compilation is aborted.
574 -rm -f tmplibgcc2.a
575# -e causes any failing command to make this rule fail.
576# -e doesn't work in certain shells, so we test $$? as well.
577 set -e; \
578 for name in $(LIB2FUNCS); \
579 do \
580 echo $${name}; \
c6396a0b 581 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
32e6d418 582 $(srcdir)/libgcc2.c -o $${name}.o; \
583 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
584 $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}.o; \
585 rm -f $${name}.o; \
586 done
587# Some shells crash when a loop has no items.
588# So make sure there is always at least one--`..'.
589# Then ignore it.
590# We don't use -e here because there are if statements
591# that should not make the command give up when the if condition is false.
592# Instead, we test for failure after each command where it matters.
c6396a0b 593 -for file in .. $(LIB2FUNCS_EXTRA); \
32e6d418 594 do \
595 if [ x$${file} != x.. ]; then \
596 name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
597 echo $${name}; \
598 if [ $${name}.asm = $${file} ]; then \
599 cp $${file} $${name}.s; file=$${name}.s; \
600 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
601 else true; fi; \
c6396a0b 602 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
32e6d418 603 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
604 $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}.o; \
605 rm -f $${name}.[so]; \
606 else true; \
607 fi; \
608 done
609 mv tmplibgcc2.a libgcc2.a
610# These lines were deleted from above the mv command
611# because ranlibing libgcc.a itself should suffice.
612# -if [ x${HPUX_GAS} = x ] ; then \
613# if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc2.a; else true; fi \
614# else true; fi
615
616# Combine the various libraries into a single library, libgcc.a.
617libgcc.a: $(LIBGCC1) $(LIBGCC2)
618 -rm -rf tmplibgcc.a libgcc.a tmpcopy
619 mkdir tmpcopy
c6396a0b 620 -if [ x$(LIBGCC1) != x ]; \
621 then (cd tmpcopy; $(AR) x ../$(LIBGCC1)); \
622 else true; \
623 fi
32e6d418 624 (cd tmpcopy; $(AR) x ../$(LIBGCC2))
625 (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *.o)
626 rm -rf tmpcopy
627 -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi
628# Actually build it in tmplibgcc.a, then rename at end,
629# so that libgcc.a itself remains nonexistent if compilation is aborted.
630 mv tmplibgcc.a libgcc.a
631
632
633# Compile two additional files that are linked with every program
634# linked using GCC on system V, for the sake of C++ constructors.
635crtbegin.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h
636 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) -DCRT_BEGIN \
c6396a0b 637 -finhibit-size-directive -g0 -c $(srcdir)/crtstuff.c -o crtbegin.o
32e6d418 638
639crtend.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h
640 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) -DCRT_END \
c6396a0b 641 -finhibit-size-directive -g0 -c $(srcdir)/crtstuff.c -o crtend.o
32e6d418 642\f
643# Compiling object files from source files.
644
645# Note that dependencies on obstack.h are not written
646# because that file is not part of GCC.
647# Dependencies on gvarargs.h are not written
648# because all that file does, when not compiling with GCC,
649# is include the system varargs.h.
650
651# C language specific files.
652
653c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h c-tree.h input.h flags.h
654 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
655$(srcdir)/c-parse.c $(srcdir)/c-parse.h: $(srcdir)/c-parse.y
656 cd $(srcdir); $(BISON) $(BISONFLAGS) -d c-parse.y -o c-parse.c
657
658c-decl.o : c-decl.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h
659c-typeck.o : c-typeck.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h
660c-lang.o : c-lang.c $(CONFIG_H) $(TREE_H)
661c-lex.o : c-lex.c $(CONFIG_H) $(TREE_H) c-lex.h c-tree.h c-parse.h \
662 input.h flags.h
663c-aux-info.o : c-aux-info.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h
664c-convert.o : c-convert.c $(CONFIG_H) $(TREE_H) flags.h
665
666# C++ language specific files.
667
668cp-parse.o : $(srcdir)/cp-parse.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
669 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
670 `echo $(srcdir)/cp-parse.c | sed 's,^\./,,'`
671
672$(srcdir)/cp-parse.c $(srcdir)/cp-parse.h : $(srcdir)/cp-parse.y
ab866dde 673 @echo expect 30 shift/reduce conflicts and 14 reduce/reduce conflicts
32e6d418 674 cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o cp-parse.c cp-parse.y
675
676cp-spew.o : cp-spew.c $(CONFIG_H) $(CPLUS_TREE_H) \
677 $(srcdir)/cp-parse.h flags.h
678cp-lex.o : cp-lex.c $(CONFIG_H) $(CPLUS_TREE_H) \
679 $(srcdir)/cp-parse.h $(srcdir)/cp-input.c flags.h
680cp-decl.o : cp-decl.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h \
681 cp-lex.h cp-decl.h stack.h
682cp-decl2.o : cp-decl2.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h \
683 cp-lex.h cp-decl.h
684cp-type2.o : cp-type2.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
685cp-typeck.o : cp-typeck.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
686cp-class.o : cp-class.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h \
687 cp-class.h flags.h
688cp-call.o : cp-call.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h cp-class.h \
689 flags.h
690cp-init.o : cp-init.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
691cp-method.o : cp-method.c $(CONFIG_H) $(CPLUS_TREE_H)
692cp-cvt.o : cp-cvt.c $(CONFIG_H) $(CPLUS_TREE_H)
693cp-search.o : cp-search.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h flags.h
694cp-tree.o : cp-tree.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
695cp-ptree.o : cp-ptree.c $(CONFIG_H) $(CPLUS_TREE_H)
696cp-gc.o : cp-gc.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
697cp-except.o : cp-except.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
698cp-expr.o : cp-expr.c $(CONFIG_H) $(CPLUS_TREE_H) $(RTL_H) flags.h \
699 expr.h insn-codes.h
700cp-edsel.o : cp-edsel.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h flags.h
701cp-xref.o : cp-xref.c $(CONFIG_H) $(CPLUS_TREE_H)
702cp-pt.o : cp-pt.c $(CONFIG_H) $(CPLUS_TREE_H) cp-decl.h cp-parse.h
703
79f818d0 704# To make a configuration always use collect2, set USE_COLLECT2 to ld.
705ld: collect2
706 rm -f ld
707 ln collect2 ld
708
32e6d418 709collect2 : collect2.o version.o $(LIBDEPS)
710 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o collect2 collect2.o version.o $(LIBS)
711
712collect2.o : collect2.c $(CONFIG_H) gstab.h
79f818d0 713 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
714 -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
715 -DSTANDARD_BIN_PREFIX=\"$(bindir)/\" \
716 -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
717 -DDEFAULT_TARGET_MACHINE=\"$(target)\" \
718 -c `echo $(srcdir)/collect2.c | sed 's,^\./,,'`
32e6d418 719
720# Objectionable C language specific files.
721
722objc-parse.o : $(srcdir)/objc-parse.c $(CONFIG_H) $(TREE_H) c-lex.h \
723 c-tree.h input.h flags.h objc-actions.h
724 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/objc-parse.c
725$(srcdir)/objc-parse.c : $(srcdir)/objc-parse.y
726 cd $(srcdir); $(BISON) $(BISONFLAGS) objc-parse.y -o objc-parse.c
727
728objc-actions.o : objc-actions.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h \
729 flags.h objc-actions.h
730
731# A file used by all variants of C.
732
733c-common.o : c-common.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h
734
735# Language-independent files.
736
737gcc.o: gcc.c $(CONFIG_H) gvarargs.h obstack.h
738 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
739 -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
c6396a0b 740 -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
32e6d418 741 -DDEFAULT_TARGET_MACHINE=\"$(target)\" \
742 -c `echo $(srcdir)/gcc.c | sed 's,^\./,,'`
743
744dumpvers: dumpvers.c
745
746version.o: version.c
747obstack.o: obstack.c
748
749tree.o : tree.c $(CONFIG_H) $(TREE_H) gvarargs.h flags.h function.h
750print-tree.o : print-tree.c $(CONFIG_H) $(TREE_H)
751stor-layout.o : stor-layout.c $(CONFIG_H) $(TREE_H) function.h
752fold-const.o : fold-const.c $(CONFIG_H) $(TREE_H) flags.h
c6396a0b 753toplev.o : toplev.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h input.h \
79f818d0 754 insn-attr.h xcoffout.h
755 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
756 $(MAYBE_USE_COLLECT2) -c `echo $(srcdir)/toplev.c | sed 's,^\./,,'`
32e6d418 757
758rtl.o : rtl.c $(CONFIG_H) $(RTL_H)
759
760print-rtl.o : print-rtl.c $(CONFIG_H) $(RTL_H)
761rtlanal.o : rtlanal.c $(CONFIG_H) $(RTL_H)
762
41f63c60 763varasm.o : varasm.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h defaults.h \
79f818d0 764 insn-codes.h expr.h hard-reg-set.h regs.h xcoffout.h
32e6d418 765function.o : function.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h \
766 insn-flags.h insn-codes.h expr.h regs.h hard-reg-set.h insn-config.h \
767 recog.h output.h
768stmt.o : stmt.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h \
769 insn-flags.h insn-config.h insn-codes.h hard-reg-set.h expr.h loop.h recog.h
770expr.o : expr.c $(CONFIG_H) $(RTL_H) $(TREE_H) gvarargs.h flags.h function.h \
771 insn-flags.h insn-codes.h expr.h insn-config.h recog.h output.h typeclass.h
772calls.o : calls.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h insn-codes.h \
773 insn-flags.h
774expmed.o : expmed.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
775 insn-flags.h insn-config.h insn-codes.h expr.h recog.h real.h
776explow.o : explow.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h hard-reg-set.h \
777 insn-config.h expr.h recog.h insn-flags.h insn-codes.h
778optabs.o : optabs.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
779 insn-flags.h insn-config.h insn-codes.h expr.h recog.h
780dbxout.o : dbxout.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h regs.h \
79f818d0 781 insn-config.h reload.h gstab.h xcoffout.h
32e6d418 782sdbout.o : sdbout.c $(CONFIG_H) $(TREE_H) $(RTL_H) gsyms.h flags.h \
783 insn-config.h reload.h
784dwarfout.o : dwarfout.c $(CONFIG_H) $(TREE_H) $(RTL_H) dwarf.h flags.h \
785 insn-config.h reload.h output.h
79f818d0 786xcoffout.o : xcoffout.c $(CONFIG_H) $(TREE_H) $(RTL_H) xcoffout.h flags.h
32e6d418 787emit-rtl.o : emit-rtl.c $(CONFIG_H) $(RTL_H) flags.h gvarargs.h function.h \
788 regs.h insn-config.h insn-codes.h real.h expr.h
c6396a0b 789getpwd.o : getpwd.c $(CONFIG_H)
32e6d418 790
791integrate.o : integrate.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h integrate.h \
792 insn-flags.h insn-config.h insn-codes.h expr.h real.h function.h
793
794jump.o : jump.c $(CONFIG_H) $(RTL_H) flags.h hard-reg-set.h regs.h \
795 insn-config.h insn-flags.h insn-codes.h expr.h real.h
796stupid.o : stupid.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h
797
798cse.o : cse.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h real.h \
799 insn-config.h recog.h
800loop.o : loop.c $(CONFIG_H) $(RTL_H) flags.h loop.h insn-config.h \
801 insn-flags.h insn-codes.h regs.h hard-reg-set.h recog.h expr.h real.h
802unroll.o : unroll.c $(CONFIG_H) $(RTL_H) insn-config.h insn-codes.h \
803 integrate.h regs.h flags.h expr.h loop.h
804flow.o : flow.c $(CONFIG_H) $(RTL_H) flags.h insn-config.h \
805 basic-block.h regs.h hard-reg-set.h output.h
806combine.o : combine.c $(CONFIG_H) $(RTL_H) gvarargs.h flags.h \
807 insn-config.h insn-flags.h insn-codes.h insn-attr.h regs.h expr.h \
808 basic-block.h recog.h real.h
809regclass.o : regclass.c $(CONFIG_H) $(RTL_H) hard-reg-set.h flags.h \
810 basic-block.h regs.h insn-config.h recog.h
811local-alloc.o : local-alloc.c $(CONFIG_H) $(RTL_H) flags.h basic-block.h \
812 regs.h hard-reg-set.h insn-config.h recog.h output.h
813global-alloc.o : global-alloc.c $(CONFIG_H) $(RTL_H) flags.h \
814 basic-block.h regs.h hard-reg-set.h insn-config.h output.h
815
816reload.o : reload.c $(CONFIG_H) $(RTL_H) flags.h \
817 reload.h recog.h hard-reg-set.h insn-config.h insn-codes.h regs.h real.h
818reload1.o : reload1.c $(CONFIG_H) $(RTL_H) flags.h expr.h \
819 reload.h regs.h hard-reg-set.h insn-config.h insn-flags.h insn-codes.h \
820 basic-block.h recog.h output.h
821caller-save.o : caller-save.c $(CONFIG_H) $(RTL_H) flags.h \
822 regs.h hard-reg-set.h insn-config.h basic-block.h recog.h reload.h expr.h
823reorg.o : reorg.c $(CONFIG_H) $(RTL_H) conditions.h hard-reg-set.h \
824 basic-block.h regs.h insn-config.h insn-attr.h insn-flags.h recog.h \
825 flags.h output.h
826sched.o : sched.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h hard-reg-set.h \
827 flags.h insn-config.h insn-attr.h
828final.o : final.c $(CONFIG_H) $(RTL_H) gvarargs.h flags.h regs.h \
829 recog.h conditions.h insn-config.h insn-attr.h real.h output.h \
79f818d0 830 hard-reg-set.h insn-codes.h gstab.h xcoffout.h
32e6d418 831recog.o : recog.c $(CONFIG_H) $(RTL_H) \
832 regs.h recog.h hard-reg-set.h flags.h insn-config.h insn-attr.h \
833 insn-flags.h insn-codes.h real.h
834reg-stack.o : reg-stack.c $(CONFIG_H) $(RTL_H) $(TREE_H) \
835 regs.h hard-reg-set.h flags.h insn-config.h
48c6936b 836
32e6d418 837aux-output.o : aux-output.c $(CONFIG_H) \
838 $(RTL_H) regs.h hard-reg-set.h real.h insn-config.h conditions.h \
839 insn-flags.h output.h insn-attr.h insn-codes.h
840
841# Normally this target is not used; but it is used if you
842# define ALLOCA=alloca.o. In that case, you must get a suitable alloca.c
843# from the GNU Emacs distribution.
844# Note some machines won't allow $(CC) without -S on this source file.
845alloca.o: alloca.c
846# sed is used to strip the comments from the assembler output.
847 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ALLOCA_FLAGS) \
848 `echo $(srcdir)/alloca.c | sed 's,^\./,,'`
849 $(ALLOCA_FINISH)
79f818d0 850 -rm alloca.s
32e6d418 851\f
852# Generate header and source files from the machine description,
853# and compile them.
854
855.PRECIOUS: insn-config.h insn-flags.h insn-codes.h \
856 insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \
857 insn-attr.h insn-attrtab.c
858
859# The following pair of rules has this effect:
860# genconfig is run only if the md has changed since genconfig was last run;
861# but the file insn-config.h is touched only when its contents actually change.
862
863# Each of the other insn-* files is handled by a similar pair of rules.
864
865# Each of the insn-*.[ch] rules has a semicolon at the end,
866# for otherwise the system Make on SunOS 4.1 never tries
867# to recompile insn-*.o.
868
869insn-config.h: stamp-config ;
870stamp-config : md genconfig $(srcdir)/move-if-change
871 ./genconfig md > tmp-config.h
872 $(srcdir)/move-if-change tmp-config.h insn-config.h
873 touch stamp-config
874
875insn-flags.h: stamp-flags ;
876stamp-flags : md genflags $(srcdir)/move-if-change
877 ./genflags md > tmp-flags.h
878 $(srcdir)/move-if-change tmp-flags.h insn-flags.h
879 touch stamp-flags
880
881insn-codes.h: stamp-codes ;
882stamp-codes : md gencodes $(srcdir)/move-if-change
883 ./gencodes md > tmp-codes.h
884 $(srcdir)/move-if-change tmp-codes.h insn-codes.h
885 touch stamp-codes
886
887insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) expr.h real.h output.h \
888 insn-config.h insn-flags.h insn-codes.h
889 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c
890
891insn-emit.c: stamp-emit ;
892stamp-emit : md genemit $(srcdir)/move-if-change
893 ./genemit md > tmp-emit.c
894 $(srcdir)/move-if-change tmp-emit.c insn-emit.c
895 touch stamp-emit
896
897insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h recog.h \
898 real.h output.h flags.h
899 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c
900
901insn-recog.c: stamp-recog ;
902stamp-recog : md genrecog $(srcdir)/move-if-change
903 ./genrecog md > tmp-recog.c
904 $(srcdir)/move-if-change tmp-recog.c insn-recog.c
905 touch stamp-recog
906
907insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H)
908 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-extract.c
909
910insn-extract.c: stamp-extract ;
911stamp-extract : md genextract $(srcdir)/move-if-change
912 ./genextract md > tmp-extract.c
913 $(srcdir)/move-if-change tmp-extract.c insn-extract.c
914 touch stamp-extract
915
916insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) regs.h output.h real.h
917 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c
918
919insn-peep.c: stamp-peep ;
920stamp-peep : md genpeep $(srcdir)/move-if-change
921 ./genpeep md > tmp-peep.c
922 $(srcdir)/move-if-change tmp-peep.c insn-peep.c
923 touch stamp-peep
924
925insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(RTL_H) regs.h real.h output.h \
926 insn-attr.h insn-config.h
927 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c
928
929insn-attr.h: stamp-attr ;
930stamp-attr : md genattr $(srcdir)/move-if-change
931 ./genattr md > tmp-attr.h
932 $(srcdir)/move-if-change tmp-attr.h insn-attr.h
933 touch stamp-attr
934
935insn-attrtab.c: stamp-attrtab ;
936stamp-attrtab : md genattrtab $(srcdir)/move-if-change
8bd8ea06 937 if cmp -s $(PREMADE_ATTRTAB_MD) md; \
938 then \
939 echo Using $(PREMADE_ATTRTAB); \
ab866dde 940 cp $(PREMADE_ATTRTAB) tmp-attrtab.c; \
8bd8ea06 941 else \
942 ./genattrtab md > tmp-attrtab.c; \
943 fi
32e6d418 944 $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
945 touch stamp-attrtab
946
947insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) regs.h real.h conditions.h \
948 hard-reg-set.h insn-config.h insn-flags.h insn-attr.h output.h recog.h \
949 insn-codes.h
950 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c
951
952insn-output.c: stamp-output ;
953stamp-output : md genoutput $(srcdir)/move-if-change
954 ./genoutput md > tmp-output.c
955 $(srcdir)/move-if-change tmp-output.c insn-output.c
956 touch stamp-output
957\f
958# Compile the programs that generate insn-* from the machine description.
959# They are compiled with $(HOST_CC), and associated libraries,
960# since they need to run on this machine
961# even if GCC is being compiled to run on some other machine.
962
963# $(CONFIG_H) is omitted from the deps of the gen*.o
964# because these programs don't really depend on anything
965# about the target machine. They do depend on config.h itself,
966# since that describes the host machine.
967
968genconfig : genconfig.o $(HOST_RTL) $(HOST_LIBDEPS)
969 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genconfig \
970 genconfig.o $(HOST_RTL) $(HOST_LIBS)
971
972genconfig.o : genconfig.c $(RTL_H) config.h
973 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c
974
975genflags : genflags.o $(HOST_RTL) $(HOST_LIBDEPS)
976 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genflags \
977 genflags.o $(HOST_RTL) $(HOST_LIBS)
978
979genflags.o : genflags.c $(RTL_H) config.h
980 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c
981
982gencodes : gencodes.o $(HOST_RTL) $(HOST_LIBDEPS)
983 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o gencodes \
984 gencodes.o $(HOST_RTL) $(HOST_LIBS)
985
986gencodes.o : gencodes.c $(RTL_H) config.h
987 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c
988
989genemit : genemit.o $(HOST_RTL) $(HOST_LIBDEPS)
990 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genemit \
991 genemit.o $(HOST_RTL) $(HOST_LIBS)
992
993genemit.o : genemit.c $(RTL_H) config.h
994 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c
995
996genrecog : genrecog.o $(HOST_RTL) $(HOST_LIBDEPS)
997 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genrecog \
998 genrecog.o $(HOST_RTL) $(HOST_LIBS)
999
1000genrecog.o : genrecog.c $(RTL_H) config.h
1001 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c
1002
1003genextract : genextract.o $(HOST_RTL) $(HOST_LIBDEPS)
1004 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genextract \
1005 genextract.o $(HOST_RTL) $(HOST_LIBS)
1006
f4d0a7c3 1007genextract.o : genextract.c $(RTL_H) config.h insn-config.h
32e6d418 1008 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c
1009
1010genpeep : genpeep.o $(HOST_RTL) $(HOST_LIBDEPS)
1011 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genpeep \
1012 genpeep.o $(HOST_RTL) $(HOST_LIBS)
1013
1014genpeep.o : genpeep.c $(RTL_H) config.h
1015 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c
1016
1017genattr : genattr.o $(HOST_RTL) $(HOST_LIBDEPS)
1018 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattr \
1019 genattr.o $(HOST_RTL) $(HOST_LIBS)
1020
1021genattr.o : genattr.c $(RTL_H) config.h
1022 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c
1023
262d46de 1024genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBDEPS)
32e6d418 1025 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattrtab \
262d46de 1026 genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBS)
32e6d418 1027
1028genattrtab.o : genattrtab.c $(RTL_H) config.h insn-config.h
1029 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c
1030
1031genoutput : genoutput.o $(HOST_RTL) $(HOST_LIBDEPS)
1032 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genoutput \
1033 genoutput.o $(HOST_RTL) $(HOST_LIBS)
1034
1035genoutput.o : genoutput.c $(RTL_H) config.h
1036 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c
1037\f
1038# Compile the libraries to be used by gen*.
1039# If we are not cross-building, gen* use the same .o's that cc1 will use,
1040# and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict
1041# with the rules for rtl.o, alloca.o, etc.
1042$(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(CONFIG_H) $(RTL_H)
1043 rm -f $(HOST_PREFIX)rtl.c
1044 cp $(srcdir)/rtl.c $(HOST_PREFIX)rtl.c
1045 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtl.c
1046
262d46de 1047$(HOST_PREFIX_1)print-rtl.o: $(srcdir)/print-rtl.c $(CONFIG_H) $(RTL_H)
1048 rm -f $(HOST_PREFIX)print-rtl.c
1049 cp $(srcdir)/print-rtl.c $(HOST_PREFIX)print-rtl.c
1050 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)print-rtl.c
1051
32e6d418 1052$(HOST_PREFIX_1)rtlanal.o: $(srcdir)/rtlanal.c $(CONFIG_H) $(RTL_H)
1053 rm -f $(HOST_PREFIX)rtlanal.c
1054 cp $(srcdir)/rtlanal.c $(HOST_PREFIX)rtlanal.c
1055 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtlanal.c
1056
1057$(HOST_PREFIX_1)alloca.o: alloca.c
1058 rm -f $(HOST_PREFIX)alloca.c
1059 cp $(srcdir)/alloca.c $(HOST_PREFIX)alloca.c
1060 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c
1061
1062$(HOST_PREFIX_1)obstack.o: obstack.c
1063 rm -f $(HOST_PREFIX)obstack.c
1064 cp $(srcdir)/obstack.c $(HOST_PREFIX)obstack.c
1065 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c
1066
1067$(HOST_PREFIX_1)malloc.o: malloc.c
1068 rm -f $(HOST_PREFIX)malloc.c
1069 cp $(srcdir)/malloc.c $(HOST_PREFIX)malloc.c
1070 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)malloc.c
1071
1072# This satisfies the dependency that we get if you cross-compile a compiler
1073# that does not need to compile alloca, malloc or whatever.
1074$(HOST_PREFIX_1):
1075 touch $(HOST_PREFIX_1)
1076\f
1077# Remake cpp and protoize.
1078
1079# Making the preprocessor
1080cpp: cccp
1081 -rm -f cpp
1082 ln cccp cpp
1083cccp: cccp.o cexp.o version.o $(LIBDEPS)
1084 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cccp cccp.o cexp.o version.o $(LIBS)
1085cexp.o: $(srcdir)/cexp.c $(CONFIG_H)
1086 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/cexp.c
1087$(srcdir)/cexp.c: $(srcdir)/cexp.y
1088 cd $(srcdir); $(BISON) -o cexp.c cexp.y
1089cccp.o: cccp.c $(CONFIG_H) pcp.h version.c
1090# The reason we use $(libdir)/g++-include rather than using libsubdir
1091# is for compatibility with the current version of libg++.
1092 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
c6396a0b 1093 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
1094 -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
32e6d418 1095 -DLOCAL_INCLUDE_DIR=\"$(prefix)/include\" \
c6396a0b 1096 -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
32e6d418 1097 -c `echo $(srcdir)/cccp.c | sed 's,^\./,,'`
1098
1099proto: config.status protoize unprotoize SYSCALLS.c.X protoize.1 unprotoize.1
1100
c6396a0b 1101protoize: protoize.o getopt.o getopt1.o getpwd.o version.o $(LIBDEPS)
32e6d418 1102 $(CC) $(ALL_CFLAGS) $(LDFLAGS) \
c6396a0b 1103 protoize.o getopt.o getopt1.o getpwd.o version.o $(LIBS) -o $@
ab866dde 1104protoize.o: stamp-proto ;
1105
1106unprotoize: unprotoize.o getopt.o getopt1.o getpwd.o version.o $(LIBDEPS)
1107 $(CC) $(ALL_CFLAGS) $(LDFLAGS) \
1108 unprotoize.o getopt.o getopt1.o getpwd.o version.o $(LIBS) -o $@
1109unprotoize.o: stamp-proto ;
1110
1111stamp-proto: $(srcdir)/protoize.c getopt.h $(CONFIG_H)
1112 touch stamp-proto
32e6d418 1113 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1114 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
c6396a0b 1115 -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
32e6d418 1116 -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
1117 -DLOCAL_INCLUDE_DIR=\"$(prefix)/include\" \
1118 -DSTD_PROTO_DIR=\"$(libsubdir)\" \
ab866dde 1119 -DUNPROTOIZE $(srcdir)/protoize.c
1120 mv protoize.o unprotoize.o
32e6d418 1121 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1122 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
c6396a0b 1123 -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
32e6d418 1124 -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
1125 -DLOCAL_INCLUDE_DIR=\"$(prefix)/include\" \
1126 -DSTD_PROTO_DIR=\"$(libsubdir)\" \
ab866dde 1127 $(srcdir)/protoize.c
32e6d418 1128
1129getopt.o: $(srcdir)/getopt.c getopt.h
1130 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt.c
1131getopt1.o: $(srcdir)/getopt1.c getopt.h
1132 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt1.c
1133
1134protoize.1: $(srcdir)/proto-man ./cpp
1135 ./cpp -traditional $(srcdir)/proto-man \
1136 | grep -v '^#' \
c6396a0b 1137 | awk 'NF > 0 {print}' > tmp-proto.1
1138 mv tmp-proto.1 protoize.1
32e6d418 1139
1140unprotoize.1: $(srcdir)/proto-man ./cpp
1141 ./cpp -traditional -DUNPRO $(srcdir)/proto-man \
1142 | grep -v '^#' \
c6396a0b 1143 | awk 'NF > 0 {print}' > tmp-unproto.1
1144 mv tmp-unproto.1 unprotoize.1
1145
32e6d418 1146# This info describes the target machine, so compile with GCC just built.
79f818d0 1147SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES)
1148 -rm -f SYSCALLS.c
1149 cat $(srcdir)/sys-types.h $(srcdir)/sys-protos.h > SYSCALLS.c
32e6d418 1150 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
79f818d0 1151 -aux-info $@ -S -o /dev/null SYSCALLS.c
1152 -rm -f SYSCALLS.c
0b20f012 1153
1154test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES)
c548e550 1155 -rm -f tmp-proto.[cso]
262d46de 1156 cp $(srcdir)/protoize.c tmp-proto.c
1157 chmod u+w tmp-proto.c
c548e550 1158 ./protoize -N -B ./ -x getopt.h -c "-B./ -Wall -Wwrite-strings \
1159 $(CFLAGS) $(INCLUDES) \
0b20f012 1160 -DGCC_INCLUDE_DIR=0 \
1161 -DGPLUSPLUS_INCLUDE_DIR=0 \
1162 -DCROSS_INCLUDE_DIR=0 \
262d46de 1163 -DSTD_PROTO_DIR=0" tmp-proto.c
c548e550 1164 @echo '**********' Expect 402 lines of differences.
1165 -diff $(srcdir)/protoize.c tmp-proto.c > tmp-proto.diff
1166 -wc -l tmp-proto.diff
1167 ./unprotoize -N -x getopt.h -c "-B./ -Wall -Wwrite-strings \
1168 $(CFLAGS) $(INCLUDES) \
0b20f012 1169 -DGCC_INCLUDE_DIR=0 \
1170 -DGPLUSPLUS_INCLUDE_DIR=0 \
1171 -DCROSS_INCLUDE_DIR=0 \
262d46de 1172 -DSTD_PROTO_DIR=0" tmp-proto.c
0b20f012 1173 @echo Expect zero differences.
262d46de 1174 diff $(srcdir)/protoize.c tmp-proto.c | cat
c548e550 1175 -rm -f tmp-proto.[cso]
32e6d418 1176\f
1177# Remake the info files.
1178
630c76ba 1179doc: $(srcdir)/cpp.info $(srcdir)/gcc.info $(srcdir)/INSTALL
32e6d418 1180
630c76ba 1181$(srcdir)/cpp.info: cpp.texi
32e6d418 1182 makeinfo `echo $(srcdir)/cpp.texi | sed 's,^\./,,'`
1183
630c76ba 1184#$(srcdir)/gplus.info: gplus.texi
79f818d0 1185# makeinfo `echo $(srcdir)/gplus.texi | sed 's,^\./,,'`
32e6d418 1186
630c76ba 1187$(srcdir)/gcc.info: gcc.texi extend.texi install.texi invoke.texi \
1188 md.texi rtl.texi tm.texi
32e6d418 1189 makeinfo `echo $(srcdir)/gcc.texi | sed 's,^\./,,'`
630c76ba 1190
1191$(srcdir)/INSTALL: install1.texi install.texi
1192 makeinfo --no-header `echo $(srcdir)/install1.texi | sed 's,^\./,,'`
32e6d418 1193\f
1194# Deletion of files made during compilation.
1195# There are four levels of this:
79f818d0 1196# `mostlyclean', `clean', `distclean' and `realclean'.
32e6d418 1197# `mostlyclean' is useful while working on a particular type of machine.
c6396a0b 1198# It deletes most, but not all, of the files made by compilation.
32e6d418 1199# It does not delete libgcc.a or its parts, so it won't have to be recompiled.
c6396a0b 1200# `clean' deletes everything made by running `make all'.
79f818d0 1201# `distclean' also deletes the files made by config.
32e6d418 1202# `realclean' also deletes everything that could be regenerated automatically.
1203
79f818d0 1204
32e6d418 1205mostlyclean:
1206 -rm -f $(STAGESTUFF)
1207# Delete the temporary source copies for cross compilation.
1208 -rm -f $(HOST_PREFIX_1)rtl.c $(HOST_PREFIX_1)rtlanal.c
1209 -rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c
1210 -rm -f $(HOST_PREFIX_1)obstack.c
1211# Delete the temp files made in the course of building libgcc.a.
c6396a0b 1212 -rm -f tmplibgcc* tmpcopy
32e6d418 1213 for name in $(LIB1FUNCS); do rm -f $${name}.c; done
1214# Delete other temporary files.
c548e550 1215 -rm -f tmp-float.h tmp-gcc.xtar.Z tmp-limits.h gccnew
1216 -rm -f tmp-foo1 tmp-foo2 tmp-proto.*
32e6d418 1217# Delete the stamp files.
1218 -rm -f stamp-* tmp-*
c6396a0b 1219# Delete debugging dump files.
32e6d418 1220 -rm -f *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop
c6396a0b 1221 -rm -f *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack
1222# Delete some files made during installation.
1223 -rm -f specs float.h enquire SYSCALLS.c SYSCALLS.c.X
79f818d0 1224 -rm -f collect collect2 ld mips-tfile mips-tdump alloca.s
c6396a0b 1225# Delete unwanted output files from TeX.
1226 -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
79f818d0 1227# Delete sorted indices we don't actually use.
1228 -rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns
c6396a0b 1229# Delete core dumps.
1230 -rm -f core
32e6d418 1231
79f818d0 1232# Delete all files made by compilation
1233# that don't exist in the distribution.
32e6d418 1234clean: mostlyclean
8bd8ea06 1235# It may not be quite desirable to delete unprotoize.c here,
1236# but the spec for `make clean' requires it.
1237# Using unprotoize.c is not quite right in the first place,
1238# but what better way is there?
1239 -rm -f libgcc.a libgcc1.a libgcc2.a libgcc2.ready unprotoize.c
d7330690 1240 -rm -f *.dvi
32e6d418 1241
79f818d0 1242# Delete all files that users would normally create
1243# while building and installing GCC.
c6396a0b 1244distclean: clean
32e6d418 1245 -rm -f tm.h aux-output.c config.h md config.status tconfig.h
ab866dde 1246 -rm -f Makefile *.oaux
79f818d0 1247 -rm -fr stage1 stage2 stage3 stage4
c6396a0b 1248
1249# Delete anything likely to be found in the source directory
1250# that shouldn't be in the distribution.
1251extraclean: distclean
79f818d0 1252 -rm -rf =* #* *~* config/=* config/#* config/*~*
1253 -rm -f *.dvi *.oaux patch* config/patch* *.orig *.rej *.d *.Z *.tar
630c76ba 1254 -rm -f *.s *.s[0-9] *.i install1.texi
32e6d418 1255
1256# Get rid of every file that's generated from some other file.
1257# Most of these files ARE PRESENT in the GCC distribution.
c6396a0b 1258realclean: distclean
32e6d418 1259 -rm -f cp-parse.c cp-parse.h cp-parse.output
1260 -rm -f objc-parse.c objc-parse.output
1261 -rm -f protoize.1 unprotoize.1
1262 -rm -f c-parse.c c-parse.h c-parse.output
1263 -rm -f cexp.c cexp.output TAGS
c6396a0b 1264 -rm -f cpp.info* cpp.??s cpp.*aux
1265 -rm -f gcc.info* gcc.??s gcc.*aux
1266 -rm -f gplus.info* gplus.??s gplus.*aux
32e6d418 1267\f
1268# Entry points `install' and `uninstall'.
1269# Also temporarily `install-fixincludes' could replace `install-headers'.
c6396a0b 1270# Also use `install-collect2' to install collect2 when the config files don't.
32e6d418 1271
1272install: $(INSTALL_TARGET)
1273
1274# Copy the files of native compiler into directories where they will be run.
1275install-native: install-common install-libgcc $(INSTALL_HEADERS) \
c6396a0b 1276 install-man
32e6d418 1277
1278# Copy the files of cross compiler into directories where they will be run.
1279install-cross: install-common install-common-headers \
1280 install-man install-cross-tools install-libgcc
1281
1282# Install the tools, libraries and header files for the target machine
1283# where cross-compilation will look for them.
1284# Use tooldir to find them.
1285install-cross-tools: install-dir
1286# The first if makes this a no-op except for a cross compiler.
1287# The /. after the dirname causes test to follow symlinks.
1288# Before making a link or an indirection script,
1289# we verify the desired file does not already exist.
1290# If a symlink does exist, then making a symlink would certainly fail,
1291# leading us to overwrite the real file through the symlink.
1292 -if [ -f gcc-cross ] ; \
1293 then \
1294 if [ -d $(tooldir)/. ] ; \
1295 then \
1296 for file in as ld ar ranlib; do \
1297 if [ -f $(libsubdir)/$$file ] ; \
1298 then true; \
1299 else \
1300 $(SYMLINK) $(tooldir)/bin/$$file $(libsubdir)/$$file \
1301 || (echo "#!/bin/sh"; echo $(tooldir)/bin/$$file "$$@") > $(libsubdir)/$$file; \
1302 fi; \
1303 done; \
1304 for file in $(tooldir)/lib/*; do \
1305 if [ -f $$file ] ; \
1306 then \
1307 if [ -f $(libsubdir)/`basename $$file` ] ; \
1308 then true; \
1309 else \
1310 $(SYMLINK) $$file $(libsubdir)/`basename $$file` \
1311 || $(INSTALL_DATA) $$file $(libsubdir)/`basename $$file`; \
1312 fi; \
1313 else true; \
1314 fi; \
1315 done; \
1316 if [ -d $(tooldir)/include/. ] ; then \
1317 $(SYMLINK) $(tooldir)/include $(libsubdir)/sys-include \
1318 || (if [ -d $(libsubdir)/sys-include ] ; then true ; else mkdir $(libsubdir)/sys-include ; fi; \
1319 cd $(tooldir)/include; tar cf - . | (cd $(libsubdir)/sys-include; tar xpf -)); \
1320 else true; fi; \
1321 else true; \
1322 fi; \
1323 else true; \
1324 fi;
1325
1326# Run this on the target machine
1327# to finish installation of cross compiler.
1328install-cross-rest: install-float-h-cross
1329
1330# Install float.h for cross compiler.
1331# Run this on the target machine!
1332install-float-h-cross:
1333 if [ -f enquire ] ; then true; else false; done
1334 -./enquire -f > float.h
1335 -rm -f $(libsubdir)/include/float.h
1336 $(INSTALL_DATA) float.h $(libsubdir)/include/float.h
1337 chmod a-x $(libsubdir)/include/float.h
1338
1339# Create the installation directory.
1340install-dir:
2388f67d 1341 -if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; fi
1342 -if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib ; fi
1343 -if [ -d $(libdir)/gcc-lib/include ] ; then true ; else mkdir $(libdir)/gcc-lib/include ; fi
1344 -if [ -d $(libdir)/gcc-lib/$(target) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target) ; fi
1345 -if [ -d $(libdir)/gcc-lib/$(target)/$(version) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target)/$(version) ; fi
630c76ba 1346 -if [ -d $(libdir)/gcc-lib/$(target)/$(version)/include ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target)/$(version)/include ; fi
2388f67d 1347 -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; fi
32e6d418 1348# We don't use mkdir -p to create the parents of mandir,
1349# because some systems don't support it.
1350# Instead, we use this technique to create the immediate parent of mandir.
2388f67d 1351 -parent=`echo $(mandir)|sed -e 's@/[^/]*$$@@'`; \
32e6d418 1352 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
1353 -if [ -d $(mandir) ] ; then true ; else mkdir $(mandir) ; fi
1354
1355# Install the compiler executables built during cross compilation.
1356install-common: native install-dir
1357 for file in $(COMPILERS); do \
1358 if [ -f $$file ] ; then \
1359 rm -f $(libsubdir)/$$file; \
1360 $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
1361 else true; \
1362 fi; \
1363 done
79f818d0 1364 for file in $(EXTRA_PASSES) $(EXTRA_PARTS) $(EXTRA_PROGRAMS) $(USE_COLLECT2) ..; do \
32e6d418 1365 if [ x"$$file" != x.. ]; then \
1366 rm -f $(libsubdir)/$$file; \
1367 $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
1368 else true; fi; \
1369 done
1370 -rm -f $(libsubdir)/specs
1371 $(INSTALL_DATA) specs $(libsubdir)/specs
1372# Install the driver program as gcc-$(target)
1373# and also as either gcc (if native) or $(tooldir)/bin/gcc.
1374 -if [ -f gcc-cross ] ; then \
c6396a0b 1375 $(INSTALL_PROGRAM) gcc-cross $(bindir)/gcc-$(target); \
32e6d418 1376 if [ -d $(tooldir)/bin/. ] ; then \
1377 rm -f $(tooldir)/bin/gcc; \
1378 $(INSTALL_PROGRAM) gcc-cross $(tooldir)/bin/gcc; \
32e6d418 1379 else true; fi; \
1380 else \
1381 rm -f $(bindir)/gcc; \
1382 $(INSTALL_PROGRAM) gcc $(bindir)/gcc; \
1383 rm -f $(bindir)/gcc-$(target)-1; \
1384 ln $(bindir)/gcc $(bindir)/gcc-$(target)-1; \
1385 mv $(bindir)/gcc-$(target)-1 $(bindir)/gcc-$(target); \
1386 fi
c548e550 1387 -rm -f $(bindir)/c++
32e6d418 1388 $(INSTALL_PROGRAM) $(srcdir)/c++ $(bindir)/c++
c548e550 1389 -rm -f $(bindir)/g++
32e6d418 1390 $(INSTALL_PROGRAM) $(srcdir)/g++ $(bindir)/g++
1391 -rm -f $(libsubdir)/cpp
1392 $(INSTALL_PROGRAM) cpp $(libsubdir)/cpp
1393
1394# Install protoize.
1395install-proto: proto install-dir
1396 -rm -f $(bindir)/protoize
1397 $(INSTALL_PROGRAM) protoize $(bindir)/protoize
1398 -rm -f $(bindir)/unprotoize
1399 $(INSTALL_PROGRAM) unprotoize $(bindir)/unprotoize
1400 -rm -f $(libsubdir)/SYSCALLS.c.X
1401 $(INSTALL_DATA) SYSCALLS.c.X $(libsubdir)/SYSCALLS.c.X
1402 chmod a-x $(libsubdir)/SYSCALLS.c.X
1403
1404# Install the man pages.
c6396a0b 1405install-man: install-dir $(srcdir)/gcc.1 $(srcdir)/cccp.1 \
1406 protoize.1 unprotoize.1 $(srcdir)/g++.1
32e6d418 1407 -rm -f $(mandir)/gcc$(manext)
ab866dde 1408 -$(INSTALL_DATA) $(srcdir)/gcc.1 $(mandir)/gcc$(manext)
1409 -chmod a-x $(mandir)/gcc$(manext)
c6396a0b 1410 -rm -f $(mandir)/cccp$(manext)
ab866dde 1411 -$(INSTALL_DATA) $(srcdir)/cccp.1 $(mandir)/cccp$(manext)
1412 -chmod a-x $(mandir)/cccp$(manext)
32e6d418 1413 -rm -f $(mandir)/protoize$(manext)
ab866dde 1414 -$(INSTALL_DATA) protoize.1 $(mandir)/protoize$(manext)
1415 -chmod a-x $(mandir)/protoize$(manext)
32e6d418 1416 -rm -f $(mandir)/unprotoize$(manext)
ab866dde 1417 -$(INSTALL_DATA) unprotoize.1 $(mandir)/unprotoize$(manext)
1418 -chmod a-x $(mandir)/unprotoize$(manext)
c6396a0b 1419 -rm -f $(mandir)/g++$(manext)
ab866dde 1420 -$(INSTALL_DATA) $(srcdir)/g++.1 $(mandir)/g++$(manext)
1421 -chmod a-x $(mandir)/g++$(manext)
32e6d418 1422
1423# Install the library.
1424install-libgcc: libgcc.a
1425 -if [ -f libgcc.a ] ; then \
1426 rm -f $(libsubdir)/libgcc.a; \
1427 $(INSTALL_DATA) libgcc.a $(libsubdir)/libgcc.a; \
1428 if $(RANLIB_TEST) ; then \
1429 (cd $(libsubdir); $(RANLIB) libgcc.a); else true; fi; \
1430 chmod a-x $(libsubdir)/libgcc.a; \
1431 else true; fi
1432
1433# Install all the header files for native compiler.
1434install-headers: install-common-headers install-float-h install-limits-h
1435
1436# Install float.h for native compiler.
630c76ba 1437install-float-h: float.h install-dir
32e6d418 1438 -rm -f $(libsubdir)/include/float.h
1439 $(INSTALL_DATA) float.h $(libsubdir)/include/float.h
1440 chmod a-x $(libsubdir)/include/float.h
1441
1442# Install limits.h, optionally inheriting from the standard system version.
630c76ba 1443install-limits-h: limits.h limitx.h install-dir
32e6d418 1444 -rm -f $(libsubdir)/include/limits.h tmp-limits.h
1445 if [ -f /usr/include/limits.h ] ; then \
1446 cat $(srcdir)/limitx.h $(srcdir)/limits.h > tmp-limits.h; \
1447 else \
1448 cat $(srcdir)/limits.h > tmp-limits.h; \
1449 fi
1450 $(INSTALL_DATA) tmp-limits.h $(libsubdir)/include/limits.h
1451 chmod a-x $(libsubdir)/include/limits.h
1452 rm tmp-limits.h
1453
1454# Install the fixed headers that are the same for all machines.
1455install-common-headers: install-dir $(USER_H) gvarargs.h gstdarg.h gstddef.h
2388f67d 1456 -if [ -d $(libsubdir)/include ] ; then true ; else mkdir $(libsubdir)/include ; fi
32e6d418 1457 -chmod ugo+rx $(libsubdir)/include
1458# Must compute $(libsubdir) before the cd; the awk script won't work after.
1459 shelllibsubdir=$(libsubdir); \
1460 cd $(srcdir); \
1461 for file in $(USER_H); do \
1462 rm -f $$shelllibsubdir/include/`basename $$file`; \
1463 $(INSTALL_DATA) `basename $$file` $$shelllibsubdir/include/`basename $$file`; \
1464 chmod a-x $$shelllibsubdir/include/`basename $$file`; \
1465 done
1466 -rm -f $(libsubdir)/include/varargs.h
1467 $(INSTALL_DATA) $(srcdir)/gvarargs.h $(libsubdir)/include/varargs.h
1468 chmod a-x $(libsubdir)/include/varargs.h
1469 -rm -f $(libsubdir)/include/stdarg.h
1470 $(INSTALL_DATA) $(srcdir)/gstdarg.h $(libsubdir)/include/stdarg.h
1471 chmod a-x $(libsubdir)/include/stdarg.h
1472 -rm -f $(libsubdir)/include/stddef.h
1473 $(INSTALL_DATA) $(srcdir)/gstddef.h $(libsubdir)/include/stddef.h
1474 chmod a-x $(libsubdir)/include/stddef.h
c6396a0b 1475# Copy byteorder.h into the object file directory
1476# so that fixinc.svr4 can get at it if necessary.
1477# If the dirs are the same, this won't do anything.
0b20f012 1478# Delete file first in case it is read-only
41f63c60 1479 -if [ "$(srcdir)" != "." ]; then rm -f byteorder.h; else true; fi
1480 -cp $(srcdir)/byteorder.h . > /dev/null 2>&1
32e6d418 1481
1482# $(libsubdir)/include:
2388f67d 1483# -if [ -d $(libsubdir)/include ] ; then true ; else mkdir $(libsubdir)/include ; fi
32e6d418 1484# -chmod ugo+rx $(libsubdir)/include
1485
1486# This appears not to work. It isn't clear how to fix it.
c6396a0b 1487# $(libsubdir)/include/README: $(libsubdir)/include $(srcdir)/$(FIXINCLUDES)
1488# LIB=$(libsubdir)/include $(srcdir)/$(FIXINCLUDES)
32e6d418 1489# $(INSTALL_DATA) $(srcdir)/fixincludes-README $@
1490# chmod a-x $@
1491
1492# Run fixincludes in the proper directory.
1493install-fixincludes: install-headers
1494 rm -rf $(libsubdir)/tmp
1495 mkdir $(libsubdir)/tmp
1496# Move aside the headers that come from GCC; delete all else.
c6396a0b 1497# The sed command gets just the last file name component;
1498# this is necessary because VPATH could add a dirname.
1499# Using basename would be simpler, but some systems don't have it.
1500 cd $(libsubdir)/include; \
1501 for file in $(INSTALLED_H); do \
1502 realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
1503 mv $$realfile ../tmp; \
1504 done; \
1505 rm -rf *
32e6d418 1506# Install fixed copies of system files.
1507 $(srcdir)/$(FIXINCLUDES) $(libsubdir)/include
1508# Bring back gcc's header files.
1509 cd $(libsubdir)/include; mv ../tmp/* .; rmdir ../tmp
1510# Install the README
1511 $(INSTALL_DATA) $(srcdir)/README-fixinc $(libsubdir)/include/README
1512 chmod a-x $(libsubdir)/include/README
1513
c6396a0b 1514# Use this target to install the program `collect2' under the name `ld'.
1515install-collect2: collect2
1516 $(INSTALL_PROGRAM) collect2 $(libsubdir)/ld
1517# Install the driver program as $(libsubdir)/gcc for collect2.
1518 -if [ -f gcc-cross ] ; then \
1519 $(INSTALL_PROGRAM) gcc-cross $(libsubdir)/gcc; \
1520 else \
1521 $(INSTALL_PROGRAM) gcc $(libsubdir)/gcc; \
1522 fi
1523
32e6d418 1524# Cancel installation by deleting the installed files.
1525uninstall:
1526 -rm -rf $(libsubdir)
1527 -rm -rf $(bindir)/gcc
32e6d418 1528 -rm -rf $(bindir)/protoize
1529 -rm -rf $(bindir)/unprotoize
1530 -rm -rf $(mandir)/gcc$(manext)
c6396a0b 1531 -rm -rf $(mandir)/cccp$(manext)
32e6d418 1532 -rm -rf $(mandir)/protoize$(manext)
1533 -rm -rf $(mandir)/unprotoize$(manext)
1534\f
1535# These exist for maintenance purposes.
1536
1537# Update the tags table.
1538TAGS: force
1539 cd $(srcdir); \
1540 mkdir temp; \
1541 mv -f c-parse.c c-parse.h cp-parse.c cp-parse.h objc-parse.c cexp.c temp; \
1542 etags *.y *.h *.c; \
1543 mv temp/* .; \
1544 rmdir temp
1545
1546# Create the distribution tar file.
1547#dist: gcc-$(version).tar.Z
1548dist: gcc.xtar.Z
1549
c6396a0b 1550gcc.xtar.Z: gcc.xtar
32e6d418 1551 compress < gcc.xtar > tmp-gcc.xtar.Z
1552 mv tmp-gcc.xtar.Z gcc.xtar.Z
1553
1554#gcc-$(version).tar.Z: gcc-$(version).tar
1555# compress < gcc-$(version).tar > gcc-$(version).tar.Z
1556
1557#gcc-$(version).tar:
ab866dde 1558gcc.xtar: doc
630c76ba 1559 if grep -s "for version ${version}" gcc.texi; \
1560 then true; \
1561 else echo "You must update the version number in `gcc.texi'"; \
1562 fi
c6396a0b 1563 -rm -rf gcc-$(version) tmp
32e6d418 1564# Put all the files in a temporary subdirectory
1565# which has the name that we want to have in the tar file.
c6396a0b 1566 mkdir tmp
1567 mkdir tmp/config
1568 for file in *[0-9a-zA-Z+]; do \
1569 ln $$file tmp || cp $$file tmp; \
1570 done
1571 cd config; \
1572 for file in *[0-9a-zA-Z+]; do \
1573 ln $$file ../tmp/config || cp $$file ../tmp/config; \
32e6d418 1574 done
c6396a0b 1575 ln .gdbinit tmp
1576 mv tmp gcc-$(version)
32e6d418 1577# Get rid of everything we don't want in the distribution.
c6396a0b 1578 cd gcc-$(version); make -f Makefile.in extraclean
32e6d418 1579# Make the distribution.
1580 tar chf gcc.xtar gcc-$(version)
1581# Get rid of the temporary directory.
1582 rm -rf gcc-$(version)
79f818d0 1583# Update the version number in README
1584 awk '$$1 " " $$2 " " $$3 == "This directory contains" \
1585 { $$6 = version; print $$0 } \
1586 $$1 " " $$2 " " $$3 != "This directory contains"' \
1587 version=$(version) README > tmp.README
1588 mv tmp.README README
32e6d418 1589
1590# do make -f ../gcc/Makefile maketest DIR=../gcc
1591# in the intended test directory to make it a suitable test directory.
1592# THIS IS OBSOLETE; use the -srcdir operand in configure instead.
1593maketest:
1594 ln -s $(DIR)/*.[chy] .
1595 ln -s $(DIR)/configure .
1596 ln -s $(DIR)/*.def .
1597 -rm -f =*
1598 ln -s $(DIR)/.gdbinit .
1599 ln -s $(DIR)/$(FIXINCLUDES) .
1600 -ln -s $(DIR)/bison.simple .
1601 ln -s $(DIR)/config .
1602 ln -s $(DIR)/move-if-change .
1603# The then and else were swapped to avoid a problem on Ultrix.
1604 if [ ! -f Makefile ] ; then ln -s $(DIR)/Makefile .; else false; fi
1605 -rm tm.h aux-output.c config.h md
1606 make clean
1607# You must then run config to set up for compilation.
41f63c60 1608bootstrap: force
1609# Only build the C compiler for stage1, because that is the only one that
1610# we can guarantee will build with the native compiler, and also it is the
1611# only thing useful for building stage2.
1612 $(MAKE) LANGUAGES=c
32e6d418 1613 $(MAKE) stage1
c6396a0b 1614# This used to define ALLOCA as empty, but that would lead to bad results
1615# for a subsequent `make install' since that would not have ALLOCA empty.
1616# To prevent `make install' from compiling alloca.o and then relinking cc1
1617# because alloca.o is newer, we permit these recursive makes to compile
1618# alloca.o. Then cc1 is newer, so it won't have to be relinked.
1619 $(MAKE) CC="stage1/gcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
32e6d418 1620 $(MAKE) stage2
c6396a0b 1621 $(MAKE) CC="stage2/gcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
32e6d418 1622
1623bootstrap2: force
c6396a0b 1624 $(MAKE) CC="stage1/gcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
32e6d418 1625 $(MAKE) stage2
c6396a0b 1626 $(MAKE) CC="stage2/gcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
32e6d418 1627
1628bootstrap3: force
c6396a0b 1629 $(MAKE) CC="stage2/gcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
32e6d418 1630
48c6936b 1631# Compare the object files in the current directory with those in the
1632# stage2 directory.
1633
1634compare: force
1635 for file in *.o; do \
f4d0a7c3 1636 tail +10c $$file > tmp-foo1; \
1637 tail +10c stage2/$$file > tmp-foo2; \
1638 cmp tmp-foo1 tmp-foo2 || echo $$file differs; \
48c6936b 1639 done
1640 -rm -f tmp-foo*
1641
1642# Similar, but compare with stage3 directory
1643compare3: force
1644 for file in *.o; do \
f4d0a7c3 1645 tail +10c $$file > tmp-foo1; \
1646 tail +10c stage3/$$file > tmp-foo2; \
1647 cmp tmp-foo1 tmp-foo2 || echo $$file differs; \
48c6936b 1648 done
1649 -rm -f tmp-foo*
1650
32e6d418 1651# Copy the object files from a particular stage into a subdirectory.
1652stage1: force
c6396a0b 1653 -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
32e6d418 1654 -mv $(STAGESTUFF) stage1
1655 -rm -f stage1/libgcc.a
1656 -cp libgcc.a stage1
1657 -if $(RANLIB_TEST) ; then $(RANLIB) stage1/libgcc.a; else true; fi
1658
1659stage2: force
c6396a0b 1660 -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
32e6d418 1661 -mv $(STAGESTUFF) stage2
1662 -rm -f stage2/libgcc.a
1663 -cp libgcc.a stage2
1664 -if $(RANLIB_TEST) ; then $(RANLIB) stage2/libgcc.a; else true; fi
1665
1666stage3: force
2388f67d 1667 -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
32e6d418 1668 -mv $(STAGESTUFF) stage3
1669 -rm -f stage3/libgcc.a
1670 -cp libgcc.a stage3
1671 -if $(RANLIB_TEST) ; then $(RANLIB) stage3/libgcc.a; else true; fi
1672
1673stage4: force
2388f67d 1674 -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
32e6d418 1675 -mv $(STAGESTUFF) stage4
1676 -rm -f stage4/libgcc.a
1677 -cp libgcc.a stage4
1678 -if $(RANLIB_TEST) ; then $(RANLIB) stage4/libgcc.a; else true; fi
1679
1680# Copy just the executable files from a particular stage into a subdirectory,
1681# and delete the object files. Use this if you're just verifying a version
1682# that is pretty sure to work, and you are short of disk space.
1683risky-stage1: force
2388f67d 1684 -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
32e6d418 1685 -mv cc1 cpp cccp gcc stage1
1686 -rm -f stage1/libgcc.a
1687 -cp libgcc.a stage1 && $(RANLIB) stage1/libgcc.a
1688 -make clean
1689
1690risky-stage2: force
2388f67d 1691 -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
32e6d418 1692 -mv cc1 cpp cccp gcc stage2
1693 -rm -f stage2/libgcc.a
1694 -cp libgcc.a stage2 && $(RANLIB) stage2/libgcc.a
1695 -make clean
1696
1697risky-stage3: force
2388f67d 1698 -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
32e6d418 1699 -mv cc1 cpp cccp gcc stage3
1700 -rm -f stage3/libgcc.a
1701 -cp libgcc.a stage3 && $(RANLIB) stage3/libgcc.a
1702 -make clean
1703
1704risky-stage4: force
2388f67d 1705 -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
32e6d418 1706 -mv cc1 cpp cccp gcc stage4
1707 -rm -f stage4/libgcc.a
1708 -cp libgcc.a stage4 && $(RANLIB) stage4/libgcc.a
1709 -make clean
1710
1711#In GNU Make, ignore whether `stage*' exists.
1712.PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
1713.PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
1714
1715force: