]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/Makefile.in
*** empty log message ***
[thirdparty/gcc.git] / gcc / Makefile.in
CommitLineData
79d8453e
RS
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,
2e494f70 22# uninstall, TAGS, mostlyclean, clean, distclean, realclean,
79d8453e
RS
23# stage1, stage2, stage3, stage4.
24
2e494f70
RS
25# Suppress smart makes who think they know how to automake Yacc files
26.y.c:
27
79d8453e
RS
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
2e494f70 90# Version of ar to use when compiling libgcc1.a.
79d8453e
RS
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
20bd0ab1
RS
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
79d8453e
RS
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
2e494f70
RS
134# Directory in which to put host dependent programs and libraries
135exec_prefix = $(prefix)
79d8453e 136# Directory in which to put the executable for the command `gcc'
2e494f70 137bindir = $(exec_prefix)/bin
79d8453e 138# Directory in which to put the directories used by the compiler.
2e494f70 139libdir = $(exec_prefix)/lib
79d8453e 140# Directory in which the compiler finds executables, libraries, etc.
2e494f70 141libsubdir = $(libdir)/gcc-lib/$(target)/$(version)
79d8453e
RS
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.
2e494f70
RS
158# The value may be empty; that means to do absolutely nothing
159# with or for libgcc1.a.
79d8453e
RS
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
2e494f70
RS
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.
79d8453e
RS
180# The rules for compiling them should be in the t-* file for the machine.
181EXTRA_PARTS =
182
2e494f70
RS
183# List of extra object files that should be compiled and linked with
184# compiler proper (cc1, cc1obj, cc1plus).
185EXTRA_OBJS =
186
f780d21b
RS
187# List of additional header files to install.
188# Often this is edited directly by `configure'.
189EXTRA_HEADERS =
190
47547081
RS
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
79d8453e
RS
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.
47547081 221GCC_PARTS=$(GCC_PASSES) libgcc.a $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS)
79d8453e
RS
222
223# Change this to empty to prevent installing limits.h.
2e494f70 224# Actually, this currently has no effect,
79d8453e 225# and if that causes no problems, it can be deleted.
2e494f70 226# Otherwise, it must be replaced so as to control
79d8453e
RS
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)
2e494f70 244HOST_CLIB=$(CLIB)
79d8453e
RS
245HOST_LDFLAGS=$(LDFLAGS)
246HOST_CPPFLAGS=$(ALL_CPPFLAGS)
2e494f70
RS
247HOST_ALLOCA=$(ALLOCA)
248HOST_MALLOC=$(MALLOC)
249HOST_OBSTACK=$(OBSTACK)
79d8453e
RS
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).
2e494f70 263all: all.indirect
79d8453e
RS
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
2e494f70
RS
270all.indirect: $(ALL)
271
79d8453e
RS
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.
2e494f70
RS
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 `
79d8453e
RS
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.
2e494f70 294HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_ALLOCA) $(HOST_PREFIX)$(HOST_MALLOC)
79d8453e
RS
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.
2e494f70
RS
302HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC) \
303 $(HOST_CLIB)
79d8453e
RS
304
305HOST_RTL = $(HOST_PREFIX)rtl.o
306HOST_RTLANAL = $(HOST_PREFIX)rtlanal.o
d3614a37 307HOST_PRINT = $(HOST_PREFIX)print-rtl.o
79d8453e
RS
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 \
47547081
RS
348 rtl.o print-rtl.o rtlanal.o emit-rtl.o \
349 dbxout.o sdbout.o dwarfout.o xcoffout.o \
79d8453e
RS
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 \
47547081 354 insn-attrtab.o aux-output.o getpwd.o $(EXTRA_OBJS)
79d8453e
RS
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 \
e97ed334 367 stamp-attr stamp-attrtab stamp-proto \
79d8453e
RS
368 genemit genoutput genrecog genextract genflags gencodes genconfig genpeep \
369 genattrtab genattr \
47547081 370 $(GCC_PASSES) $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross cccp \
9c0022f6 371 cc1plus cc1obj enquire protoize unprotoize specs collect2 $(USE_COLLECT2)
79d8453e
RS
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 \
f780d21b 393 va-spur.h va-m88k.h va-i960.h proto.h $(EXTRA_HEADERS)
79d8453e
RS
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
47547081 413Makefile: $(srcdir)/Makefile.in $(srcdir)/configure $(srcdir)/version.c \
79d8453e
RS
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.
3aa072f2 419all.cross: native gcc-cross cross-test $(EXTRA_PARTS)
79d8453e 420# This is what must be made before installing GCC and converting libraries.
3aa072f2 421start.encap: native gcc specs $(LIBGCC1_TARGET)
79d8453e
RS
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.
2e494f70 425rest.encap: libgcc.a float.h $(EXTRA_PARTS)
79d8453e
RS
426# This is what is made with the host's compiler
427# whether making a cross compiler or not.
47547081 428native: config.status cpp $(LANGUAGES) $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2)
79d8453e
RS
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
2e494f70
RS
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.
79d8453e 440config.status:
2e494f70
RS
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
79d8453e 447
3aa072f2
RS
448# On the target machine, finish building a cross compiler.
449# This does the things that can't be done on the host machine.
450rest.cross: libgcc.a float.h specs
451
e97ed334
RS
452# Verify that it works to compile and link cross-test.
453# If it does, then there are sufficient replacements for libgcc1.a.
454cross-test: cross-test.o native gcc-cross
455 $(GCC_FOR_TARGET) $(GCC_CFLAGS) cross-test.o -o $@
456cross-test.o: cross-test.c native gcc-cross
457 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -c $(srcdir)/cross-test.c
458
3aa072f2
RS
459# Recompile all the language-independent object files.
460# This is used only if the user explicitly asks for it.
79d8453e
RS
461compilations: ${OBJS}
462
463gcc: gcc.o version.o $(LIBDEPS)
464 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o gccnew gcc.o version.o $(LIBS)
465# Go via `gccnew' to avoid `file busy' if $(CC) is `gcc'.
466 mv -f gccnew gcc
3aa072f2
RS
467
468# Dump a specs file to make -B./ read these specs over installed ones.
469specs: gcc
79d8453e
RS
470 ./gcc -dumpspecs > specs
471
472# We do want to create an executable named `gcc', so we can use it to
473# compile libgcc2.a.
474# Also create gcc-cross, so that install-common will install properly.
475gcc-cross: gcc
476 cp gcc gcc-cross
477
478cc1:$(P) $(C_OBJS) $(OBJS) $(LIBDEPS)
479 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1 $(C_OBJS) $(OBJS) $(LIBS)
480
481cc1plus:$(P) $(CPLUS_OBJS) $(OBJS) $(LIBDEPS)
482 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1plus $(CPLUS_OBJS) $(OBJS) $(LIBS)
483
484cc1obj:$(P) $(OBJC_OBJS) $(OBJS) $(LIBDEPS)
485 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1obj $(OBJC_OBJS) $(OBJS) $(LIBS)
486
487float.h: enquire
488 -./enquire -f > tmp-float.h
489 mv tmp-float.h float.h
490
491# Used to compile enquire with standard cc, but have forgotten why.
492# Let's try with GCC.
493enquire: enquire.o $(GCC_PARTS)
494 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ENQUIRE_LDFLAGS) enquire.o -o $@
495enquire.o: $(srcdir)/enquire.c $(GCC_PASSES)
9c4614c3 496 -if [ "$(srcdir)" != "." ]; then rm -f enquire.c; else true; fi
79d8453e 497 -cp $(srcdir)/enquire.c . > /dev/null 2>&1
2e494f70
RS
498# Breaking this line caused a problem with one version of GNU make.
499 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(ENQUIRE_CFLAGS) -I. -c enquire.c
79d8453e
RS
500\f
501# Build libgcc.a.
502# This is done in two parts because some functions, in libgcc1.c,
503# must be compiled with something other than gcc,
504# while the rest, in libgcc2.c, must be compiled with gcc.
505# That means we can't do libgcc2.c until after gcc, cc1, etc.
506
507# Use this as value of LIBGCC1 to cause conversion to GNU library format.
508# LIBCONVERT should put its output in libgcc1.conv.
509libgcc1.conv: libgcc1.a
510 $(LIBCONVERT) libgcc1.a libgcc1.conv
511
512# Use this as value of LIBGCC1 to inhibit use of libgcc1.c entirely.
513# Make an empty file instead.
514libgcc1.null: $(CROSS_TOOLS) $(GCC_PASSES)
515 echo "__foo () {}" > dummy.c
516 $(GCC_FOR_TARGET) $(GCC_CFLAGS) -c dummy.c
517 $(OLDAR) $(OLDAR_FLAGS) libgcc1.null dummy.o
518 rm -f dummy.o dummy.c
519
520# Compile the library of arithmetic subroutines with the native compiler.
521# Don't compile it with gcc!
522# (That would cause most arithmetic functions to call themselves.)
523libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1FUNCS_EXTRA) config.status
524 -rm -f tmplibgcc1.a
525# Actually build it in tmplibgcc1.a, then rename at end,
526# so that libgcc1.a itself remains nonexistent if compilation is aborted.
527# -e causes any failing command to make this rule fail.
528# -e doesn't work in certain shells, so we test $$? as well.
529 set -e; \
530 for name in $(LIB1FUNCS); \
531 do \
532 echo $${name}; \
533 rm -f $${name}.o; \
534 $(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -c -DL$${name} $(srcdir)/libgcc1.c; \
535 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
536 mv libgcc1.o $${name}.o; \
537 $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}.o; \
538 rm -f $${name}.o; \
539 done
540# Some shells crash when a loop has no items.
541# So make sure there is always at least one--`..'.
542# Then ignore it.
543# We don't use -e here because there are if statements
544# that should not make the command give up when the if condition is false.
545# Instead, we test for failure after each command where it matters.
2e494f70 546 -for file in .. $(LIB1FUNCS_EXTRA); \
79d8453e
RS
547 do \
548 if [ x$${file} != x.. ]; then \
549 name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
550 echo $${name}; \
551 if [ $${name}.asm = $${file} ]; then \
552 cp $${file} $${name}.s; file=$${name}.s; \
553 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
554 else true; fi; \
555 $(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -c $${file}; \
556 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
557 $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}.o; \
558 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
559 rm -f $${name}.[so]; \
560 else true; \
561 fi; \
562 done
563 mv tmplibgcc1.a libgcc1.a
564
565# Compiling libgcc2.a requires making sure that cc1, etc. have been compiled.
566# But recompiling cc1 should not force recompilation of libgcc2.a.
567# If you want to force recompilation, delete libgcc2.a.
568# Depend on install-cross-tools to make sure we set up properly
569# to run the assembler before we try compiling anything.
570# install-cross-tools does nothing if not cross compiling.
571libgcc2.ready: $(GCC_PASSES) $(CROSS_TOOLS)
572 -if [ -f libgcc2.ready ] ; then \
573 true; \
574 else \
575 touch libgcc2.ready; \
576 fi
577
578libgcc2.a: libgcc2.c libgcc2.ready $(CONFIG_H) $(LIB2FUNCS_EXTRA) \
579 longlong.h gbl-ctors.h config.status
580# Actually build it in tmplibgcc2.a, then rename at end,
581# so that libgcc2.a itself remains nonexistent if compilation is aborted.
582 -rm -f tmplibgcc2.a
583# -e causes any failing command to make this rule fail.
584# -e doesn't work in certain shells, so we test $$? as well.
585 set -e; \
586 for name in $(LIB2FUNCS); \
587 do \
588 echo $${name}; \
2e494f70 589 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
79d8453e
RS
590 $(srcdir)/libgcc2.c -o $${name}.o; \
591 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
592 $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}.o; \
593 rm -f $${name}.o; \
594 done
595# Some shells crash when a loop has no items.
596# So make sure there is always at least one--`..'.
597# Then ignore it.
598# We don't use -e here because there are if statements
599# that should not make the command give up when the if condition is false.
600# Instead, we test for failure after each command where it matters.
2e494f70 601 -for file in .. $(LIB2FUNCS_EXTRA); \
79d8453e
RS
602 do \
603 if [ x$${file} != x.. ]; then \
604 name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
605 echo $${name}; \
606 if [ $${name}.asm = $${file} ]; then \
607 cp $${file} $${name}.s; file=$${name}.s; \
608 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
609 else true; fi; \
2e494f70 610 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
79d8453e
RS
611 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
612 $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}.o; \
613 rm -f $${name}.[so]; \
614 else true; \
615 fi; \
616 done
617 mv tmplibgcc2.a libgcc2.a
618# These lines were deleted from above the mv command
619# because ranlibing libgcc.a itself should suffice.
620# -if [ x${HPUX_GAS} = x ] ; then \
621# if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc2.a; else true; fi \
622# else true; fi
623
624# Combine the various libraries into a single library, libgcc.a.
625libgcc.a: $(LIBGCC1) $(LIBGCC2)
626 -rm -rf tmplibgcc.a libgcc.a tmpcopy
627 mkdir tmpcopy
2e494f70
RS
628 -if [ x$(LIBGCC1) != x ]; \
629 then (cd tmpcopy; $(AR) x ../$(LIBGCC1)); \
630 else true; \
631 fi
79d8453e
RS
632 (cd tmpcopy; $(AR) x ../$(LIBGCC2))
633 (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *.o)
634 rm -rf tmpcopy
635 -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi
636# Actually build it in tmplibgcc.a, then rename at end,
637# so that libgcc.a itself remains nonexistent if compilation is aborted.
638 mv tmplibgcc.a libgcc.a
639
640
641# Compile two additional files that are linked with every program
642# linked using GCC on system V, for the sake of C++ constructors.
643crtbegin.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h
644 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) -DCRT_BEGIN \
2e494f70 645 -finhibit-size-directive -g0 -c $(srcdir)/crtstuff.c -o crtbegin.o
79d8453e
RS
646
647crtend.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h
648 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) -DCRT_END \
2e494f70 649 -finhibit-size-directive -g0 -c $(srcdir)/crtstuff.c -o crtend.o
79d8453e
RS
650\f
651# Compiling object files from source files.
652
653# Note that dependencies on obstack.h are not written
654# because that file is not part of GCC.
655# Dependencies on gvarargs.h are not written
656# because all that file does, when not compiling with GCC,
657# is include the system varargs.h.
658
659# C language specific files.
660
661c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h c-tree.h input.h flags.h
662 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
663$(srcdir)/c-parse.c $(srcdir)/c-parse.h: $(srcdir)/c-parse.y
664 cd $(srcdir); $(BISON) $(BISONFLAGS) -d c-parse.y -o c-parse.c
665
666c-decl.o : c-decl.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h
667c-typeck.o : c-typeck.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h
668c-lang.o : c-lang.c $(CONFIG_H) $(TREE_H)
669c-lex.o : c-lex.c $(CONFIG_H) $(TREE_H) c-lex.h c-tree.h c-parse.h \
670 input.h flags.h
671c-aux-info.o : c-aux-info.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h
672c-convert.o : c-convert.c $(CONFIG_H) $(TREE_H) flags.h
673
674# C++ language specific files.
675
676cp-parse.o : $(srcdir)/cp-parse.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
677 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
678 `echo $(srcdir)/cp-parse.c | sed 's,^\./,,'`
679
680$(srcdir)/cp-parse.c $(srcdir)/cp-parse.h : $(srcdir)/cp-parse.y
2e0b13db 681 @echo expect 30 shift/reduce conflicts and 14 reduce/reduce conflicts
79d8453e
RS
682 cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o cp-parse.c cp-parse.y
683
684cp-spew.o : cp-spew.c $(CONFIG_H) $(CPLUS_TREE_H) \
685 $(srcdir)/cp-parse.h flags.h
686cp-lex.o : cp-lex.c $(CONFIG_H) $(CPLUS_TREE_H) \
687 $(srcdir)/cp-parse.h $(srcdir)/cp-input.c flags.h
688cp-decl.o : cp-decl.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h \
689 cp-lex.h cp-decl.h stack.h
690cp-decl2.o : cp-decl2.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h \
691 cp-lex.h cp-decl.h
692cp-type2.o : cp-type2.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
693cp-typeck.o : cp-typeck.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
694cp-class.o : cp-class.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h \
695 cp-class.h flags.h
696cp-call.o : cp-call.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h cp-class.h \
697 flags.h
698cp-init.o : cp-init.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
699cp-method.o : cp-method.c $(CONFIG_H) $(CPLUS_TREE_H)
700cp-cvt.o : cp-cvt.c $(CONFIG_H) $(CPLUS_TREE_H)
701cp-search.o : cp-search.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h flags.h
702cp-tree.o : cp-tree.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
703cp-ptree.o : cp-ptree.c $(CONFIG_H) $(CPLUS_TREE_H)
704cp-gc.o : cp-gc.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
705cp-except.o : cp-except.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
706cp-expr.o : cp-expr.c $(CONFIG_H) $(CPLUS_TREE_H) $(RTL_H) flags.h \
707 expr.h insn-codes.h
708cp-edsel.o : cp-edsel.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h flags.h
709cp-xref.o : cp-xref.c $(CONFIG_H) $(CPLUS_TREE_H)
710cp-pt.o : cp-pt.c $(CONFIG_H) $(CPLUS_TREE_H) cp-decl.h cp-parse.h
711
47547081
RS
712# To make a configuration always use collect2, set USE_COLLECT2 to ld.
713ld: collect2
714 rm -f ld
715 ln collect2 ld
716
79d8453e
RS
717collect2 : collect2.o version.o $(LIBDEPS)
718 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o collect2 collect2.o version.o $(LIBS)
719
720collect2.o : collect2.c $(CONFIG_H) gstab.h
47547081
RS
721 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
722 -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
723 -DSTANDARD_BIN_PREFIX=\"$(bindir)/\" \
724 -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
725 -DDEFAULT_TARGET_MACHINE=\"$(target)\" \
726 -c `echo $(srcdir)/collect2.c | sed 's,^\./,,'`
79d8453e
RS
727
728# Objectionable C language specific files.
729
730objc-parse.o : $(srcdir)/objc-parse.c $(CONFIG_H) $(TREE_H) c-lex.h \
731 c-tree.h input.h flags.h objc-actions.h
732 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/objc-parse.c
733$(srcdir)/objc-parse.c : $(srcdir)/objc-parse.y
734 cd $(srcdir); $(BISON) $(BISONFLAGS) objc-parse.y -o objc-parse.c
735
736objc-actions.o : objc-actions.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h \
737 flags.h objc-actions.h
738
739# A file used by all variants of C.
740
741c-common.o : c-common.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h
742
743# Language-independent files.
744
745gcc.o: gcc.c $(CONFIG_H) gvarargs.h obstack.h
746 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
747 -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
2e494f70 748 -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
79d8453e
RS
749 -DDEFAULT_TARGET_MACHINE=\"$(target)\" \
750 -c `echo $(srcdir)/gcc.c | sed 's,^\./,,'`
751
752dumpvers: dumpvers.c
753
754version.o: version.c
755obstack.o: obstack.c
756
757tree.o : tree.c $(CONFIG_H) $(TREE_H) gvarargs.h flags.h function.h
758print-tree.o : print-tree.c $(CONFIG_H) $(TREE_H)
759stor-layout.o : stor-layout.c $(CONFIG_H) $(TREE_H) function.h
760fold-const.o : fold-const.c $(CONFIG_H) $(TREE_H) flags.h
2e494f70 761toplev.o : toplev.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h input.h \
47547081
RS
762 insn-attr.h xcoffout.h
763 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
764 $(MAYBE_USE_COLLECT2) -c `echo $(srcdir)/toplev.c | sed 's,^\./,,'`
79d8453e
RS
765
766rtl.o : rtl.c $(CONFIG_H) $(RTL_H)
767
768print-rtl.o : print-rtl.c $(CONFIG_H) $(RTL_H)
769rtlanal.o : rtlanal.c $(CONFIG_H) $(RTL_H)
770
9c4614c3 771varasm.o : varasm.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h defaults.h \
47547081 772 insn-codes.h expr.h hard-reg-set.h regs.h xcoffout.h
79d8453e
RS
773function.o : function.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h \
774 insn-flags.h insn-codes.h expr.h regs.h hard-reg-set.h insn-config.h \
775 recog.h output.h
776stmt.o : stmt.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h \
777 insn-flags.h insn-config.h insn-codes.h hard-reg-set.h expr.h loop.h recog.h
778expr.o : expr.c $(CONFIG_H) $(RTL_H) $(TREE_H) gvarargs.h flags.h function.h \
779 insn-flags.h insn-codes.h expr.h insn-config.h recog.h output.h typeclass.h
780calls.o : calls.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h insn-codes.h \
781 insn-flags.h
782expmed.o : expmed.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
783 insn-flags.h insn-config.h insn-codes.h expr.h recog.h real.h
784explow.o : explow.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h hard-reg-set.h \
785 insn-config.h expr.h recog.h insn-flags.h insn-codes.h
786optabs.o : optabs.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
787 insn-flags.h insn-config.h insn-codes.h expr.h recog.h
788dbxout.o : dbxout.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h regs.h \
47547081 789 insn-config.h reload.h gstab.h xcoffout.h
79d8453e
RS
790sdbout.o : sdbout.c $(CONFIG_H) $(TREE_H) $(RTL_H) gsyms.h flags.h \
791 insn-config.h reload.h
792dwarfout.o : dwarfout.c $(CONFIG_H) $(TREE_H) $(RTL_H) dwarf.h flags.h \
793 insn-config.h reload.h output.h
47547081 794xcoffout.o : xcoffout.c $(CONFIG_H) $(TREE_H) $(RTL_H) xcoffout.h flags.h
79d8453e
RS
795emit-rtl.o : emit-rtl.c $(CONFIG_H) $(RTL_H) flags.h gvarargs.h function.h \
796 regs.h insn-config.h insn-codes.h real.h expr.h
2e494f70 797getpwd.o : getpwd.c $(CONFIG_H)
79d8453e
RS
798
799integrate.o : integrate.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h integrate.h \
800 insn-flags.h insn-config.h insn-codes.h expr.h real.h function.h
801
802jump.o : jump.c $(CONFIG_H) $(RTL_H) flags.h hard-reg-set.h regs.h \
803 insn-config.h insn-flags.h insn-codes.h expr.h real.h
804stupid.o : stupid.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h
805
806cse.o : cse.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h real.h \
807 insn-config.h recog.h
808loop.o : loop.c $(CONFIG_H) $(RTL_H) flags.h loop.h insn-config.h \
809 insn-flags.h insn-codes.h regs.h hard-reg-set.h recog.h expr.h real.h
810unroll.o : unroll.c $(CONFIG_H) $(RTL_H) insn-config.h insn-codes.h \
811 integrate.h regs.h flags.h expr.h loop.h
812flow.o : flow.c $(CONFIG_H) $(RTL_H) flags.h insn-config.h \
813 basic-block.h regs.h hard-reg-set.h output.h
814combine.o : combine.c $(CONFIG_H) $(RTL_H) gvarargs.h flags.h \
815 insn-config.h insn-flags.h insn-codes.h insn-attr.h regs.h expr.h \
816 basic-block.h recog.h real.h
817regclass.o : regclass.c $(CONFIG_H) $(RTL_H) hard-reg-set.h flags.h \
818 basic-block.h regs.h insn-config.h recog.h
819local-alloc.o : local-alloc.c $(CONFIG_H) $(RTL_H) flags.h basic-block.h \
820 regs.h hard-reg-set.h insn-config.h recog.h output.h
821global-alloc.o : global-alloc.c $(CONFIG_H) $(RTL_H) flags.h \
822 basic-block.h regs.h hard-reg-set.h insn-config.h output.h
823
824reload.o : reload.c $(CONFIG_H) $(RTL_H) flags.h \
825 reload.h recog.h hard-reg-set.h insn-config.h insn-codes.h regs.h real.h
826reload1.o : reload1.c $(CONFIG_H) $(RTL_H) flags.h expr.h \
827 reload.h regs.h hard-reg-set.h insn-config.h insn-flags.h insn-codes.h \
828 basic-block.h recog.h output.h
829caller-save.o : caller-save.c $(CONFIG_H) $(RTL_H) flags.h \
830 regs.h hard-reg-set.h insn-config.h basic-block.h recog.h reload.h expr.h
831reorg.o : reorg.c $(CONFIG_H) $(RTL_H) conditions.h hard-reg-set.h \
832 basic-block.h regs.h insn-config.h insn-attr.h insn-flags.h recog.h \
833 flags.h output.h
834sched.o : sched.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h hard-reg-set.h \
835 flags.h insn-config.h insn-attr.h
836final.o : final.c $(CONFIG_H) $(RTL_H) gvarargs.h flags.h regs.h \
837 recog.h conditions.h insn-config.h insn-attr.h real.h output.h \
47547081 838 hard-reg-set.h insn-codes.h gstab.h xcoffout.h
79d8453e
RS
839recog.o : recog.c $(CONFIG_H) $(RTL_H) \
840 regs.h recog.h hard-reg-set.h flags.h insn-config.h insn-attr.h \
841 insn-flags.h insn-codes.h real.h
842reg-stack.o : reg-stack.c $(CONFIG_H) $(RTL_H) $(TREE_H) \
843 regs.h hard-reg-set.h flags.h insn-config.h
dcfedcd0 844
79d8453e
RS
845aux-output.o : aux-output.c $(CONFIG_H) \
846 $(RTL_H) regs.h hard-reg-set.h real.h insn-config.h conditions.h \
847 insn-flags.h output.h insn-attr.h insn-codes.h
848
849# Normally this target is not used; but it is used if you
850# define ALLOCA=alloca.o. In that case, you must get a suitable alloca.c
851# from the GNU Emacs distribution.
852# Note some machines won't allow $(CC) without -S on this source file.
853alloca.o: alloca.c
854# sed is used to strip the comments from the assembler output.
855 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ALLOCA_FLAGS) \
856 `echo $(srcdir)/alloca.c | sed 's,^\./,,'`
857 $(ALLOCA_FINISH)
47547081 858 -rm alloca.s
79d8453e
RS
859\f
860# Generate header and source files from the machine description,
861# and compile them.
862
863.PRECIOUS: insn-config.h insn-flags.h insn-codes.h \
864 insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \
865 insn-attr.h insn-attrtab.c
866
867# The following pair of rules has this effect:
868# genconfig is run only if the md has changed since genconfig was last run;
869# but the file insn-config.h is touched only when its contents actually change.
870
871# Each of the other insn-* files is handled by a similar pair of rules.
872
873# Each of the insn-*.[ch] rules has a semicolon at the end,
874# for otherwise the system Make on SunOS 4.1 never tries
875# to recompile insn-*.o.
876
877insn-config.h: stamp-config ;
878stamp-config : md genconfig $(srcdir)/move-if-change
879 ./genconfig md > tmp-config.h
880 $(srcdir)/move-if-change tmp-config.h insn-config.h
881 touch stamp-config
882
883insn-flags.h: stamp-flags ;
884stamp-flags : md genflags $(srcdir)/move-if-change
885 ./genflags md > tmp-flags.h
886 $(srcdir)/move-if-change tmp-flags.h insn-flags.h
887 touch stamp-flags
888
889insn-codes.h: stamp-codes ;
890stamp-codes : md gencodes $(srcdir)/move-if-change
891 ./gencodes md > tmp-codes.h
892 $(srcdir)/move-if-change tmp-codes.h insn-codes.h
893 touch stamp-codes
894
895insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) expr.h real.h output.h \
896 insn-config.h insn-flags.h insn-codes.h
897 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c
898
899insn-emit.c: stamp-emit ;
900stamp-emit : md genemit $(srcdir)/move-if-change
901 ./genemit md > tmp-emit.c
902 $(srcdir)/move-if-change tmp-emit.c insn-emit.c
903 touch stamp-emit
904
905insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h recog.h \
906 real.h output.h flags.h
907 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c
908
909insn-recog.c: stamp-recog ;
910stamp-recog : md genrecog $(srcdir)/move-if-change
911 ./genrecog md > tmp-recog.c
912 $(srcdir)/move-if-change tmp-recog.c insn-recog.c
913 touch stamp-recog
914
915insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H)
916 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-extract.c
917
918insn-extract.c: stamp-extract ;
919stamp-extract : md genextract $(srcdir)/move-if-change
920 ./genextract md > tmp-extract.c
921 $(srcdir)/move-if-change tmp-extract.c insn-extract.c
922 touch stamp-extract
923
924insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) regs.h output.h real.h
925 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c
926
927insn-peep.c: stamp-peep ;
928stamp-peep : md genpeep $(srcdir)/move-if-change
929 ./genpeep md > tmp-peep.c
930 $(srcdir)/move-if-change tmp-peep.c insn-peep.c
931 touch stamp-peep
932
933insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(RTL_H) regs.h real.h output.h \
934 insn-attr.h insn-config.h
935 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c
936
937insn-attr.h: stamp-attr ;
938stamp-attr : md genattr $(srcdir)/move-if-change
939 ./genattr md > tmp-attr.h
940 $(srcdir)/move-if-change tmp-attr.h insn-attr.h
941 touch stamp-attr
942
943insn-attrtab.c: stamp-attrtab ;
944stamp-attrtab : md genattrtab $(srcdir)/move-if-change
20bd0ab1
RS
945 if cmp -s $(PREMADE_ATTRTAB_MD) md; \
946 then \
947 echo Using $(PREMADE_ATTRTAB); \
2e0b13db 948 cp $(PREMADE_ATTRTAB) tmp-attrtab.c; \
20bd0ab1
RS
949 else \
950 ./genattrtab md > tmp-attrtab.c; \
951 fi
79d8453e
RS
952 $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
953 touch stamp-attrtab
954
955insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) regs.h real.h conditions.h \
956 hard-reg-set.h insn-config.h insn-flags.h insn-attr.h output.h recog.h \
957 insn-codes.h
958 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c
959
960insn-output.c: stamp-output ;
961stamp-output : md genoutput $(srcdir)/move-if-change
962 ./genoutput md > tmp-output.c
963 $(srcdir)/move-if-change tmp-output.c insn-output.c
964 touch stamp-output
965\f
966# Compile the programs that generate insn-* from the machine description.
967# They are compiled with $(HOST_CC), and associated libraries,
968# since they need to run on this machine
969# even if GCC is being compiled to run on some other machine.
970
971# $(CONFIG_H) is omitted from the deps of the gen*.o
972# because these programs don't really depend on anything
973# about the target machine. They do depend on config.h itself,
974# since that describes the host machine.
975
976genconfig : genconfig.o $(HOST_RTL) $(HOST_LIBDEPS)
977 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genconfig \
978 genconfig.o $(HOST_RTL) $(HOST_LIBS)
979
980genconfig.o : genconfig.c $(RTL_H) config.h
981 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c
982
983genflags : genflags.o $(HOST_RTL) $(HOST_LIBDEPS)
984 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genflags \
985 genflags.o $(HOST_RTL) $(HOST_LIBS)
986
987genflags.o : genflags.c $(RTL_H) config.h
988 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c
989
990gencodes : gencodes.o $(HOST_RTL) $(HOST_LIBDEPS)
991 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o gencodes \
992 gencodes.o $(HOST_RTL) $(HOST_LIBS)
993
994gencodes.o : gencodes.c $(RTL_H) config.h
995 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c
996
997genemit : genemit.o $(HOST_RTL) $(HOST_LIBDEPS)
998 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genemit \
999 genemit.o $(HOST_RTL) $(HOST_LIBS)
1000
1001genemit.o : genemit.c $(RTL_H) config.h
1002 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c
1003
1004genrecog : genrecog.o $(HOST_RTL) $(HOST_LIBDEPS)
1005 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genrecog \
1006 genrecog.o $(HOST_RTL) $(HOST_LIBS)
1007
1008genrecog.o : genrecog.c $(RTL_H) config.h
1009 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c
1010
1011genextract : genextract.o $(HOST_RTL) $(HOST_LIBDEPS)
1012 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genextract \
1013 genextract.o $(HOST_RTL) $(HOST_LIBS)
1014
9d85be6f 1015genextract.o : genextract.c $(RTL_H) config.h insn-config.h
79d8453e
RS
1016 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c
1017
1018genpeep : genpeep.o $(HOST_RTL) $(HOST_LIBDEPS)
1019 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genpeep \
1020 genpeep.o $(HOST_RTL) $(HOST_LIBS)
1021
1022genpeep.o : genpeep.c $(RTL_H) config.h
1023 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c
1024
1025genattr : genattr.o $(HOST_RTL) $(HOST_LIBDEPS)
1026 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattr \
1027 genattr.o $(HOST_RTL) $(HOST_LIBS)
1028
1029genattr.o : genattr.c $(RTL_H) config.h
1030 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c
1031
d3614a37 1032genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBDEPS)
79d8453e 1033 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattrtab \
d3614a37 1034 genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBS)
79d8453e
RS
1035
1036genattrtab.o : genattrtab.c $(RTL_H) config.h insn-config.h
1037 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c
1038
1039genoutput : genoutput.o $(HOST_RTL) $(HOST_LIBDEPS)
1040 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genoutput \
1041 genoutput.o $(HOST_RTL) $(HOST_LIBS)
1042
1043genoutput.o : genoutput.c $(RTL_H) config.h
1044 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c
1045\f
1046# Compile the libraries to be used by gen*.
1047# If we are not cross-building, gen* use the same .o's that cc1 will use,
1048# and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict
1049# with the rules for rtl.o, alloca.o, etc.
1050$(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(CONFIG_H) $(RTL_H)
1051 rm -f $(HOST_PREFIX)rtl.c
1052 cp $(srcdir)/rtl.c $(HOST_PREFIX)rtl.c
1053 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtl.c
1054
d3614a37
RS
1055$(HOST_PREFIX_1)print-rtl.o: $(srcdir)/print-rtl.c $(CONFIG_H) $(RTL_H)
1056 rm -f $(HOST_PREFIX)print-rtl.c
1057 cp $(srcdir)/print-rtl.c $(HOST_PREFIX)print-rtl.c
1058 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)print-rtl.c
1059
79d8453e
RS
1060$(HOST_PREFIX_1)rtlanal.o: $(srcdir)/rtlanal.c $(CONFIG_H) $(RTL_H)
1061 rm -f $(HOST_PREFIX)rtlanal.c
1062 cp $(srcdir)/rtlanal.c $(HOST_PREFIX)rtlanal.c
1063 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtlanal.c
1064
1065$(HOST_PREFIX_1)alloca.o: alloca.c
1066 rm -f $(HOST_PREFIX)alloca.c
1067 cp $(srcdir)/alloca.c $(HOST_PREFIX)alloca.c
1068 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c
1069
1070$(HOST_PREFIX_1)obstack.o: obstack.c
1071 rm -f $(HOST_PREFIX)obstack.c
1072 cp $(srcdir)/obstack.c $(HOST_PREFIX)obstack.c
1073 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c
1074
1075$(HOST_PREFIX_1)malloc.o: malloc.c
1076 rm -f $(HOST_PREFIX)malloc.c
1077 cp $(srcdir)/malloc.c $(HOST_PREFIX)malloc.c
1078 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)malloc.c
1079
1080# This satisfies the dependency that we get if you cross-compile a compiler
1081# that does not need to compile alloca, malloc or whatever.
1082$(HOST_PREFIX_1):
1083 touch $(HOST_PREFIX_1)
1084\f
1085# Remake cpp and protoize.
1086
1087# Making the preprocessor
1088cpp: cccp
1089 -rm -f cpp
1090 ln cccp cpp
1091cccp: cccp.o cexp.o version.o $(LIBDEPS)
1092 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cccp cccp.o cexp.o version.o $(LIBS)
1093cexp.o: $(srcdir)/cexp.c $(CONFIG_H)
1094 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/cexp.c
1095$(srcdir)/cexp.c: $(srcdir)/cexp.y
1096 cd $(srcdir); $(BISON) -o cexp.c cexp.y
1097cccp.o: cccp.c $(CONFIG_H) pcp.h version.c
1098# The reason we use $(libdir)/g++-include rather than using libsubdir
1099# is for compatibility with the current version of libg++.
1100 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2e494f70
RS
1101 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
1102 -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
79d8453e 1103 -DLOCAL_INCLUDE_DIR=\"$(prefix)/include\" \
2e494f70 1104 -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
79d8453e
RS
1105 -c `echo $(srcdir)/cccp.c | sed 's,^\./,,'`
1106
1107proto: config.status protoize unprotoize SYSCALLS.c.X protoize.1 unprotoize.1
1108
2e494f70 1109protoize: protoize.o getopt.o getopt1.o getpwd.o version.o $(LIBDEPS)
79d8453e 1110 $(CC) $(ALL_CFLAGS) $(LDFLAGS) \
2e494f70 1111 protoize.o getopt.o getopt1.o getpwd.o version.o $(LIBS) -o $@
2e0b13db
RS
1112protoize.o: stamp-proto ;
1113
1114unprotoize: unprotoize.o getopt.o getopt1.o getpwd.o version.o $(LIBDEPS)
1115 $(CC) $(ALL_CFLAGS) $(LDFLAGS) \
1116 unprotoize.o getopt.o getopt1.o getpwd.o version.o $(LIBS) -o $@
1117unprotoize.o: stamp-proto ;
1118
1119stamp-proto: $(srcdir)/protoize.c getopt.h $(CONFIG_H)
1120 touch stamp-proto
79d8453e
RS
1121 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1122 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
2e494f70 1123 -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
79d8453e
RS
1124 -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
1125 -DLOCAL_INCLUDE_DIR=\"$(prefix)/include\" \
1126 -DSTD_PROTO_DIR=\"$(libsubdir)\" \
2e0b13db
RS
1127 -DUNPROTOIZE $(srcdir)/protoize.c
1128 mv protoize.o unprotoize.o
79d8453e
RS
1129 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1130 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
2e494f70 1131 -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
79d8453e
RS
1132 -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
1133 -DLOCAL_INCLUDE_DIR=\"$(prefix)/include\" \
1134 -DSTD_PROTO_DIR=\"$(libsubdir)\" \
2e0b13db 1135 $(srcdir)/protoize.c
79d8453e
RS
1136
1137getopt.o: $(srcdir)/getopt.c getopt.h
1138 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt.c
1139getopt1.o: $(srcdir)/getopt1.c getopt.h
1140 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt1.c
1141
1142protoize.1: $(srcdir)/proto-man ./cpp
1143 ./cpp -traditional $(srcdir)/proto-man \
1144 | grep -v '^#' \
2e494f70 1145 | awk 'NF > 0 {print}' > tmp-proto.1
3aa072f2 1146 -rm -f protoize.1
2e494f70 1147 mv tmp-proto.1 protoize.1
79d8453e
RS
1148
1149unprotoize.1: $(srcdir)/proto-man ./cpp
1150 ./cpp -traditional -DUNPRO $(srcdir)/proto-man \
1151 | grep -v '^#' \
2e494f70 1152 | awk 'NF > 0 {print}' > tmp-unproto.1
3aa072f2 1153 -rm -f unprotoize.1
2e494f70
RS
1154 mv tmp-unproto.1 unprotoize.1
1155
79d8453e 1156# This info describes the target machine, so compile with GCC just built.
47547081
RS
1157SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES)
1158 -rm -f SYSCALLS.c
1159 cat $(srcdir)/sys-types.h $(srcdir)/sys-protos.h > SYSCALLS.c
79d8453e 1160 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
47547081
RS
1161 -aux-info $@ -S -o /dev/null SYSCALLS.c
1162 -rm -f SYSCALLS.c
9c0022f6
RS
1163
1164test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES)
4803a34a 1165 -rm -f tmp-proto.[cso]
d3614a37
RS
1166 cp $(srcdir)/protoize.c tmp-proto.c
1167 chmod u+w tmp-proto.c
4803a34a
RK
1168 ./protoize -N -B ./ -x getopt.h -c "-B./ -Wall -Wwrite-strings \
1169 $(CFLAGS) $(INCLUDES) \
9c0022f6
RS
1170 -DGCC_INCLUDE_DIR=0 \
1171 -DGPLUSPLUS_INCLUDE_DIR=0 \
1172 -DCROSS_INCLUDE_DIR=0 \
d3614a37 1173 -DSTD_PROTO_DIR=0" tmp-proto.c
4803a34a
RK
1174 @echo '**********' Expect 402 lines of differences.
1175 -diff $(srcdir)/protoize.c tmp-proto.c > tmp-proto.diff
1176 -wc -l tmp-proto.diff
1177 ./unprotoize -N -x getopt.h -c "-B./ -Wall -Wwrite-strings \
1178 $(CFLAGS) $(INCLUDES) \
9c0022f6
RS
1179 -DGCC_INCLUDE_DIR=0 \
1180 -DGPLUSPLUS_INCLUDE_DIR=0 \
1181 -DCROSS_INCLUDE_DIR=0 \
d3614a37 1182 -DSTD_PROTO_DIR=0" tmp-proto.c
9c0022f6 1183 @echo Expect zero differences.
d3614a37 1184 diff $(srcdir)/protoize.c tmp-proto.c | cat
4803a34a 1185 -rm -f tmp-proto.[cso]
79d8453e
RS
1186\f
1187# Remake the info files.
1188
f780d21b 1189doc: $(srcdir)/cpp.info $(srcdir)/gcc.info $(srcdir)/INSTALL
79d8453e 1190
f780d21b 1191$(srcdir)/cpp.info: cpp.texi
79d8453e
RS
1192 makeinfo `echo $(srcdir)/cpp.texi | sed 's,^\./,,'`
1193
f780d21b 1194#$(srcdir)/gplus.info: gplus.texi
47547081 1195# makeinfo `echo $(srcdir)/gplus.texi | sed 's,^\./,,'`
79d8453e 1196
f780d21b
RS
1197$(srcdir)/gcc.info: gcc.texi extend.texi install.texi invoke.texi \
1198 md.texi rtl.texi tm.texi
79d8453e 1199 makeinfo `echo $(srcdir)/gcc.texi | sed 's,^\./,,'`
f780d21b
RS
1200
1201$(srcdir)/INSTALL: install1.texi install.texi
1202 makeinfo --no-header `echo $(srcdir)/install1.texi | sed 's,^\./,,'`
79d8453e
RS
1203\f
1204# Deletion of files made during compilation.
1205# There are four levels of this:
47547081 1206# `mostlyclean', `clean', `distclean' and `realclean'.
79d8453e 1207# `mostlyclean' is useful while working on a particular type of machine.
2e494f70 1208# It deletes most, but not all, of the files made by compilation.
79d8453e 1209# It does not delete libgcc.a or its parts, so it won't have to be recompiled.
2e494f70 1210# `clean' deletes everything made by running `make all'.
47547081 1211# `distclean' also deletes the files made by config.
79d8453e
RS
1212# `realclean' also deletes everything that could be regenerated automatically.
1213
47547081 1214
79d8453e
RS
1215mostlyclean:
1216 -rm -f $(STAGESTUFF)
1217# Delete the temporary source copies for cross compilation.
1218 -rm -f $(HOST_PREFIX_1)rtl.c $(HOST_PREFIX_1)rtlanal.c
1219 -rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c
1220 -rm -f $(HOST_PREFIX_1)obstack.c
1221# Delete the temp files made in the course of building libgcc.a.
2e494f70 1222 -rm -f tmplibgcc* tmpcopy
79d8453e
RS
1223 for name in $(LIB1FUNCS); do rm -f $${name}.c; done
1224# Delete other temporary files.
4803a34a 1225 -rm -f tmp-float.h tmp-gcc.xtar.Z tmp-limits.h gccnew
3aa072f2 1226 -rm -f tmp-foo1 tmp-foo2 tmp-proto.* tmp-unproto.1
79d8453e
RS
1227# Delete the stamp files.
1228 -rm -f stamp-* tmp-*
2e494f70 1229# Delete debugging dump files.
79d8453e 1230 -rm -f *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop
2e494f70
RS
1231 -rm -f *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack
1232# Delete some files made during installation.
1233 -rm -f specs float.h enquire SYSCALLS.c SYSCALLS.c.X
47547081 1234 -rm -f collect collect2 ld mips-tfile mips-tdump alloca.s
2e494f70
RS
1235# Delete unwanted output files from TeX.
1236 -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
47547081
RS
1237# Delete sorted indices we don't actually use.
1238 -rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns
2e494f70
RS
1239# Delete core dumps.
1240 -rm -f core
79d8453e 1241
47547081
RS
1242# Delete all files made by compilation
1243# that don't exist in the distribution.
79d8453e 1244clean: mostlyclean
20bd0ab1
RS
1245# It may not be quite desirable to delete unprotoize.c here,
1246# but the spec for `make clean' requires it.
1247# Using unprotoize.c is not quite right in the first place,
1248# but what better way is there?
3aa072f2
RS
1249 -rm -f libgcc.a libgcc1.a libgcc2.a libgcc2.ready libgcc1.null
1250 -rm -f *.dvi unprotoize.c
79d8453e 1251
47547081
RS
1252# Delete all files that users would normally create
1253# while building and installing GCC.
2e494f70 1254distclean: clean
79d8453e 1255 -rm -f tm.h aux-output.c config.h md config.status tconfig.h
2e0b13db 1256 -rm -f Makefile *.oaux
47547081 1257 -rm -fr stage1 stage2 stage3 stage4
2e494f70
RS
1258
1259# Delete anything likely to be found in the source directory
1260# that shouldn't be in the distribution.
1261extraclean: distclean
47547081
RS
1262 -rm -rf =* #* *~* config/=* config/#* config/*~*
1263 -rm -f *.dvi *.oaux patch* config/patch* *.orig *.rej *.d *.Z *.tar
f780d21b 1264 -rm -f *.s *.s[0-9] *.i install1.texi
79d8453e
RS
1265
1266# Get rid of every file that's generated from some other file.
1267# Most of these files ARE PRESENT in the GCC distribution.
2e494f70 1268realclean: distclean
79d8453e
RS
1269 -rm -f cp-parse.c cp-parse.h cp-parse.output
1270 -rm -f objc-parse.c objc-parse.output
1271 -rm -f protoize.1 unprotoize.1
1272 -rm -f c-parse.c c-parse.h c-parse.output
1273 -rm -f cexp.c cexp.output TAGS
2e494f70
RS
1274 -rm -f cpp.info* cpp.??s cpp.*aux
1275 -rm -f gcc.info* gcc.??s gcc.*aux
1276 -rm -f gplus.info* gplus.??s gplus.*aux
79d8453e
RS
1277\f
1278# Entry points `install' and `uninstall'.
1279# Also temporarily `install-fixincludes' could replace `install-headers'.
2e494f70 1280# Also use `install-collect2' to install collect2 when the config files don't.
79d8453e
RS
1281
1282install: $(INSTALL_TARGET)
1283
1284# Copy the files of native compiler into directories where they will be run.
1285install-native: install-common install-libgcc $(INSTALL_HEADERS) \
2e494f70 1286 install-man
79d8453e
RS
1287
1288# Copy the files of cross compiler into directories where they will be run.
1289install-cross: install-common install-common-headers \
1290 install-man install-cross-tools install-libgcc
1291
1292# Install the tools, libraries and header files for the target machine
1293# where cross-compilation will look for them.
1294# Use tooldir to find them.
1295install-cross-tools: install-dir
1296# The first if makes this a no-op except for a cross compiler.
1297# The /. after the dirname causes test to follow symlinks.
1298# Before making a link or an indirection script,
1299# we verify the desired file does not already exist.
1300# If a symlink does exist, then making a symlink would certainly fail,
1301# leading us to overwrite the real file through the symlink.
1302 -if [ -f gcc-cross ] ; \
1303 then \
1304 if [ -d $(tooldir)/. ] ; \
1305 then \
1306 for file in as ld ar ranlib; do \
1307 if [ -f $(libsubdir)/$$file ] ; \
1308 then true; \
1309 else \
1310 $(SYMLINK) $(tooldir)/bin/$$file $(libsubdir)/$$file \
1311 || (echo "#!/bin/sh"; echo $(tooldir)/bin/$$file "$$@") > $(libsubdir)/$$file; \
1312 fi; \
1313 done; \
1314 for file in $(tooldir)/lib/*; do \
1315 if [ -f $$file ] ; \
1316 then \
1317 if [ -f $(libsubdir)/`basename $$file` ] ; \
1318 then true; \
1319 else \
1320 $(SYMLINK) $$file $(libsubdir)/`basename $$file` \
1321 || $(INSTALL_DATA) $$file $(libsubdir)/`basename $$file`; \
1322 fi; \
1323 else true; \
1324 fi; \
1325 done; \
1326 if [ -d $(tooldir)/include/. ] ; then \
1327 $(SYMLINK) $(tooldir)/include $(libsubdir)/sys-include \
1328 || (if [ -d $(libsubdir)/sys-include ] ; then true ; else mkdir $(libsubdir)/sys-include ; fi; \
1329 cd $(tooldir)/include; tar cf - . | (cd $(libsubdir)/sys-include; tar xpf -)); \
1330 else true; fi; \
1331 else true; \
1332 fi; \
1333 else true; \
1334 fi;
1335
1336# Run this on the target machine
1337# to finish installation of cross compiler.
1338install-cross-rest: install-float-h-cross
1339
1340# Install float.h for cross compiler.
1341# Run this on the target machine!
1342install-float-h-cross:
1343 if [ -f enquire ] ; then true; else false; done
1344 -./enquire -f > float.h
1345 -rm -f $(libsubdir)/include/float.h
1346 $(INSTALL_DATA) float.h $(libsubdir)/include/float.h
1347 chmod a-x $(libsubdir)/include/float.h
1348
1349# Create the installation directory.
1350install-dir:
935e11b0
TW
1351 -if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; fi
1352 -if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib ; fi
1353 -if [ -d $(libdir)/gcc-lib/include ] ; then true ; else mkdir $(libdir)/gcc-lib/include ; fi
1354 -if [ -d $(libdir)/gcc-lib/$(target) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target) ; fi
1355 -if [ -d $(libdir)/gcc-lib/$(target)/$(version) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target)/$(version) ; fi
f780d21b 1356 -if [ -d $(libdir)/gcc-lib/$(target)/$(version)/include ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target)/$(version)/include ; fi
935e11b0 1357 -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; fi
79d8453e
RS
1358# We don't use mkdir -p to create the parents of mandir,
1359# because some systems don't support it.
1360# Instead, we use this technique to create the immediate parent of mandir.
935e11b0 1361 -parent=`echo $(mandir)|sed -e 's@/[^/]*$$@@'`; \
79d8453e
RS
1362 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
1363 -if [ -d $(mandir) ] ; then true ; else mkdir $(mandir) ; fi
1364
1365# Install the compiler executables built during cross compilation.
1366install-common: native install-dir
1367 for file in $(COMPILERS); do \
1368 if [ -f $$file ] ; then \
1369 rm -f $(libsubdir)/$$file; \
1370 $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
1371 else true; \
1372 fi; \
1373 done
47547081 1374 for file in $(EXTRA_PASSES) $(EXTRA_PARTS) $(EXTRA_PROGRAMS) $(USE_COLLECT2) ..; do \
79d8453e
RS
1375 if [ x"$$file" != x.. ]; then \
1376 rm -f $(libsubdir)/$$file; \
1377 $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
1378 else true; fi; \
1379 done
1380 -rm -f $(libsubdir)/specs
1381 $(INSTALL_DATA) specs $(libsubdir)/specs
1382# Install the driver program as gcc-$(target)
1383# and also as either gcc (if native) or $(tooldir)/bin/gcc.
1384 -if [ -f gcc-cross ] ; then \
2e494f70 1385 $(INSTALL_PROGRAM) gcc-cross $(bindir)/gcc-$(target); \
79d8453e
RS
1386 if [ -d $(tooldir)/bin/. ] ; then \
1387 rm -f $(tooldir)/bin/gcc; \
1388 $(INSTALL_PROGRAM) gcc-cross $(tooldir)/bin/gcc; \
79d8453e
RS
1389 else true; fi; \
1390 else \
1391 rm -f $(bindir)/gcc; \
1392 $(INSTALL_PROGRAM) gcc $(bindir)/gcc; \
1393 rm -f $(bindir)/gcc-$(target)-1; \
1394 ln $(bindir)/gcc $(bindir)/gcc-$(target)-1; \
1395 mv $(bindir)/gcc-$(target)-1 $(bindir)/gcc-$(target); \
1396 fi
4803a34a 1397 -rm -f $(bindir)/c++
79d8453e 1398 $(INSTALL_PROGRAM) $(srcdir)/c++ $(bindir)/c++
4803a34a 1399 -rm -f $(bindir)/g++
79d8453e
RS
1400 $(INSTALL_PROGRAM) $(srcdir)/g++ $(bindir)/g++
1401 -rm -f $(libsubdir)/cpp
1402 $(INSTALL_PROGRAM) cpp $(libsubdir)/cpp
1403
1404# Install protoize.
1405install-proto: proto install-dir
1406 -rm -f $(bindir)/protoize
1407 $(INSTALL_PROGRAM) protoize $(bindir)/protoize
1408 -rm -f $(bindir)/unprotoize
1409 $(INSTALL_PROGRAM) unprotoize $(bindir)/unprotoize
1410 -rm -f $(libsubdir)/SYSCALLS.c.X
1411 $(INSTALL_DATA) SYSCALLS.c.X $(libsubdir)/SYSCALLS.c.X
1412 chmod a-x $(libsubdir)/SYSCALLS.c.X
1413
1414# Install the man pages.
2e494f70
RS
1415install-man: install-dir $(srcdir)/gcc.1 $(srcdir)/cccp.1 \
1416 protoize.1 unprotoize.1 $(srcdir)/g++.1
79d8453e 1417 -rm -f $(mandir)/gcc$(manext)
2e0b13db
RS
1418 -$(INSTALL_DATA) $(srcdir)/gcc.1 $(mandir)/gcc$(manext)
1419 -chmod a-x $(mandir)/gcc$(manext)
2e494f70 1420 -rm -f $(mandir)/cccp$(manext)
2e0b13db
RS
1421 -$(INSTALL_DATA) $(srcdir)/cccp.1 $(mandir)/cccp$(manext)
1422 -chmod a-x $(mandir)/cccp$(manext)
79d8453e 1423 -rm -f $(mandir)/protoize$(manext)
2e0b13db
RS
1424 -$(INSTALL_DATA) protoize.1 $(mandir)/protoize$(manext)
1425 -chmod a-x $(mandir)/protoize$(manext)
79d8453e 1426 -rm -f $(mandir)/unprotoize$(manext)
2e0b13db
RS
1427 -$(INSTALL_DATA) unprotoize.1 $(mandir)/unprotoize$(manext)
1428 -chmod a-x $(mandir)/unprotoize$(manext)
2e494f70 1429 -rm -f $(mandir)/g++$(manext)
2e0b13db
RS
1430 -$(INSTALL_DATA) $(srcdir)/g++.1 $(mandir)/g++$(manext)
1431 -chmod a-x $(mandir)/g++$(manext)
79d8453e
RS
1432
1433# Install the library.
4b3c8365 1434install-libgcc: libgcc.a install-dir
79d8453e
RS
1435 -if [ -f libgcc.a ] ; then \
1436 rm -f $(libsubdir)/libgcc.a; \
1437 $(INSTALL_DATA) libgcc.a $(libsubdir)/libgcc.a; \
1438 if $(RANLIB_TEST) ; then \
1439 (cd $(libsubdir); $(RANLIB) libgcc.a); else true; fi; \
1440 chmod a-x $(libsubdir)/libgcc.a; \
1441 else true; fi
1442
1443# Install all the header files for native compiler.
1444install-headers: install-common-headers install-float-h install-limits-h
1445
1446# Install float.h for native compiler.
f780d21b 1447install-float-h: float.h install-dir
79d8453e
RS
1448 -rm -f $(libsubdir)/include/float.h
1449 $(INSTALL_DATA) float.h $(libsubdir)/include/float.h
1450 chmod a-x $(libsubdir)/include/float.h
1451
1452# Install limits.h, optionally inheriting from the standard system version.
f780d21b 1453install-limits-h: limits.h limitx.h install-dir
79d8453e
RS
1454 -rm -f $(libsubdir)/include/limits.h tmp-limits.h
1455 if [ -f /usr/include/limits.h ] ; then \
1456 cat $(srcdir)/limitx.h $(srcdir)/limits.h > tmp-limits.h; \
1457 else \
1458 cat $(srcdir)/limits.h > tmp-limits.h; \
1459 fi
1460 $(INSTALL_DATA) tmp-limits.h $(libsubdir)/include/limits.h
1461 chmod a-x $(libsubdir)/include/limits.h
1462 rm tmp-limits.h
1463
1464# Install the fixed headers that are the same for all machines.
1465install-common-headers: install-dir $(USER_H) gvarargs.h gstdarg.h gstddef.h
935e11b0 1466 -if [ -d $(libsubdir)/include ] ; then true ; else mkdir $(libsubdir)/include ; fi
79d8453e
RS
1467 -chmod ugo+rx $(libsubdir)/include
1468# Must compute $(libsubdir) before the cd; the awk script won't work after.
1469 shelllibsubdir=$(libsubdir); \
1470 cd $(srcdir); \
1471 for file in $(USER_H); do \
1472 rm -f $$shelllibsubdir/include/`basename $$file`; \
1473 $(INSTALL_DATA) `basename $$file` $$shelllibsubdir/include/`basename $$file`; \
1474 chmod a-x $$shelllibsubdir/include/`basename $$file`; \
1475 done
1476 -rm -f $(libsubdir)/include/varargs.h
1477 $(INSTALL_DATA) $(srcdir)/gvarargs.h $(libsubdir)/include/varargs.h
1478 chmod a-x $(libsubdir)/include/varargs.h
1479 -rm -f $(libsubdir)/include/stdarg.h
1480 $(INSTALL_DATA) $(srcdir)/gstdarg.h $(libsubdir)/include/stdarg.h
1481 chmod a-x $(libsubdir)/include/stdarg.h
1482 -rm -f $(libsubdir)/include/stddef.h
1483 $(INSTALL_DATA) $(srcdir)/gstddef.h $(libsubdir)/include/stddef.h
1484 chmod a-x $(libsubdir)/include/stddef.h
2e494f70
RS
1485# Copy byteorder.h into the object file directory
1486# so that fixinc.svr4 can get at it if necessary.
1487# If the dirs are the same, this won't do anything.
9c0022f6 1488# Delete file first in case it is read-only
9c4614c3
TW
1489 -if [ "$(srcdir)" != "." ]; then rm -f byteorder.h; else true; fi
1490 -cp $(srcdir)/byteorder.h . > /dev/null 2>&1
79d8453e
RS
1491
1492# $(libsubdir)/include:
935e11b0 1493# -if [ -d $(libsubdir)/include ] ; then true ; else mkdir $(libsubdir)/include ; fi
79d8453e
RS
1494# -chmod ugo+rx $(libsubdir)/include
1495
1496# This appears not to work. It isn't clear how to fix it.
2e494f70
RS
1497# $(libsubdir)/include/README: $(libsubdir)/include $(srcdir)/$(FIXINCLUDES)
1498# LIB=$(libsubdir)/include $(srcdir)/$(FIXINCLUDES)
79d8453e
RS
1499# $(INSTALL_DATA) $(srcdir)/fixincludes-README $@
1500# chmod a-x $@
1501
1502# Run fixincludes in the proper directory.
1503install-fixincludes: install-headers
1504 rm -rf $(libsubdir)/tmp
1505 mkdir $(libsubdir)/tmp
1506# Move aside the headers that come from GCC; delete all else.
2e494f70
RS
1507# The sed command gets just the last file name component;
1508# this is necessary because VPATH could add a dirname.
1509# Using basename would be simpler, but some systems don't have it.
1510 cd $(libsubdir)/include; \
1511 for file in $(INSTALLED_H); do \
1512 realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
1513 mv $$realfile ../tmp; \
1514 done; \
1515 rm -rf *
79d8453e
RS
1516# Install fixed copies of system files.
1517 $(srcdir)/$(FIXINCLUDES) $(libsubdir)/include
1518# Bring back gcc's header files.
1519 cd $(libsubdir)/include; mv ../tmp/* .; rmdir ../tmp
1520# Install the README
1521 $(INSTALL_DATA) $(srcdir)/README-fixinc $(libsubdir)/include/README
1522 chmod a-x $(libsubdir)/include/README
1523
2e494f70
RS
1524# Use this target to install the program `collect2' under the name `ld'.
1525install-collect2: collect2
1526 $(INSTALL_PROGRAM) collect2 $(libsubdir)/ld
1527# Install the driver program as $(libsubdir)/gcc for collect2.
1528 -if [ -f gcc-cross ] ; then \
1529 $(INSTALL_PROGRAM) gcc-cross $(libsubdir)/gcc; \
1530 else \
1531 $(INSTALL_PROGRAM) gcc $(libsubdir)/gcc; \
1532 fi
1533
79d8453e
RS
1534# Cancel installation by deleting the installed files.
1535uninstall:
1536 -rm -rf $(libsubdir)
1537 -rm -rf $(bindir)/gcc
79d8453e
RS
1538 -rm -rf $(bindir)/protoize
1539 -rm -rf $(bindir)/unprotoize
1540 -rm -rf $(mandir)/gcc$(manext)
2e494f70 1541 -rm -rf $(mandir)/cccp$(manext)
79d8453e
RS
1542 -rm -rf $(mandir)/protoize$(manext)
1543 -rm -rf $(mandir)/unprotoize$(manext)
1544\f
1545# These exist for maintenance purposes.
1546
1547# Update the tags table.
1548TAGS: force
1549 cd $(srcdir); \
1550 mkdir temp; \
1551 mv -f c-parse.c c-parse.h cp-parse.c cp-parse.h objc-parse.c cexp.c temp; \
1552 etags *.y *.h *.c; \
1553 mv temp/* .; \
1554 rmdir temp
1555
1556# Create the distribution tar file.
1557#dist: gcc-$(version).tar.Z
1558dist: gcc.xtar.Z
1559
2e494f70 1560gcc.xtar.Z: gcc.xtar
79d8453e
RS
1561 compress < gcc.xtar > tmp-gcc.xtar.Z
1562 mv tmp-gcc.xtar.Z gcc.xtar.Z
1563
1564#gcc-$(version).tar.Z: gcc-$(version).tar
1565# compress < gcc-$(version).tar > gcc-$(version).tar.Z
1566
1567#gcc-$(version).tar:
2e0b13db 1568gcc.xtar: doc
f780d21b
RS
1569 if grep -s "for version ${version}" gcc.texi; \
1570 then true; \
1571 else echo "You must update the version number in `gcc.texi'"; \
1572 fi
2e494f70 1573 -rm -rf gcc-$(version) tmp
79d8453e
RS
1574# Put all the files in a temporary subdirectory
1575# which has the name that we want to have in the tar file.
2e494f70
RS
1576 mkdir tmp
1577 mkdir tmp/config
1578 for file in *[0-9a-zA-Z+]; do \
1579 ln $$file tmp || cp $$file tmp; \
1580 done
1581 cd config; \
1582 for file in *[0-9a-zA-Z+]; do \
1583 ln $$file ../tmp/config || cp $$file ../tmp/config; \
79d8453e 1584 done
2e494f70
RS
1585 ln .gdbinit tmp
1586 mv tmp gcc-$(version)
79d8453e 1587# Get rid of everything we don't want in the distribution.
2e494f70 1588 cd gcc-$(version); make -f Makefile.in extraclean
79d8453e
RS
1589# Make the distribution.
1590 tar chf gcc.xtar gcc-$(version)
1591# Get rid of the temporary directory.
1592 rm -rf gcc-$(version)
47547081
RS
1593# Update the version number in README
1594 awk '$$1 " " $$2 " " $$3 == "This directory contains" \
1595 { $$6 = version; print $$0 } \
1596 $$1 " " $$2 " " $$3 != "This directory contains"' \
1597 version=$(version) README > tmp.README
1598 mv tmp.README README
79d8453e
RS
1599
1600# do make -f ../gcc/Makefile maketest DIR=../gcc
1601# in the intended test directory to make it a suitable test directory.
1602# THIS IS OBSOLETE; use the -srcdir operand in configure instead.
1603maketest:
1604 ln -s $(DIR)/*.[chy] .
1605 ln -s $(DIR)/configure .
1606 ln -s $(DIR)/*.def .
1607 -rm -f =*
1608 ln -s $(DIR)/.gdbinit .
1609 ln -s $(DIR)/$(FIXINCLUDES) .
1610 -ln -s $(DIR)/bison.simple .
1611 ln -s $(DIR)/config .
1612 ln -s $(DIR)/move-if-change .
1613# The then and else were swapped to avoid a problem on Ultrix.
1614 if [ ! -f Makefile ] ; then ln -s $(DIR)/Makefile .; else false; fi
1615 -rm tm.h aux-output.c config.h md
1616 make clean
1617# You must then run config to set up for compilation.
9c4614c3
TW
1618bootstrap: force
1619# Only build the C compiler for stage1, because that is the only one that
1620# we can guarantee will build with the native compiler, and also it is the
1621# only thing useful for building stage2.
1622 $(MAKE) LANGUAGES=c
79d8453e 1623 $(MAKE) stage1
2e494f70
RS
1624# This used to define ALLOCA as empty, but that would lead to bad results
1625# for a subsequent `make install' since that would not have ALLOCA empty.
1626# To prevent `make install' from compiling alloca.o and then relinking cc1
1627# because alloca.o is newer, we permit these recursive makes to compile
1628# alloca.o. Then cc1 is newer, so it won't have to be relinked.
1629 $(MAKE) CC="stage1/gcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
79d8453e 1630 $(MAKE) stage2
2e494f70 1631 $(MAKE) CC="stage2/gcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
79d8453e
RS
1632
1633bootstrap2: force
2e494f70 1634 $(MAKE) CC="stage1/gcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
79d8453e 1635 $(MAKE) stage2
2e494f70 1636 $(MAKE) CC="stage2/gcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
79d8453e
RS
1637
1638bootstrap3: force
2e494f70 1639 $(MAKE) CC="stage2/gcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
79d8453e 1640
dcfedcd0
RK
1641# Compare the object files in the current directory with those in the
1642# stage2 directory.
1643
1644compare: force
1645 for file in *.o; do \
9d85be6f
RK
1646 tail +10c $$file > tmp-foo1; \
1647 tail +10c stage2/$$file > tmp-foo2; \
1648 cmp tmp-foo1 tmp-foo2 || echo $$file differs; \
dcfedcd0
RK
1649 done
1650 -rm -f tmp-foo*
1651
1652# Similar, but compare with stage3 directory
1653compare3: force
1654 for file in *.o; do \
9d85be6f
RK
1655 tail +10c $$file > tmp-foo1; \
1656 tail +10c stage3/$$file > tmp-foo2; \
1657 cmp tmp-foo1 tmp-foo2 || echo $$file differs; \
dcfedcd0
RK
1658 done
1659 -rm -f tmp-foo*
1660
79d8453e
RS
1661# Copy the object files from a particular stage into a subdirectory.
1662stage1: force
2e494f70 1663 -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
79d8453e
RS
1664 -mv $(STAGESTUFF) stage1
1665 -rm -f stage1/libgcc.a
1666 -cp libgcc.a stage1
1667 -if $(RANLIB_TEST) ; then $(RANLIB) stage1/libgcc.a; else true; fi
1668
1669stage2: force
2e494f70 1670 -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
79d8453e
RS
1671 -mv $(STAGESTUFF) stage2
1672 -rm -f stage2/libgcc.a
1673 -cp libgcc.a stage2
1674 -if $(RANLIB_TEST) ; then $(RANLIB) stage2/libgcc.a; else true; fi
1675
1676stage3: force
935e11b0 1677 -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
79d8453e
RS
1678 -mv $(STAGESTUFF) stage3
1679 -rm -f stage3/libgcc.a
1680 -cp libgcc.a stage3
1681 -if $(RANLIB_TEST) ; then $(RANLIB) stage3/libgcc.a; else true; fi
1682
1683stage4: force
935e11b0 1684 -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
79d8453e
RS
1685 -mv $(STAGESTUFF) stage4
1686 -rm -f stage4/libgcc.a
1687 -cp libgcc.a stage4
1688 -if $(RANLIB_TEST) ; then $(RANLIB) stage4/libgcc.a; else true; fi
1689
1690# Copy just the executable files from a particular stage into a subdirectory,
1691# and delete the object files. Use this if you're just verifying a version
1692# that is pretty sure to work, and you are short of disk space.
1693risky-stage1: force
935e11b0 1694 -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
79d8453e
RS
1695 -mv cc1 cpp cccp gcc stage1
1696 -rm -f stage1/libgcc.a
1697 -cp libgcc.a stage1 && $(RANLIB) stage1/libgcc.a
1698 -make clean
1699
1700risky-stage2: force
935e11b0 1701 -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
79d8453e
RS
1702 -mv cc1 cpp cccp gcc stage2
1703 -rm -f stage2/libgcc.a
1704 -cp libgcc.a stage2 && $(RANLIB) stage2/libgcc.a
1705 -make clean
1706
1707risky-stage3: force
935e11b0 1708 -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
79d8453e
RS
1709 -mv cc1 cpp cccp gcc stage3
1710 -rm -f stage3/libgcc.a
1711 -cp libgcc.a stage3 && $(RANLIB) stage3/libgcc.a
1712 -make clean
1713
1714risky-stage4: force
935e11b0 1715 -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
79d8453e
RS
1716 -mv cc1 cpp cccp gcc stage4
1717 -rm -f stage4/libgcc.a
1718 -cp libgcc.a stage4 && $(RANLIB) stage4/libgcc.a
1719 -make clean
1720
1721#In GNU Make, ignore whether `stage*' exists.
1722.PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
1723.PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
1724
1725force: