xref: /csrg-svn/contrib/gcc-2.3.3/Makefile (revision 61324)
160925Selan# Makefile for GNU C compiler.
260925Selan#   Copyright (C) 1987, 1988, 1990, 1991, 1992 Free Software Foundation, Inc.
360925Selan
460925Selan#This file is part of GNU CC.
560925Selan
660925Selan#GNU CC is free software; you can redistribute it and/or modify
760925Selan#it under the terms of the GNU General Public License as published by
860925Selan#the Free Software Foundation; either version 2, or (at your option)
960925Selan#any later version.
1060925Selan
1160925Selan#GNU CC is distributed in the hope that it will be useful,
1260925Selan#but WITHOUT ANY WARRANTY; without even the implied warranty of
1360925Selan#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1460925Selan#GNU General Public License for more details.
1560925Selan
1660925Selan#You should have received a copy of the GNU General Public License
1760925Selan#along with GNU CC; see the file COPYING.  If not, write to
1860925Selan#the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
1960925Selan
2060925Selan# The targets for external use include:
2160925Selan# all, doc, proto, install, install-cross, install-cross-rest,
2260925Selan# uninstall, TAGS, mostlyclean, clean, distclean, realclean,
2360925Selan# stage1, stage2, stage3, stage4.
2460925Selan
2560925Selan# Suppress smart makes who think they know how to automake Yacc files
2660925Selan.y.c:
2760925Selan
2860925Selan# Variables that exist for you to override.
2960925Selan# See below for how to change them for certain systems.
3060925Selan
3160925Selan# Selection of languages to be made.
32*61324SelanLANGUAGES = c c++
3360925Selan
3460925SelanALLOCA =
3560925SelanALLOCA_FLAGS =
3660925SelanALLOCA_FINISH = true
3760925Selan
3860925Selan# Various ways of specifying flags for compilations:
3960925Selan# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
4060925Selan# BOOT_CFLAGS is the value of CFLAGS to pass
4160925Selan# to the stage2 and stage3 compilations
4260925Selan# XCFLAGS is used for most compilations but not when using the GCC just built.
4360925SelanXCFLAGS =
4460925SelanCFLAGS = -g
4560925SelanBOOT_CFLAGS = -O $(CFLAGS)
4660925Selan# These exists to be overridden by the x-* and t-* files, respectively.
4760925SelanX_CFLAGS =
4860925SelanT_CFLAGS =
4960925Selan
5060925SelanX_CPPFLAGS =
5160925SelanT_CPPFLAGS =
5260925Selan
5360925SelanCC = cc
5460925SelanBISON = bison
5560925SelanBISONFLAGS =
5660925SelanAR = ar
5760925SelanOLDAR_FLAGS = qc
5860925SelanAR_FLAGS = rc
5960925SelanSHELL = /bin/sh
6060925Selan# on sysV, define this as cp.
6160925SelanINSTALL = install -c
6260925Selan# These permit overriding just for certain files.
6360925SelanINSTALL_PROGRAM = $(INSTALL) -m 775
6460925SelanINSTALL_DATA = $(INSTALL) -m 664
6560925SelanSYMLINK = ln -s
6660925Selan
6760925Selan# Define this as & to perform parallel make on a Sequent.
6860925Selan# Note that this has some bugs, and it seems currently necessary
6960925Selan# to compile all the gen* files first by hand to avoid erroneous results.
7060925SelanP =
7160925Selan
7260925Selan# How to invoke ranlib.
7360925SelanRANLIB = ranlib
7460925Selan# Test to use to see whether ranlib exists on the system.
7560925SelanRANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
7660925Selan
7760925Selan# Compiler to use for compiling libgcc1.a.
7860925Selan# OLDCC should not be the GNU C compiler,
7960925Selan# since that would compile typical libgcc1.a functions such as mulsi3
8060925Selan# into infinite recursions.
8160925SelanOLDCC = cc
8260925Selan
8360925Selan# CFLAGS for use with OLDCC, for compiling libgcc1.a.
8460925Selan# NOTE: -O does not work on some Unix systems!
8560925SelanCCLIBFLAGS = -O
8660925Selan
8760925Selan# Version of ar to use when compiling libgcc1.a.
8860925SelanOLDAR = ar
8960925Selan
9060925Selan# The GCC to use for compiling libgcc2.a, enquire, and cross-test.
9160925Selan# Usually the one we just built.
9260925Selan# Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
9360925SelanGCC_FOR_TARGET = ./xgcc -B./
9460925Selan
9560925Selan# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
9660925Selan# It omits XCFLAGS, and specifies -B./.
9760925Selan# It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
9860925SelanGCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(CROSS_GCC_CFLAGS)
9960925Selan
10060925Selan# Special flags for compiling enquire.
10160925Selan# We disable optimization to make floating point more reliable.
10260925SelanENQUIRE_CFLAGS = -DNO_MEM -DNO_STDDEF -DNO_LONG_DOUBLE_IO -O0
10360925SelanENQUIRE_LDFLAGS = $(LDFLAGS)
10460925Selan
10560925Selan# Tools to use when building a cross-compiler.
10660925Selan# These are used because `configure' appends `cross-make'
10760925Selan# to the makefile when making a cross-compiler.
10860925Selan
10960925SelanTARGET_TOOLPREFIX = $(tooldir)/bin/
11060925SelanAR_FOR_TARGET = $(TARGET_TOOLPREFIX)ar
11160925SelanAR_FOR_TARGET_FLAGS = rc
11260925SelanRANLIB_FOR_TARGET = $(TARGET_TOOLPREFIX)ranlib
11360925SelanRANLIB_TEST_FOR_TARGET = [ -f $(TARGET_TOOLPREFIX)ranlib ]
11460925SelanCROSS_TOOLS =
11560925Selan
11660925Selan# Dir to search for system headers.  Overridden by cross-make.
11760925SelanSYSTEM_HEADER_DIR = /usr/include
11860925Selan
11960925Selan# There may be a premade insn-attrtab.c for this machine.
12060925Selan# (You could rebuild it with genattrtab as usual, but it takes a long time.)
12160925Selan# PREMADE_ATTRTAB is the file name of the file to use.
12260925Selan# PREMADE_ATTRTAB_MD is the md file it corresponds to.
12360925SelanPREMADE_ATTRTAB_MD = Makefile  # Guaranteed not to cmp equal to md.
12460925SelanPREMADE_ATTRTAB =
12560925Selan
126*61324Selan
127*61324Selan.if ${MACHINE} == "hp300"
128*61324Selantarget = m68k-hp-bsd
129*61324Selan.elif ${MACHINE} == "luna68k"
130*61324Selantarget =  m68k-omron-bsd
131*61324Selan.elif ${MACHINE} == "mips"
132*61324Selantarget = mips-dec-bsd
133*61324Selan.elif ${MACHINE} == "sparc"
134*61324Selantarget = sparc
135*61324Selan.endif
136*61324Selan
137*61324Selan
138*61324Selan#xmake_file=../Makefile.in
139*61324Selan#tmake_file=../Makefile.in
140*61324Selan
14160925Selanversion=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
14260925Selan
14360925Selan# Directory where sources are, from where we are.
14460925Selansrcdir = .
14560925Selan# Common prefix for installation directories.
14660925Selan# NOTE: This directory must exist when you start installation.
14760925Selanprefix = /usr/libexec
14860925Selan# Directory in which to put host dependent programs and libraries
14960925Selanexec_prefix = $(prefix)/gcc2
15060925Selan# Directory in which to put the executable for the command `gcc'
15160925Selanbindir = $(exec_prefix)
15260925Selan# Directory in which to put the directories used by the compiler.
15360925Selanlibdir = $(exec_prefix)
15460925Selan# Directory in which the compiler finds executables, libraries, etc.
15560925Selanlibsubdir = $(exec_prefix)
15660925Selan# Directory for header file assert.h.
15760925Selan#includedir =
15860925Selan# assertdir is overridden in cross-make.
15960925Selanassertdir = $(includedir)
16060925Selan# Extension (if any) to put in installed man-page filename.
16160925Selanmanext = .0
16260925Selan# Directory in which to put man pages.
16360925Selanmandir = /usr/contrib/man/cat1
16460925Selan# Directory in which to find other cross-compilation tools and headers.
16560925Selan# Used in install-cross.
16660925Selantooldir = $(prefix)/$(target)
16760925Selan# Dir for temp files.
16860925Selantmpdir = /tmp
16960925Selan
17060925SelanGROFF=nroff -man
17160925Selan
17260925Selan# Additional system libraries to link with.
17360925SelanCLIB=
17460925Selan
17560925Selan# Change this to a null string if obstacks are installed in the
17660925Selan# system library.
17760925SelanOBSTACK= obstack.o
17860925Selan
17960925Selan# Specify the rule for actually making libgcc1.a.
18060925Selan# The value may be empty; that means to do absolutely nothing
18160925Selan# with or for libgcc1.a.
182*61324Selan#LIBGCC1 = libgcc1.a
183*61324SelanLIBGCC1 =
18460925Selan
18560925Selan# Specify the rule for actually making libgcc2.a.
18660925SelanLIBGCC2 = libgcc2.a
18760925Selan
18860925Selan# Options to use when compiling libgcc2.a.
18960925Selan# -g1 causes output of debug info only for file-scope entities.
19060925Selan# we use this here because that should be enough, and also
19160925Selan# so that -g1 will be tested.
19260925SelanLIBGCC2_CFLAGS = -O2 $(GCC_CFLAGS) -g1
19360925Selan
19460925Selan# List of extra executables that should be compiled for this target machine
19560925Selan# that are used for compiling from source code to object code.
19660925Selan# The rules for compiling them should be in the t-* file for the machine.
19760925SelanEXTRA_PASSES =
19860925Selan
19960925Selan# Like EXTRA_PASSES, but these are used when linking.
20060925SelanEXTRA_PROGRAMS =
20160925Selan
20260925Selan# List of extra object files that should be compiled for this target machine.
20360925Selan# The rules for compiling them should be in the t-* file for the machine.
20460925SelanEXTRA_PARTS =
20560925Selan
20660925Selan# List of extra object files that should be compiled and linked with
20760925Selan# compiler proper (cc1, cc1obj, cc1plus).
20860925SelanEXTRA_OBJS =
20960925Selan
21060925Selan# List of additional header files to install.
21160925Selan# Often this is edited directly by `configure'.
21260925Selan#EXTRA_HEADERS = math-68881.h
21360925SelanEXTRA_HEADERS =
21460925Selan
21560925Selan# Set this to `ld' to enable use of collect2.
21660925Selan# USE_COLLECT2 =
21760925Selan# It is convenient for configure to add the assignment at the beginning,
21860925Selan# so don't override it here.
21960925Selan
22060925Selan# List of extra C and assembler files to add to libgcc1.a.
22160925Selan# Assembler files should have names ending in `.asm'.
22260925SelanLIB1FUNCS_EXTRA =
22360925Selan
22460925Selan# List of extra C and assembler files to add to libgcc2.a.
22560925Selan# Assembler files should have names ending in `.asm'.
22660925SelanLIB2FUNCS_EXTRA =
22760925Selan
22860925Selan# Program to convert libraries.
22960925SelanLIBCONVERT =
23060925Selan
23160925Selan# Control whether header files are installed.
23260925Selan# We will change this to install-fixincludes eventually.
23360925Selan# It would be useful for people to try this now.
23460925Selan#INSTALL_HEADERS=install-headers
23560925Selan
23660925Selan
23760925Selan# Select which version of fixincludes to use (I.E. regular versus SVR4)
23860925SelanFIXINCLUDES = fixincludes
23960925Selan
24060925Selan# Additional directories of header files to run fixincludes on.
24160925Selan# On most systems, this is empty.
24260925SelanOTHER_FIXINCLUDES_DIRS=
24360925Selan
24460925Selan# List of things which should already be built whenever we try to use xgcc
24560925Selan# to compile anything (without linking).
24660925SelanGCC_PASSES=xgcc cc1 cpp $(EXTRA_PASSES)
24760925Selan
24860925Selan# List of things which should already be built whenever we try to use xgcc
24960925Selan# to link anything.
25060925SelanGCC_PARTS=$(GCC_PASSES) libgcc.a $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS)
25160925Selan
25260925Selan# Directory to link to, when using the target `maketest'.
25360925SelanDIR = ../gcc
25460925Selan
25560925Selan# Flags to use when cross-building GCC.
25660925Selan# Prefix to apply to names of object files when using them
25760925Selan# to run on the machine we are compiling on.
25860925SelanHOST_PREFIX=
25960925Selan# Prefix to apply to names of object files when compiling them
26060925Selan# to run on the machine we are compiling on.
26160925Selan# The default for this variable is chosen to keep these rules
26260925Selan# out of the way of the other rules for compiling the same source files.
26360925SelanHOST_PREFIX_1=loser-
26460925SelanHOST_CC=$(CC)
26560925SelanHOST_CFLAGS=$(ALL_CFLAGS)
26660925SelanHOST_CLIB=$(CLIB)
26760925SelanHOST_LDFLAGS=$(LDFLAGS)
26860925SelanHOST_CPPFLAGS=$(ALL_CPPFLAGS)
26960925SelanHOST_ALLOCA=$(ALLOCA)
27060925SelanHOST_MALLOC=$(MALLOC)
27160925SelanHOST_OBSTACK=$(OBSTACK)
27260925Selan
27360925Selan# Choose the real default target.
27460925SelanALL=all.internal
27560925Selan
27660925Selan# Choose the real install target.
27760925SelanINSTALL_TARGET=install-native
27860925Selan
27960925Selan# End of variables for you to override.
28060925Selan
28160925Selan# Definition of `all' is here so that new rules inserted by sed
28260925Selan# do not specify the default target.
28360925Selan# The real definition is under `all.internal' (for native compilers)
28460925Selan# or `all.cross' (for cross compilers).
285*61324Selanall: banner all.indirect
28660925Selan
287*61324Selanbanner:
288*61324Selan	@echo Creating gcc for target = $(target)...
289*61324Selan
290*61324Selan
29160925Selan# This tells GNU Make version 3 not to put all variables in the environment.
29260925Selan.NOEXPORT:
29360925Selan
29460925Selan# sed inserts variable overrides after the following line.
29560925Selan####target overrides
29660925Selan####host overrides
29760925Selan####cross overrides
29860925Selan####build overrides
29960925Selan
30060925Selan# Now figure out from those variables how to compile and link.
30160925Selan
30260925Selanall.indirect: $(ALL)
30360925Selan
30460925Selan# IN_GCC tells obstack.h to use gstddef.h.
30560925SelanINTERNAL_CFLAGS = $(CROSS) -DIN_GCC
30660925Selan
30760925Selan# This is the variable actually used when we compile.
30860925SelanALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
30960925Selan
31060925Selan# Likewise.
31160925SelanALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
31260925Selan
31360925Selan# Even if ALLOCA is set, don't use it if compiling with GCC.
31460925SelanUSE_ALLOCA= ` case "${CC}" in "${OLDCC}") echo ${ALLOCA} ;; esac `
31560925SelanUSE_HOST_ALLOCA= ` case "${HOST_CC}"@"${HOST_ALLOCA}" in "${OLDCC}"@?*) echo ${HOST_PREFIX}${HOST_ALLOCA} ;; esac `
31660925SelanUSE_HOST_MALLOC= ` case "${HOST_MALLOC}" in ?*) echo ${HOST_PREFIX}${HOST_MALLOC} ;; esac `
31760925SelanUSE_HOST_OBSTACK= ` case "${HOST_OBSTACK}" in ?*) echo ${HOST_PREFIX}${HOST_OBSTACK} ;; esac `
31860925Selan
31960925Selan# Dependency on obstack, alloca, malloc or whatever library facilities
32060925Selan# are not installed in the system libraries.
32160925Selan# We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
32260925SelanLIBDEPS= $(OBSTACK) $(ALLOCA) $(MALLOC)
32360925Selan
32460925Selan# Likewise, for use in the tools that must run on this machine
32560925Selan# even if we are cross-building GCC.
32660925Selan# We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
32760925SelanHOST_LIBDEPS= $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_ALLOCA) $(HOST_PREFIX)$(HOST_MALLOC)
32860925Selan
32960925Selan# How to link with both our special library facilities
33060925Selan# and the system's installed libraries.
33160925SelanLIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(CLIB)
33260925Selan
33360925Selan# Likewise, for use in the tools that must run on this machine
33460925Selan# even if we are cross-building GCC.
33560925SelanHOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC)  \
33660925Selan	    $(HOST_CLIB)
33760925Selan
33860925SelanHOST_RTL = $(HOST_PREFIX)rtl.o
33960925SelanHOST_RTLANAL = $(HOST_PREFIX)rtlanal.o
34060925SelanHOST_PRINT = $(HOST_PREFIX)print-rtl.o
34160925Selan
34260925Selan# Specify the directories to be searched for header files.
34360925Selan# Both . and srcdir are used, in that order,
34460925Selan# so that tm.h and config.h will be found in the compilation
34560925Selan# subdirectory rather than in the source directory.
34660925SelanINCLUDES = -I. -I$(srcdir) -I$(srcdir)/config
34760925SelanSUBDIR_INCLUDES = -I.. -I../$(srcdir) -I../$(srcdir)/config
34860925Selan
34960925Selan# Always use -I$(srcdir)/config when compiling.
35060925Selan.c.o:
35160925Selan	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
35260925Selan
35360925Selan# This tells GNU make version 3 not to export all the variables
35460925Selan# defined in this file into the environment.
35560925Selan.NOEXPORT:
35660925Selan
35760925Selan# Lists of files for various purposes.
35860925Selan
35960925Selan# A list of all the language-specific executables.
36060925SelanCOMPILERS = cc1 cc1plus cc1obj
36160925Selan
36260925Selan# Language-specific object files for C.
36360925SelanC_OBJS = c-parse.o c-lang.o c-lex.o \
36460925Selan   c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-pragma.o
36560925Selan
36660925Selan# Language-specific object files for Objectionable C.
36760925SelanOBJC_OBJS = objc-parse.o objc-actions.o \
36860925Selan   c-lex.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-pragma.o
36960925Selan
37060925Selan# Language-specific object files for C++.
37160925SelanCPLUS_OBJS = cp-parse.o cp-decl.o cp-decl2.o \
37260925Selan   cp-typeck.o cp-type2.o cp-tree.o cp-ptree.o \
37360925Selan   cp-cvt.o cp-search.o cp-lex.o cp-gc.o cp-call.o \
37460925Selan   cp-class.o cp-init.o cp-method.o cp-except.o \
37560925Selan   cp-expr.o cp-pt.o cp-edsel.o cp-xref.o \
37660925Selan   $(CPLUS_INPUT) cp-spew.o c-common.o
37760925Selan
37860925Selan# Language-independent object files.
37960925SelanOBJS = toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
38060925Selan function.o stmt.o expr.o calls.o expmed.o explow.o optabs.o varasm.o \
38160925Selan rtl.o print-rtl.o rtlanal.o emit-rtl.o \
38260925Selan dbxout.o sdbout.o dwarfout.o xcoffout.o \
38360925Selan integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o \
38460925Selan regclass.o local-alloc.o global.o reload.o reload1.o caller-save.o \
38560925Selan insn-peep.o reorg.o sched.o final.o recog.o reg-stack.o \
38660925Selan insn-recog.o insn-extract.o insn-output.o insn-emit.o \
38760925Selan insn-attrtab.o aux-output.o getpwd.o $(EXTRA_OBJS)
38860925Selan
38960925Selan# GEN files are listed separately, so they can be built before doing parallel
39060925Selan#  makes for cc1 or cc1plus.  Otherwise sequent parallel make attempts to load
39160925Selan#  them before rtl.o is compiled.
39260925SelanGEN= genemit genoutput genrecog genextract genflags gencodes genconfig genpeep
39360925Selan
39460925Selan# Files to be copied away after each stage in building.
39560925SelanSTAGESTUFF = *.o insn-flags.h insn-config.h insn-codes.h \
39660925Selan insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
39760925Selan insn-attr.h insn-attrtab.c \
39860925Selan stamp-flags stamp-config stamp-codes \
39960925Selan stamp-output stamp-recog stamp-emit stamp-extract stamp-peep \
40060925Selan stamp-attr stamp-attrtab stamp-proto \
40160925Selan genemit genoutput genrecog genextract genflags gencodes genconfig genpeep \
40260925Selan genattrtab genattr \
40360925Selan $(GCC_PASSES) $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross cccp \
40460925Selan cc1plus cc1obj enquire protoize unprotoize specs collect2 $(USE_COLLECT2)
40560925Selan
40660925Selan# Members of libgcc1.a.
40760925SelanLIB1FUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
40860925Selan   _lshrsi3 _lshlsi3 _ashrsi3 _ashlsi3 \
40960925Selan   _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 \
41060925Selan   _fixdfsi _fixsfsi _floatsidf _floatsisf _truncdfsf2 _extendsfdf2 \
41160925Selan   _addsf3 _negsf2 _subsf3 _mulsf3 _divsf3 \
41260925Selan   _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \
41360925Selan   _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2
41460925Selan
41560925Selan# Library members defined in libgcc2.c.
41660925SelanLIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
41760925Selan     _lshrdi3 _lshldi3 _ashldi3 _ashrdi3  \
41860925Selan    _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \
41960925Selan    _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \
42060925Selan    __gcc_bcmp _varargs _eprintf _builtin_new _caps_New _builtin_del \
42160925Selan    _bb _shtab _clear_cache _trampoline __main _exit _ctors
42260925Selan
42360925Selan# Header files that are made available under the same name
42460925Selan# to programs compiled with GCC.
42560925SelanUSER_H = va-alpha.h va-i860.h va-i960.h va-mips.h va-m88k.h \
42660925Selan    va-pa.h va-pyr.h va-sparc.h va-spur.h proto.h $(EXTRA_HEADERS)
42760925Selan
42860925Selan# All the header files that are installed for users from GCC itself.
42960925SelanINSTALLED_H = float.h stddef.h stdarg.h varargs.h $(USER_H) limits.h \
43060925Selan    syslimits.h
43160925Selan
43260925Selan# The files that "belong" in CONFIG_H are deliberately omitted
43360925Selan# because having them there would not be useful in actual practice.
43460925Selan# All they would do is cause complete recompilation every time
43560925Selan# one of the machine description files is edited.
43660925Selan# That may or may not be what one wants to do.
43760925Selan# If it is, rm *.o is an easy way to do it.
43860925Selan# CONFIG_H = config.h tm.h
43960925SelanCONFIG_H =
44060925SelanRTL_H = rtl.h rtl.def machmode.h machmode.def
44160925SelanTREE_H = tree.h real.h tree.def machmode.h machmode.def
44260925SelanCPLUS_TREE_H = $(TREE_H) cp-tree.h cp-tree.def
44360925Selan
44460925Selan# Avoid a lot of time thinking about remaking Makefile.in and *.def.
44560925Selan.SUFFIXES: .in .def
44660925Selan
44760925Selanall.internal: start.encap rest.encap
44860925Selan# This is what to compile if making a cross-compiler.
44960925Selanall.cross: native gcc-cross specs libgcc.a cross-test $(EXTRA_PARTS)
45060925Selan# This is what to compile if making gcc with a cross-compiler.
45160925Selanall.build: native xgcc $(EXTRA_PARTS)
45260925Selan# This is what must be made before installing GCC and converting libraries.
45360925Selanstart.encap: native xgcc specs $(LIBGCC1) xlimits.h
45460925Selan# Use this to make a GCC that will be used only to recompile GCC.
45560925Selanfor-bootstrap: start.encap libgcc.a
45660925Selan# These can't be made, with COFF encapsulation, until after GCC can run.
45760925Selanrest.encap: libgcc.a float.h  $(EXTRA_PARTS)
45860925Selan# This is what is made with the host's compiler
45960925Selan# whether making a cross compiler or not.
46060925Selannative: config.status cpp $(LANGUAGES) $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2)
46160925Selan
46260925Selan# Define the names for selecting languages in LANGUAGES.
46360925SelanC c: cc1
46460925SelanC++ c++: cc1plus
46560925SelanOBJC objc: cc1obj objc-runtime
46660925SelanOBJECTIVE-C objective-c: cc1obj objc-runtime
46760925SelanPROTO: proto
46860925Selan
46960925Selan# Really, really stupid make features, such as SUN's KEEP_STATE, may force
47060925Selan# a target to build even if it is up-to-date.  So we must verify that
47160925Selan# config.status does not exist before failing.
47260925Selanconfig.status:
47360925Selan	@if [ ! -f config.status ] ; then \
47460925Selan	  echo You must configure gcc.  Look at the INSTALL file for details.; \
47560925Selan	  false; \
47660925Selan	else \
47760925Selan	  true; \
47860925Selan	fi
47960925Selan
48060925Selan# On the target machine, finish building a cross compiler.
48160925Selan# This does the things that can't be done on the host machine.
48260925Selanrest.cross: libgcc.a float.h specs
48360925Selan
48460925Selan# Verify that it works to compile and link cross-test.
48560925Selan# If it does, then there are sufficient replacements for libgcc1.a.
48660925Selancross-test: cross-test.o native gcc-cross libgcc.a
48760925Selan	$(GCC_FOR_TARGET) $(GCC_CFLAGS) cross-test.o -o $@
48860925Selancross-test.o: cross-test.c native gcc-cross
48960925Selan	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -c $(srcdir)/cross-test.c
49060925Selan
49160925Selan# Recompile all the language-independent object files.
49260925Selan# This is used only if the user explicitly asks for it.
49360925Selancompilations: ${OBJS}
49460925Selan
49560925Selan# We call this executable `xgcc' rather than `gcc'
49660925Selan# to avoid confusion if the current directory is in the path
49760925Selan# and CC is `gcc'.  It is renamed to `gcc' when it is installed.
49860925Selanxgcc: gcc.o version.o $(LIBDEPS)
49960925Selan	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o xgcc gcc.o version.o $(LIBS)
50060925Selan
50160925Selan# Dump a specs file to make -B./ read these specs over installed ones.
50260925Selanspecs: xgcc
50360925Selan	./xgcc -dumpspecs > specs
50460925Selan
50560925Selan# We do want to create an executable named `xgcc', so we can use it to
50660925Selan# compile libgcc2.a.
50760925Selan# Also create gcc-cross, so that install-common will install properly.
50860925Selangcc-cross: xgcc
50960925Selan	cp xgcc gcc-cross
51060925Selan
51160925Selancc1:$(P) $(C_OBJS) $(OBJS) $(LIBDEPS)
51260925Selan	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1 $(C_OBJS) $(OBJS) $(LIBS)
51360925Selan
51460925Selancc1plus:$(P) $(CPLUS_OBJS) $(OBJS) $(LIBDEPS)
51560925Selan	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1plus $(CPLUS_OBJS) $(OBJS) $(LIBS)
51660925Selan
51760925Selancc1obj:$(P) $(OBJC_OBJS) $(OBJS) $(LIBDEPS)
51860925Selan	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1obj $(OBJC_OBJS) $(OBJS) $(LIBS)
51960925Selan
52060925Selanfloat.h: enquire
52160925Selan	-./enquire -f > tmp-float.h
52260925Selan	mv tmp-float.h float.h
52360925Selan
52460925Selan# Used to compile enquire with standard cc, but have forgotten why.
52560925Selan# Let's try with GCC.
52660925Selanenquire: enquire.o $(GCC_PARTS)
52760925Selan	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ENQUIRE_LDFLAGS) enquire.o -o $@
52860925Selanenquire.o: $(srcdir)/enquire.c $(GCC_PASSES)
52960925Selan#	-if [ "$(srcdir)" != "." ]; then rm -f ./enquire.c; else true; fi
53060925Selan#	-cp $(srcdir)/enquire.c . > /dev/null 2>&1
53160925Selan# Breaking this line caused a problem with one version of GNU make.
53260925Selan	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(ENQUIRE_CFLAGS) -I. -c $(srcdir)/enquire.c
53360925Selan
53460925Selan# Build the version of limits.h that we will install.
53560925Selanxlimits.h: glimits.h limitx.h limity.h
53660925Selan	if [ -f $(SYSTEM_HEADER_DIR)/limits.h ] ; then \
53760925Selan	  cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > xlimits.h; \
53860925Selan	else \
53960925Selan	  cat $(srcdir)/glimits.h > xlimits.h; \
54060925Selan	fi
54160925Selan
54260925Selan# Build libgcc.a.
54360925Selan# This is done in two parts because some functions, in libgcc1.c,
54460925Selan# must be compiled with something other than GCC,
54560925Selan# while the rest, in libgcc2.c, must be compiled with xgcc.
54660925Selan# That means we can't do libgcc2.c until after xgcc, cc1, etc.
54760925Selan
54860925Selan# Use this as value of LIBGCC1 to cause conversion to GNU library format.
54960925Selan# LIBCONVERT should put its output in libgcc1.conv.
55060925Selanlibgcc1.conv: libgcc1.a
55160925Selan	$(LIBCONVERT) libgcc1.a libgcc1.conv
55260925Selan
55360925Selan# Use this as value of LIBGCC1 to inhibit use of libgcc1.c entirely.
55460925Selan# Make an empty file instead.
55560925Selanlibgcc1.null: $(CROSS_TOOLS) $(GCC_PASSES)
55660925Selan	echo "__foo () {}" > dummy.c
55760925Selan	$(GCC_FOR_TARGET) $(GCC_CFLAGS) -c dummy.c
55860925Selan	$(OLDAR) $(OLDAR_FLAGS) libgcc1.null dummy.o
55960925Selan	rm -f dummy.o dummy.c
56060925Selan
56160925Selan# This is $(LIBGCC1) for a cross-compiler.
56260925Selan# We have no automatic way of building libgcc1.a,
56360925Selan# so it's up to the installer to find a way to do that.
56460925Selan# This rule deliberately does not depend on libgcc1.a
56560925Selan# so that it will fail if the installer hasn't provided it.
56660925Selanlibgcc1.cross:
56760925Selan	mv libgcc1.a libgcc1.cross || (echo You must find a way to make libgcc1.a; false)
56860925Selan
56960925Selan# Compile the library of arithmetic subroutines with the native compiler.
57060925Selan# Don't compile it with GCC!
57160925Selan# (That would cause most arithmetic functions to call themselves.)
57260925Selanlibgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1FUNCS_EXTRA) config.status
57360925Selan	-rm -f tmplibgcc1.a
57460925Selan# Actually build it in tmplibgcc1.a, then rename at end,
57560925Selan# so that libgcc1.a itself remains nonexistent if compilation is aborted.
57660925Selan# -e causes any failing command to make this rule fail.
57760925Selan# -e doesn't work in certain shells, so we test $$? as well.
57860925Selan	set -e; \
57960925Selan	for name in $(LIB1FUNCS); \
58060925Selan	do \
58160925Selan	  echo $${name}; \
58260925Selan	  rm -f $${name}.o; \
58360925Selan	  $(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -c -DL$${name} $(srcdir)/libgcc1.c; \
58460925Selan	  if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
58560925Selan	  mv libgcc1.o $${name}.o; \
58660925Selan	  $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}.o; \
58760925Selan	  rm -f $${name}.o; \
58860925Selan	done
58960925Selan# Some shells crash when a loop has no items.
59060925Selan# So make sure there is always at least one--`..'.
59160925Selan# Then ignore it.
59260925Selan# We don't use -e here because there are if statements
59360925Selan# that should not make the command give up when the if condition is false.
59460925Selan# Instead, we test for failure after each command where it matters.
59560925Selan	-for file in .. $(LIB1FUNCS_EXTRA); \
59660925Selan	do \
59760925Selan	  if [ x$${file} != x.. ]; then \
59860925Selan	    name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
59960925Selan	    echo $${name}; \
60060925Selan	    if [ $${name}.asm = $${file} ]; then \
60160925Selan	      cp $${file} $${name}.s || exit 1; file=$${name}.s; \
60260925Selan	    else true; fi; \
60360925Selan	    $(OLDCC) $(CCLIBFLAGS) $(INCLUDES) -c $${file}; \
60460925Selan	    if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
60560925Selan	    $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}.o; \
60660925Selan	    if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
60760925Selan	    rm -f $${name}.[so]; \
60860925Selan	  else true; \
60960925Selan	  fi; \
61060925Selan	done
61160925Selan	mv tmplibgcc1.a libgcc1.a
61260925Selan
61360925Selan# Compiling libgcc2.a requires making sure that cc1, etc. have been compiled.
61460925Selan# But recompiling cc1 should not force recompilation of libgcc2.a.
61560925Selan# If you want to force recompilation, delete libgcc2.a.
61660925Selan# Depend on install-cross-tools to make sure we set up properly
61760925Selan# to run the assembler before we try compiling anything.
61860925Selan# install-cross-tools does nothing if not cross compiling.
61960925Selanlibgcc2.ready: $(GCC_PASSES) $(CROSS_TOOLS)
62060925Selan	-if [ -f libgcc2.ready ] ; then \
62160925Selan		true; \
62260925Selan	else \
62360925Selan		touch libgcc2.ready; \
62460925Selan	fi
62560925Selan
62660925Selanlibgcc2.a: libgcc2.c libgcc2.ready $(CONFIG_H) $(LIB2FUNCS_EXTRA) \
62760925Selan   machmode.h longlong.h gbl-ctors.h config.status
62860925Selan# Actually build it in tmplibgcc2.a, then rename at end,
62960925Selan# so that libgcc2.a itself remains nonexistent if compilation is aborted.
63060925Selan	-rm -f tmplibgcc2.a
63160925Selan# -e causes any failing command to make this rule fail.
63260925Selan# -e doesn't work in certain shells, so we test $$? as well.
63360925Selan	set -e; \
63460925Selan	for name in $(LIB2FUNCS); \
63560925Selan	do \
63660925Selan	  echo $${name}; \
63760925Selan	  $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
63860925Selan	      $(srcdir)/libgcc2.c -o $${name}.o; \
63960925Selan	  if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
64060925Selan	  $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}.o; \
64160925Selan	  rm -f $${name}.o; \
64260925Selan	done
64360925Selan# Some shells crash when a loop has no items.
64460925Selan# So make sure there is always at least one--`..'.
64560925Selan# Then ignore it.
64660925Selan# We don't use -e here because there are if statements
64760925Selan# that should not make the command give up when the if condition is false.
64860925Selan# Instead, we test for failure after each command where it matters.
64960925Selan	-for file in .. $(LIB2FUNCS_EXTRA); \
65060925Selan	do \
65160925Selan	  if [ x$${file} != x.. ]; then \
65260925Selan	    name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
65360925Selan	    echo $${name}; \
65460925Selan	    if [ $${name}.asm = $${file} ]; then \
65560925Selan	      cp $${file} $${name}.s || exit 1; file=$${name}.s; \
65660925Selan	    else true; fi; \
65760925Selan	    $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
65860925Selan	    if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
65960925Selan	    $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}.o; \
66060925Selan	    rm -f $${name}.[so]; \
66160925Selan	  else true; \
66260925Selan	  fi; \
66360925Selan	done
66460925Selan	mv tmplibgcc2.a libgcc2.a
66560925Selan# These lines were deleted from above the mv command
66660925Selan# because ranlibing libgcc.a itself should suffice.
66760925Selan#	-if [ x${HPUX_GAS} = x ] ; then \
66860925Selan#	  if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc2.a; else true; fi \
66960925Selan#	else true; fi
67060925Selan
67160925Selan# Combine the various libraries into a single library, libgcc.a.
67260925Selanlibgcc.a: $(LIBGCC1) $(LIBGCC2)
67360925Selan	-rm -rf tmplibgcc.a libgcc.a tmpcopy
67460925Selan	mkdir tmpcopy
67560925Selan	-if [ x$(LIBGCC1) != x ];			\
67660925Selan	then (cd tmpcopy; $(AR) x ../$(LIBGCC1));	\
67760925Selan	else true;					\
67860925Selan	fi
67960925Selan	(cd tmpcopy; $(AR) x ../$(LIBGCC2))
68060925Selan	(cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *.o)
68160925Selan	rm -rf tmpcopy
68260925Selan	-if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi
68360925Selan# Actually build it in tmplibgcc.a, then rename at end,
68460925Selan# so that libgcc.a itself remains nonexistent if compilation is aborted.
68560925Selan	mv tmplibgcc.a libgcc.a
68660925Selan
68760925Selanobjc-runtime: libobjc.a
68860925Selan
68960925Selan# Build the Objective C runtime library.
69060925Selanlibobjc.a: cc1obj libgcc2.ready
69160925Selan	if [ -d objc ]; then true; else mkdir objc; fi
69260925Selan	thisdir1=`pwd`; \
69360925Selan	srcdir1=`cd $(srcdir); pwd`; \
69460925Selan	cd objc; \
69560925Selan	$(MAKE) -f $${srcdir1}/objc/Makefile libobjc.a \
69660925Selan	  srcdir=$${srcdir1} tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
69760925Selan	  GCC_FOR_TARGET="$${thisdir1}/xgcc -B$${thisdir1}/" \
69860925Selan	  GCC_CFLAGS="$(GCC_CFLAGS)"
69960925Selan	-rm -f libobjc.a
70060925Selan	ln objc/libobjc.a . >/dev/null 2>&1 || cp objc/libobjc.a .
70160925Selan	-if $(RANLIB_TEST) ; then $(RANLIB) libobjc.a; else true; fi
70260925Selan
70360925Selan# This is used by objc/Makefile if the user runs that directly.
70460925Selansublibobjc.a: cc1obj libgcc2.ready
70560925Selan	thisdir1=`pwd`; \
70660925Selan	srcdir1=`cd $(srcdir); pwd`; \
70760925Selan	cd objc; \
70860925Selan	$(MAKE) -f $$srcdir1/objc/Makefile libobjc.a \
70960925Selan	  srcdir=$$srcdir1 tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
71060925Selan	  GCC_FOR_TARGET="$$thisdir1/xgcc -B$$thisdir1/" \
71160925Selan	  GCC_CFLAGS="$(GCC_CFLAGS)"
71260925Selan
71360925Selan# Compile two additional files that are linked with every program
71460925Selan# linked using GCC on system V, for the sake of C++ constructors.
71560925Selancrtbegin.o:	crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h
71660925Selan	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) -DCRT_BEGIN \
71760925Selan	  -finhibit-size-directive -g0 -c $(srcdir)/crtstuff.c -o crtbegin.o
71860925Selan
71960925Selancrtend.o:	crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h
72060925Selan	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) -DCRT_END \
72160925Selan	  -finhibit-size-directive -g0 -c $(srcdir)/crtstuff.c -o crtend.o
72260925Selan
72360925Selan# Compiling object files from source files.
72460925Selan
72560925Selan# Note that dependencies on obstack.h are not written
72660925Selan# because that file is not part of GCC.
72760925Selan# Dependencies on gvarargs.h are not written
72860925Selan# because all that file does, when not compiling with GCC,
72960925Selan# is include the system varargs.h.
73060925Selan
73160925Selan# C language specific files.
73260925Selan
73360925Selanc-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h c-parse.h \
73460925Selan    c-tree.h input.h flags.h
73560925Selan	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
73660925Selan$(srcdir)/c-parse.c $(srcdir)/c-parse.h: $(srcdir)/c-parse.y
73760925Selan	cd $(srcdir); $(BISON) $(BISONFLAGS) -d c-parse.y -o c-parse.c
73860925Selan$(srcdir)/c-parse.y: $(srcdir)/c-parse.in $(srcdir)/cond.awk
73960925Selan	cd $(srcdir); awk -f cond.awk objc=0 c-parse.in > c-parse.y
74060925Selan
74160925Selanc-decl.o : c-decl.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h
74260925Selanc-typeck.o : c-typeck.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h
74360925Selanc-lang.o : c-lang.c $(CONFIG_H) $(TREE_H)
74460925Selanc-lex.o : c-lex.c $(CONFIG_H) $(TREE_H) c-lex.h c-tree.h c-parse.h \
74560925Selan    input.h flags.h
74660925Selanc-aux-info.o : c-aux-info.c  $(CONFIG_H) $(TREE_H) c-tree.h flags.h
74760925Selanc-convert.o : c-convert.c $(CONFIG_H) $(TREE_H) flags.h
74860925Selanc-pragma.o: c-pragma.c $(CONFIG_H) $(TREE_H)
74960925Selan
75060925Selan# C++ language specific files.
75160925Selan
75260925Selancp-parse.o : $(srcdir)/cp-parse.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
75360925Selan	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
75460925Selan  `echo $(srcdir)/cp-parse.c | sed 's,^\./,,'`
75560925Selan
75660925Selan$(srcdir)/cp-parse.c $(srcdir)/cp-parse.h : $(srcdir)/cp-parse.y
75760925Selan	@echo expect 29 shift/reduce conflicts and 14 reduce/reduce conflicts
75860925Selan	cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o cp-parse.c cp-parse.y
75960925Selan	cd $(srcdir); grep '^#define[ 	]*YYEMPTY' cp-parse.c >>cp-parse.h
76060925Selan
76160925Selancp-spew.o : cp-spew.c $(CONFIG_H) $(CPLUS_TREE_H) \
76260925Selan   $(srcdir)/cp-parse.h flags.h
76360925Selancp-lex.o : cp-lex.c $(CONFIG_H) $(CPLUS_TREE_H) \
76460925Selan   $(srcdir)/cp-parse.h $(srcdir)/cp-input.c flags.h
76560925Selancp-decl.o : cp-decl.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h \
76660925Selan  cp-lex.h cp-decl.h stack.h
76760925Selancp-decl2.o : cp-decl2.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h \
76860925Selan  cp-lex.h cp-decl.h
76960925Selancp-type2.o : cp-type2.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
77060925Selancp-typeck.o : cp-typeck.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
77160925Selancp-class.o : cp-class.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h \
77260925Selan    cp-class.h flags.h
77360925Selancp-call.o : cp-call.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h cp-class.h \
77460925Selan    flags.h
77560925Selancp-init.o : cp-init.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
77660925Selancp-method.o : cp-method.c $(CONFIG_H) $(CPLUS_TREE_H)
77760925Selancp-cvt.o : cp-cvt.c $(CONFIG_H) $(CPLUS_TREE_H)
77860925Selancp-search.o : cp-search.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h flags.h
77960925Selancp-tree.o : cp-tree.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
78060925Selancp-ptree.o : cp-ptree.c $(CONFIG_H) $(CPLUS_TREE_H)
78160925Selancp-gc.o : cp-gc.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
78260925Selancp-except.o : cp-except.c $(CONFIG_H) $(CPLUS_TREE_H) flags.h
78360925Selancp-expr.o : cp-expr.c $(CONFIG_H) $(CPLUS_TREE_H) $(RTL_H) flags.h \
78460925Selan  expr.h insn-codes.h
78560925Selancp-edsel.o : cp-edsel.c $(CONFIG_H) $(CPLUS_TREE_H) stack.h flags.h
78660925Selancp-xref.o : cp-xref.c $(CONFIG_H) $(CPLUS_TREE_H)
78760925Selancp-pt.o : cp-pt.c $(CONFIG_H) $(CPLUS_TREE_H) cp-decl.h cp-parse.h
78860925Selan
78960925Selan# To make a configuration always use collect2, set USE_COLLECT2 to ld.
79060925Selanld: collect2
79160925Selan	rm -f ld
79260925Selan	ln collect2 ld
79360925Selan
79460925Selancollect2 : collect2.o version.o $(LIBDEPS)
79560925Selan# Don't try modifying collect2 (aka ld) in place--it might be linking this.
79660925Selan	-rm -f collect2
79760925Selan	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o collect2 collect2.o version.o $(LIBS)
79860925Selan
79960925Selan#  -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\"
80060925Selancollect2.o : collect2.c $(CONFIG_H) gstab.h
80160925Selan	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
80260925Selan  -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
80360925Selan  -DSTANDARD_BIN_PREFIX=\"$(bindir)/\" \
80460925Selan  -DSTANDARD_EXEC_PREFIX=\"/usr/libexec/gcc2/\" \
80560925Selan  -DDEFAULT_TARGET_MACHINE=\"$(target)\" \
80660925Selan  -c `echo $(srcdir)/collect2.c | sed 's,^\./,,'`
80760925Selan
80860925Selan# Objectionable C language specific files.
80960925Selan
81060925Selanobjc-parse.o : $(srcdir)/objc-parse.c $(CONFIG_H) $(TREE_H) c-lex.h \
81160925Selan   c-tree.h input.h flags.h objc-actions.h
81260925Selan	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/objc-parse.c
81360925Selan$(srcdir)/objc-parse.c : $(srcdir)/objc-parse.y
81460925Selan	cd $(srcdir); $(BISON) $(BISONFLAGS) objc-parse.y -o objc-parse.c
81560925Selan$(srcdir)/objc-parse.y: $(srcdir)/c-parse.in $(srcdir)/cond.awk
81660925Selan	cd $(srcdir); awk -f cond.awk objc=1 c-parse.in > objc-parse.y
81760925Selan
81860925Selanobjc-actions.o : objc-actions.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h \
81960925Selan   flags.h objc-actions.h
82060925Selan
82160925Selan# A file used by all variants of C.
82260925Selan
82360925Selanc-common.o : c-common.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h
82460925Selan
82560925Selan# Language-independent files.
82660925Selan
82760925Selan#  -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\"
82860925Selangcc.o: gcc.c $(CONFIG_H) gvarargs.h obstack.h
82960925Selan	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
83060925Selan  -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
83160925Selan   -DSTANDARD_EXEC_PREFIX=\"/usr/libexec/gcc2/\" \
83260925Selan  -DDEFAULT_TARGET_MACHINE=\"$(target)\" \
83360925Selan  -DTOOLDIR=\"$(tooldir)/\" \
83460925Selan  -c `echo $(srcdir)/gcc.c | sed 's,^\./,,'`
83560925Selan
83660925Selandumpvers: dumpvers.c
83760925Selan
83860925Selanversion.o: version.c
83960925Selanobstack.o: obstack.c
84060925Selan
84160925Selantree.o : tree.c $(CONFIG_H) $(TREE_H) gvarargs.h flags.h function.h
84260925Selanprint-tree.o : print-tree.c $(CONFIG_H) $(TREE_H)
84360925Selanstor-layout.o : stor-layout.c $(CONFIG_H) $(TREE_H) function.h
84460925Selanfold-const.o : fold-const.c $(CONFIG_H) $(TREE_H) flags.h
84560925Selantoplev.o : toplev.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h input.h \
84660925Selan   insn-attr.h xcoffout.h
84760925Selan	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
84860925Selan	  $(MAYBE_TARGET_DEFAULT) $(MAYBE_USE_COLLECT2) \
84960925Selan	  -c `echo $(srcdir)/toplev.c | sed 's,^\./,,'`
85060925Selan
85160925Selanrtl.o : rtl.c $(CONFIG_H) $(RTL_H)
85260925Selan
85360925Selanprint-rtl.o : print-rtl.c $(CONFIG_H) $(RTL_H)
85460925Selanrtlanal.o : rtlanal.c $(CONFIG_H) $(RTL_H)
85560925Selan
85660925Selanvarasm.o : varasm.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h function.h \
85760925Selan   defaults.h insn-codes.h expr.h hard-reg-set.h regs.h xcoffout.h
85860925Selanfunction.o : function.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h  \
85960925Selan   insn-flags.h insn-codes.h expr.h regs.h hard-reg-set.h insn-config.h \
86060925Selan   recog.h output.h
86160925Selanstmt.o : stmt.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h  \
86260925Selan   insn-flags.h insn-config.h insn-codes.h hard-reg-set.h expr.h loop.h recog.h
86360925Selanexpr.o : expr.c $(CONFIG_H) $(RTL_H) $(TREE_H) gvarargs.h flags.h function.h  \
86460925Selan   insn-flags.h insn-codes.h expr.h insn-config.h recog.h output.h typeclass.h
86560925Selancalls.o : calls.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h insn-codes.h \
86660925Selan   insn-flags.h
86760925Selanexpmed.o : expmed.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h  \
86860925Selan   insn-flags.h insn-config.h insn-codes.h expr.h recog.h real.h
86960925Selanexplow.o : explow.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h hard-reg-set.h \
87060925Selan   insn-config.h expr.h recog.h insn-flags.h insn-codes.h
87160925Selanoptabs.o : optabs.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h  \
87260925Selan   insn-flags.h insn-config.h insn-codes.h expr.h recog.h
87360925Selandbxout.o : dbxout.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h regs.h \
87460925Selan   insn-config.h reload.h gstab.h xcoffout.h defaults.h output.h
87560925Selansdbout.o : sdbout.c $(CONFIG_H) $(TREE_H) $(RTL_H) gsyms.h flags.h \
87660925Selan   insn-config.h reload.h
87760925Selandwarfout.o : dwarfout.c $(CONFIG_H) $(TREE_H) $(RTL_H) dwarf.h flags.h \
87860925Selan   insn-config.h reload.h output.h defaults.h
87960925Selanxcoffout.o : xcoffout.c $(CONFIG_H) $(TREE_H) $(RTL_H) xcoffout.h flags.h
88060925Selanemit-rtl.o : emit-rtl.c $(CONFIG_H) $(RTL_H) flags.h gvarargs.h function.h  \
88160925Selan   regs.h insn-config.h insn-codes.h real.h expr.h
88260925Selangetpwd.o : getpwd.c $(CONFIG_H)
88360925Selan
88460925Selanintegrate.o : integrate.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h integrate.h \
88560925Selan   insn-flags.h insn-config.h insn-codes.h expr.h real.h function.h
88660925Selan
88760925Selanjump.o : jump.c $(CONFIG_H) $(RTL_H) flags.h hard-reg-set.h regs.h \
88860925Selan   insn-config.h insn-flags.h insn-codes.h expr.h real.h
88960925Selanstupid.o : stupid.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h
89060925Selan
89160925Selancse.o : cse.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h real.h \
89260925Selan   insn-config.h recog.h
89360925Selanloop.o : loop.c $(CONFIG_H) $(RTL_H) flags.h loop.h insn-config.h \
89460925Selan   insn-flags.h insn-codes.h regs.h hard-reg-set.h recog.h expr.h real.h
89560925Selanunroll.o : unroll.c $(CONFIG_H) $(RTL_H) insn-config.h insn-codes.h \
89660925Selan   integrate.h regs.h flags.h expr.h loop.h
89760925Selanflow.o : flow.c $(CONFIG_H) $(RTL_H) flags.h insn-config.h \
89860925Selan   basic-block.h regs.h hard-reg-set.h output.h
89960925Selancombine.o : combine.c $(CONFIG_H) $(RTL_H) gvarargs.h flags.h  \
90060925Selan   insn-config.h insn-flags.h insn-codes.h insn-attr.h regs.h expr.h \
90160925Selan   basic-block.h recog.h real.h
90260925Selanregclass.o : regclass.c $(CONFIG_H) $(RTL_H) hard-reg-set.h flags.h \
90360925Selan   basic-block.h regs.h insn-config.h recog.h reload.h real.h
90460925Selanlocal-alloc.o : local-alloc.c $(CONFIG_H) $(RTL_H) flags.h basic-block.h \
90560925Selan   regs.h hard-reg-set.h insn-config.h recog.h output.h
90660925Selanglobal.o : global.c $(CONFIG_H) $(RTL_H) flags.h  \
90760925Selan   basic-block.h regs.h hard-reg-set.h insn-config.h output.h
90860925Selan
90960925Selanreload.o : reload.c $(CONFIG_H) $(RTL_H) flags.h \
91060925Selan   reload.h recog.h hard-reg-set.h insn-config.h insn-codes.h regs.h real.h
91160925Selanreload1.o : reload1.c $(CONFIG_H) $(RTL_H) flags.h expr.h \
91260925Selan   reload.h regs.h hard-reg-set.h insn-config.h insn-flags.h insn-codes.h \
91360925Selan   basic-block.h recog.h output.h
91460925Selancaller-save.o : caller-save.c $(CONFIG_H) $(RTL_H) flags.h \
91560925Selan   regs.h hard-reg-set.h insn-config.h basic-block.h recog.h reload.h expr.h
91660925Selanreorg.o : reorg.c $(CONFIG_H) $(RTL_H) conditions.h hard-reg-set.h \
91760925Selan   basic-block.h regs.h insn-config.h insn-attr.h insn-flags.h recog.h \
91860925Selan   flags.h output.h
91960925Selansched.o : sched.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h hard-reg-set.h \
92060925Selan   flags.h insn-config.h insn-attr.h
92160925Selanfinal.o : final.c $(CONFIG_H) $(RTL_H) gvarargs.h flags.h regs.h \
92260925Selan   recog.h conditions.h insn-config.h insn-attr.h real.h output.h \
92360925Selan   hard-reg-set.h insn-flags.h insn-codes.h gstab.h xcoffout.h defaults.h
92460925Selanrecog.o : recog.c $(CONFIG_H) $(RTL_H)  \
92560925Selan   regs.h recog.h hard-reg-set.h flags.h insn-config.h insn-attr.h \
92660925Selan   insn-flags.h insn-codes.h real.h
92760925Selanreg-stack.o : reg-stack.c $(CONFIG_H) $(RTL_H) $(TREE_H) \
92860925Selan   regs.h hard-reg-set.h flags.h insn-config.h
92960925Selan
93060925Selanaux-output.o : aux-output.c $(CONFIG_H) \
93160925Selan   $(RTL_H) regs.h hard-reg-set.h real.h insn-config.h conditions.h \
93260925Selan   insn-flags.h output.h insn-attr.h insn-codes.h
93360925Selan
93460925Selan# Normally this target is not used; but it is used if you
93560925Selan# define ALLOCA=alloca.o.  In that case, you must get a suitable alloca.c
93660925Selan# from the GNU Emacs distribution.
93760925Selanalloca.o:	alloca.c
93860925Selan	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ALLOCA_FLAGS) \
93960925Selan	  -Demacs -c `echo $(srcdir)/alloca.c | sed 's,^\./,,'`
94060925Selan	$(ALLOCA_FINISH)
94160925Selan
94260925Selan# Generate header and source files from the machine description,
94360925Selan# and compile them.
94460925Selan
94560925Selan.PRECIOUS: insn-config.h insn-flags.h insn-codes.h \
94660925Selan  insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \
94760925Selan  insn-attr.h insn-attrtab.c
94860925Selan
94960925Selan# The following pair of rules has this effect:
95060925Selan# genconfig is run only if the md has changed since genconfig was last run;
95160925Selan# but the file insn-config.h is touched only when its contents actually change.
95260925Selan
95360925Selan# Each of the other insn-* files is handled by a similar pair of rules.
95460925Selan
95560925Selan# This causes an anomaly in the results of make -n
95660925Selan# because insn-* is older than stamp-*
95760925Selan# and thus make -n thinks that insn-* will be updated
95860925Selan# and force recompilation of things that depend on it.
95960925Selan# We use move-if-changed precisely to avoid such recompilation.
96060925Selan# But there is no way to teach make -n that it will be avoided.
96160925Selan
96260925Selan# Each of the insn-*.[ch] rules has a semicolon at the end,
96360925Selan# for otherwise the system Make on SunOS 4.1 never tries
96460925Selan# to recompile insn-*.o.
96560925Selan
96660925Selaninsn-config.h: stamp-config ;
96760925Selanstamp-config : md genconfig $(srcdir)/move-if-change
96860925Selan	./genconfig md > tmp-config.h
96960925Selan	$(srcdir)/move-if-change tmp-config.h insn-config.h
97060925Selan	touch stamp-config
97160925Selan
97260925Selaninsn-flags.h: stamp-flags ;
97360925Selanstamp-flags : md genflags $(srcdir)/move-if-change
97460925Selan	./genflags md > tmp-flags.h
97560925Selan	$(srcdir)/move-if-change tmp-flags.h insn-flags.h
97660925Selan	touch stamp-flags
97760925Selan
97860925Selaninsn-codes.h: stamp-codes ;
97960925Selanstamp-codes : md gencodes $(srcdir)/move-if-change
98060925Selan	./gencodes md > tmp-codes.h
98160925Selan	$(srcdir)/move-if-change tmp-codes.h insn-codes.h
98260925Selan	touch stamp-codes
98360925Selan
98460925Selaninsn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) expr.h real.h output.h \
98560925Selan  insn-config.h insn-flags.h insn-codes.h
98660925Selan	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c
98760925Selan
98860925Selaninsn-emit.c: stamp-emit ;
98960925Selanstamp-emit : md genemit $(srcdir)/move-if-change
99060925Selan	./genemit md > tmp-emit.c
99160925Selan	$(srcdir)/move-if-change tmp-emit.c insn-emit.c
99260925Selan	touch stamp-emit
99360925Selan
99460925Selaninsn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h recog.h \
99560925Selan  real.h output.h flags.h
99660925Selan	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c
99760925Selan
99860925Selaninsn-recog.c: stamp-recog ;
99960925Selanstamp-recog : md genrecog $(srcdir)/move-if-change
100060925Selan	./genrecog md > tmp-recog.c
100160925Selan	$(srcdir)/move-if-change tmp-recog.c insn-recog.c
100260925Selan	touch stamp-recog
100360925Selan
100460925Selaninsn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H)
100560925Selan	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-extract.c
100660925Selan
100760925Selaninsn-extract.c: stamp-extract ;
100860925Selanstamp-extract : md genextract $(srcdir)/move-if-change
100960925Selan	./genextract md > tmp-extract.c
101060925Selan	$(srcdir)/move-if-change tmp-extract.c insn-extract.c
101160925Selan	touch stamp-extract
101260925Selan
101360925Selaninsn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) regs.h output.h real.h
101460925Selan	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c
101560925Selan
101660925Selaninsn-peep.c: stamp-peep ;
101760925Selanstamp-peep : md genpeep $(srcdir)/move-if-change
101860925Selan	./genpeep md > tmp-peep.c
101960925Selan	$(srcdir)/move-if-change tmp-peep.c insn-peep.c
102060925Selan	touch stamp-peep
102160925Selan
102260925Selaninsn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(RTL_H) regs.h real.h output.h \
102360925Selan     insn-attr.h insn-config.h
102460925Selan	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c
102560925Selan
102660925Selaninsn-attr.h: stamp-attr ;
102760925Selanstamp-attr : md genattr $(srcdir)/move-if-change
102860925Selan	./genattr md > tmp-attr.h
102960925Selan	$(srcdir)/move-if-change tmp-attr.h insn-attr.h
103060925Selan	touch stamp-attr
103160925Selan
103260925Selaninsn-attrtab.c: stamp-attrtab ;
103360925Selanstamp-attrtab : md genattrtab $(srcdir)/move-if-change
103460925Selan	if cmp -s $(PREMADE_ATTRTAB_MD) md;	\
103560925Selan	then					\
103660925Selan	  echo Using $(PREMADE_ATTRTAB);	\
103760925Selan	  cp $(PREMADE_ATTRTAB) tmp-attrtab.c;	\
103860925Selan	else					\
103960925Selan	  ./genattrtab md > tmp-attrtab.c;	\
104060925Selan	fi
104160925Selan	$(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
104260925Selan	touch stamp-attrtab
104360925Selan
104460925Selaninsn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) regs.h real.h conditions.h \
104560925Selan    hard-reg-set.h insn-config.h insn-flags.h insn-attr.h output.h recog.h \
104660925Selan    insn-codes.h
104760925Selan	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c
104860925Selan
104960925Selaninsn-output.c: stamp-output ;
105060925Selanstamp-output : md genoutput $(srcdir)/move-if-change
105160925Selan	./genoutput md > tmp-output.c
105260925Selan	$(srcdir)/move-if-change tmp-output.c insn-output.c
105360925Selan	touch stamp-output
105460925Selan
105560925Selan# Compile the programs that generate insn-* from the machine description.
105660925Selan# They are compiled with $(HOST_CC), and associated libraries,
105760925Selan# since they need to run on this machine
105860925Selan# even if GCC is being compiled to run on some other machine.
105960925Selan
106060925Selan# $(CONFIG_H) is omitted from the deps of the gen*.o
106160925Selan# because these programs don't really depend on anything
106260925Selan# about the target machine.  They do depend on config.h itself,
106360925Selan# since that describes the host machine.
106460925Selan
106560925Selangenconfig : genconfig.o $(HOST_RTL) $(HOST_LIBDEPS)
106660925Selan	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genconfig \
106760925Selan	  genconfig.o $(HOST_RTL) $(HOST_LIBS)
106860925Selan
106960925Selangenconfig.o : genconfig.c $(RTL_H) hconfig.h
107060925Selan	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c
107160925Selan
107260925Selangenflags : genflags.o $(HOST_RTL) $(HOST_LIBDEPS)
107360925Selan	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genflags \
107460925Selan	 genflags.o $(HOST_RTL) $(HOST_LIBS)
107560925Selan
107660925Selangenflags.o : genflags.c $(RTL_H) hconfig.h
107760925Selan	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c
107860925Selan
107960925Selangencodes : gencodes.o $(HOST_RTL) $(HOST_LIBDEPS)
108060925Selan	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o gencodes \
108160925Selan	 gencodes.o $(HOST_RTL) $(HOST_LIBS)
108260925Selan
108360925Selangencodes.o : gencodes.c $(RTL_H) hconfig.h
108460925Selan	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c
108560925Selan
108660925Selangenemit : genemit.o $(HOST_RTL) $(HOST_LIBDEPS)
108760925Selan	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genemit \
108860925Selan	 genemit.o $(HOST_RTL) $(HOST_LIBS)
108960925Selan
109060925Selangenemit.o : genemit.c $(RTL_H) hconfig.h
109160925Selan	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c
109260925Selan
109360925Selangenrecog : genrecog.o $(HOST_RTL) $(HOST_LIBDEPS)
109460925Selan	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genrecog \
109560925Selan	 genrecog.o $(HOST_RTL) $(HOST_LIBS)
109660925Selan
109760925Selangenrecog.o : genrecog.c $(RTL_H) hconfig.h
109860925Selan	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c
109960925Selan
110060925Selangenextract : genextract.o $(HOST_RTL) $(HOST_LIBDEPS)
110160925Selan	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genextract \
110260925Selan	 genextract.o $(HOST_RTL) $(HOST_LIBS)
110360925Selan
110460925Selangenextract.o : genextract.c $(RTL_H) hconfig.h insn-config.h
110560925Selan	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c
110660925Selan
110760925Selangenpeep : genpeep.o $(HOST_RTL) $(HOST_LIBDEPS)
110860925Selan	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genpeep \
110960925Selan	 genpeep.o $(HOST_RTL) $(HOST_LIBS)
111060925Selan
111160925Selangenpeep.o : genpeep.c $(RTL_H) hconfig.h
111260925Selan	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c
111360925Selan
111460925Selangenattr : genattr.o $(HOST_RTL) $(HOST_LIBDEPS)
111560925Selan	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattr \
111660925Selan	 genattr.o $(HOST_RTL) $(HOST_LIBS)
111760925Selan
111860925Selangenattr.o : genattr.c $(RTL_H) hconfig.h
111960925Selan	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c
112060925Selan
112160925Selangenattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBDEPS)
112260925Selan	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genattrtab \
112360925Selan	 genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBS)
112460925Selan
112560925Selangenattrtab.o : genattrtab.c $(RTL_H) hconfig.h insn-config.h
112660925Selan	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c
112760925Selan
112860925Selangenoutput : genoutput.o $(HOST_RTL) $(HOST_LIBDEPS)
112960925Selan	$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o genoutput \
113060925Selan	 genoutput.o $(HOST_RTL) $(HOST_LIBS)
113160925Selan
113260925Selangenoutput.o : genoutput.c $(RTL_H) hconfig.h
113360925Selan	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c
113460925Selan
113560925Selan# Compile the libraries to be used by gen*.
113660925Selan# If we are not cross-building, gen* use the same .o's that cc1 will use,
113760925Selan# and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict
113860925Selan# with the rules for rtl.o, alloca.o, etc.
113960925Selan$(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(CONFIG_H) $(RTL_H)
114060925Selan	rm -f $(HOST_PREFIX)rtl.c
114160925Selan	sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtl.c > $(HOST_PREFIX)rtl.c
114260925Selan	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtl.c
114360925Selan
114460925Selan$(HOST_PREFIX_1)print-rtl.o: $(srcdir)/print-rtl.c $(CONFIG_H) $(RTL_H)
114560925Selan	rm -f $(HOST_PREFIX)print-rtl.c
114660925Selan	sed -e 's/config[.]h/hconfig.h/' $(srcdir)/print-rtl.c > $(HOST_PREFIX)print-rtl.c
114760925Selan	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)print-rtl.c
114860925Selan
114960925Selan$(HOST_PREFIX_1)rtlanal.o: $(srcdir)/rtlanal.c $(CONFIG_H) $(RTL_H)
115060925Selan	rm -f $(HOST_PREFIX)rtlanal.c
115160925Selan	sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtlanal.c > $(HOST_PREFIX)rtlanal.c
115260925Selan	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtlanal.c
115360925Selan
115460925Selan$(HOST_PREFIX_1)alloca.o: alloca.c
115560925Selan	rm -f $(HOST_PREFIX)alloca.c
115660925Selan	cp $(srcdir)/alloca.c $(HOST_PREFIX)alloca.c
115760925Selan	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c
115860925Selan
115960925Selan$(HOST_PREFIX_1)obstack.o: obstack.c
116060925Selan	rm -f $(HOST_PREFIX)obstack.c
116160925Selan	sed -e 's/config[.]h/hconfig.h/' $(srcdir)/obstack.c > $(HOST_PREFIX)obstack.c
116260925Selan	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c
116360925Selan
116460925Selan$(HOST_PREFIX_1)malloc.o: malloc.c
116560925Selan	rm -f $(HOST_PREFIX)malloc.c
116660925Selan	sed -e 's/config[.]h/hconfig.h/' $(srcdir)/malloc.c > $(HOST_PREFIX)malloc.c
116760925Selan	$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)malloc.c
116860925Selan
116960925Selan# This satisfies the dependency that we get if you cross-compile a compiler
117060925Selan# that does not need to compile alloca, malloc or whatever.
117160925Selan$(HOST_PREFIX_1):
117260925Selan	touch $(HOST_PREFIX_1)
117360925Selan
117460925Selan# Remake cpp and protoize.
117560925Selan
117660925Selan# Making the preprocessor
117760925Selancpp: cccp
117860925Selan	-rm -f cpp
117960925Selan	ln cccp cpp
118060925Selancccp: cccp.o cexp.o version.o $(LIBDEPS)
118160925Selan	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cccp cccp.o cexp.o version.o $(LIBS)
118260925Selancexp.o: $(srcdir)/cexp.c $(CONFIG_H)
118360925Selan	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/cexp.c
118460925Selan$(srcdir)/cexp.c: $(srcdir)/cexp.y
118560925Selan	cd $(srcdir); $(BISON) -o cexp.c cexp.y
118660925Selancccp.o: cccp.c $(CONFIG_H) pcp.h version.c
118760925Selan# The reason we use $(libdir)/g++-include rather than using libsubdir
118860925Selan# is for compatibility with the current version of libg++.
118960925Selan	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
119060925Selan	  -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
119160925Selan	  -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
119260925Selan	  -DLOCAL_INCLUDE_DIR=\"$(prefix)/include\" \
119360925Selan	  -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
119460925Selan	  -DLOCAL_INCLUDE_DIR=\"$(prefix)/include\" \
119560925Selan	  -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
119660925Selan	  -DTOOLDIR=\"$(tooldir)/\" \
119760925Selan	  -c `echo $(srcdir)/cccp.c | sed 's,^\./,,'`
119860925Selan
119960925Selanproto: config.status protoize unprotoize SYSCALLS.c.X
120060925Selan
120160925Selanprotoize: protoize.o getopt.o getopt1.o getpwd.o version.o $(LIBDEPS)
120260925Selan	$(CC) $(ALL_CFLAGS) $(LDFLAGS) \
120360925Selan	  protoize.o getopt.o getopt1.o getpwd.o version.o $(LIBS) -o $@
120460925Selanprotoize.o: stamp-proto ;
120560925Selan
120660925Selanunprotoize: unprotoize.o getopt.o getopt1.o getpwd.o version.o $(LIBDEPS)
120760925Selan	$(CC) $(ALL_CFLAGS) $(LDFLAGS) \
120860925Selan	  unprotoize.o getopt.o getopt1.o getpwd.o version.o $(LIBS) -o $@
120960925Selanunprotoize.o:	stamp-proto ;
121060925Selan
121160925Selanstamp-proto:	$(srcdir)/protoize.c getopt.h $(CONFIG_H)
121260925Selan	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
121360925Selan          -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
121460925Selan          -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
121560925Selan          -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
121660925Selan	  -DLOCAL_INCLUDE_DIR=\"$(prefix)/include\" \
121760925Selan	  -DSTD_PROTO_DIR=\"$(libsubdir)\" \
121860925Selan	  -DUNPROTOIZE $(srcdir)/protoize.c
121960925Selan	mv protoize.o unprotoize.o
122060925Selan	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
122160925Selan          -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
122260925Selan          -DGPLUSPLUS_INCLUDE_DIR=\"$(libdir)/g++-include\" \
122360925Selan          -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
122460925Selan	  -DLOCAL_INCLUDE_DIR=\"$(prefix)/include\" \
122560925Selan	  -DSTD_PROTO_DIR=\"$(libsubdir)\" \
122660925Selan	  $(srcdir)/protoize.c
122760925Selan	touch stamp-proto
122860925Selan
122960925Selangetopt.o: $(srcdir)/getopt.c getopt.h
123060925Selan	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt.c
123160925Selangetopt1.o: $(srcdir)/getopt1.c getopt.h
123260925Selan	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt1.c
123360925Selan
123460925Selan# This info describes the target machine, so compile with GCC just built.
123560925SelanSYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES)
123660925Selan	-rm -f SYSCALLS.c tmp-SYSCALLS.s
123760925Selan	cat $(srcdir)/sys-types.h $(srcdir)/sys-protos.h > SYSCALLS.c
123860925Selan	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
123960925Selan	  -aux-info $@ -S -o tmp-SYSCALLS.s SYSCALLS.c
124060925Selan	-rm -f SYSCALLS.c tmp-SYSCALLS.s
124160925Selan
124260925Selantest-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES)
124360925Selan	-rm -f tmp-proto.[cso]
124460925Selan	cp $(srcdir)/protoize.c tmp-proto.c
124560925Selan	chmod u+w tmp-proto.c
124660925Selan	./protoize -N -B ./ -x getopt.h -c "-B./ -Wall -Wwrite-strings \
124760925Selan	  $(CFLAGS) $(INCLUDES) \
124860925Selan	  -DGCC_INCLUDE_DIR=0 \
124960925Selan	  -DGPLUSPLUS_INCLUDE_DIR=0 \
125060925Selan	  -DCROSS_INCLUDE_DIR=0 \
125160925Selan	  -DSTD_PROTO_DIR=0" tmp-proto.c
125260925Selan	@echo '**********' Expect 400 lines of differences.
125360925Selan	-diff $(srcdir)/protoize.c tmp-proto.c > tmp-proto.diff
125460925Selan	-wc -l tmp-proto.diff
125560925Selan	./unprotoize -N -x getopt.h -c "-B./ -Wall -Wwrite-strings \
125660925Selan	  $(CFLAGS) $(INCLUDES) \
125760925Selan	  -DGCC_INCLUDE_DIR=0 \
125860925Selan	  -DGPLUSPLUS_INCLUDE_DIR=0 \
125960925Selan	  -DCROSS_INCLUDE_DIR=0 \
126060925Selan	  -DSTD_PROTO_DIR=0" tmp-proto.c
126160925Selan	@echo Expect zero differences.
126260925Selan	diff $(srcdir)/protoize.c tmp-proto.c | cat
126360925Selan	-rm -f tmp-proto.[cso]
126460925Selan
126560925Selan# Remake the info files.
126660925Selan
126760925Selandoc: $(srcdir)/cpp.info $(srcdir)/gcc.info $(srcdir)/INSTALL
126860925Selan
126960925Selan$(srcdir)/cpp.info: cpp.texi
127060925Selan	makeinfo `echo $(srcdir)/cpp.texi | sed 's,^\./,,'`
127160925Selan
127260925Selan#$(srcdir)/gplus.info: gplus.texi
127360925Selan#	makeinfo `echo $(srcdir)/gplus.texi | sed 's,^\./,,'`
127460925Selan
127560925Selan$(srcdir)/gcc.info: gcc.texi extend.texi install.texi invoke.texi \
127660925Selan		md.texi rtl.texi tm.texi
127760925Selan	makeinfo `echo $(srcdir)/gcc.texi | sed 's,^\./,,'`
127860925Selan
127960925Selan# This works with GNU Make's default rule.
128060925Selan$(srcdir)/gcc.dvi: gcc.texi extend.texi install.texi invoke.texi \
128160925Selan		md.texi rtl.texi tm.texi
128260925Selan
128360925Selan# This works with GNU Make's default rule.
128460925Selan$(srcdir)/cpp.dvi: cpp.texi
128560925Selan
128660925Selan$(srcdir)/INSTALL: install1.texi install.texi
128760925Selan	makeinfo -D INSTALLONLY --no-header `echo $(srcdir)/install1.texi | sed 's,^\./,,'`
128860925Selan
128960925Selan# Deletion of files made during compilation.
129060925Selan# There are four levels of this:
129160925Selan#   `mostlyclean', `clean', `distclean' and `realclean'.
129260925Selan# `mostlyclean' is useful while working on a particular type of machine.
129360925Selan# It deletes most, but not all, of the files made by compilation.
129460925Selan# It does not delete libgcc.a or its parts, so it won't have to be recompiled.
129560925Selan# `clean' deletes everything made by running `make all'.
129660925Selan# `distclean' also deletes the files made by config.
129760925Selan# `realclean' also deletes everything that could be regenerated automatically.
129860925Selan
129960925Selan
130060925Selanmostlyclean:
130160925Selan	-rm -f $(STAGESTUFF)
130260925Selan# Clean the objc subdir if we created one.
130360925Selan	if [ -d objc ]; then \
130460925Selan	  srcdir1=`cd $(srcdir); pwd`; \
130560925Selan	  cd objc; $(MAKE) -f $$srcdir1/objc/Makefile mostlyclean; \
130660925Selan	else true; fi
130760925Selan	-rm -f libobjc.a
130860925Selan# Delete the temporary source copies for cross compilation.
130960925Selan	-rm -f $(HOST_PREFIX_1)rtl.c $(HOST_PREFIX_1)rtlanal.c
131060925Selan	-rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c
131160925Selan	-rm -f $(HOST_PREFIX_1)obstack.c
131260925Selan# Delete the temp files made in the course of building libgcc.a.
131360925Selan	-rm -f tmplibgcc* tmpcopy xlimits.h
131460925Selan	for name in $(LIB1FUNCS); do rm -f $${name}.c; done
131560925Selan# Delete other temporary files.
131660925Selan	-rm -f tmp-float.h tmp-gcc.xtar.Z
131760925Selan	-rm -f tmp-foo1 tmp-foo2 tmp-proto.* tmp-unproto.1 tmp-SYSCALLS.s
131860925Selan# Delete the stamp files.
131960925Selan	-rm -f stamp-* tmp-*
132060925Selan# Delete debugging dump files.
132160925Selan	-rm -f *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop
132260925Selan	-rm -f *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack
132360925Selan# Delete some files made during installation.
132460925Selan	-rm -f specs float.h enquire SYSCALLS.c.X SYSCALLS.c
132560925Selan	-rm -f collect collect2 ld mips-tfile mips-tdump alloca.s
132660925Selan# Delete unwanted output files from TeX.
132760925Selan	-rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
132860925Selan# Delete sorted indices we don't actually use.
132960925Selan	-rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns
133060925Selan# Delete core dumps.
133160925Selan	-rm -f core config/core
133260925Selan
133360925Selan# Delete all files made by compilation
133460925Selan# that don't exist in the distribution.
133560925Selanclean: mostlyclean
133660925Selan# It may not be quite desirable to delete unprotoize.c here,
133760925Selan# but the spec for `make clean' requires it.
133860925Selan# Using unprotoize.c is not quite right in the first place,
133960925Selan# but what better way is there?
134060925Selan	-rm -f libgcc.a libgcc1.a libgcc2.a libgcc2.ready libgcc1.null
134160925Selan	-rm -f *.dvi
134260925Selan
134360925Selan# Delete all files that users would normally create
134460925Selan# while building and installing GCC.
134560925Selandistclean: clean
134660925Selan	-rm -f tm.h aux-output.c config.h md config.status tconfig.h hconfig.h
134760925Selan	-rm -f Makefile *.oaux
134860925Selan	-rm -fr stage1 stage2 stage3 stage4
134960925Selan
135060925Selan# Delete anything likely to be found in the source directory
135160925Selan# that shouldn't be in the distribution.
135260925Selanextraclean: distclean
135360925Selan	-rm -rf =* #* *~* config/=* config/#* config/*~*
135460925Selan	-rm -f patch* *.orig *.rej config/patch* config/*.orig config/*.rej
135560925Selan	-rm -f *.dvi *.oaux *.d *.Z *.tar *.xtar *diff
135660925Selan	-rm -f *lose config/*lose
135760925Selan	-rm -f *.s *.s[0-9] *.i install1.texi config/ChangeLog
135860925Selan
135960925Selan# Get rid of every file that's generated from some other file.
136060925Selan# Most of these files ARE PRESENT in the GCC distribution.
136160925Selanrealclean: distclean
136260925Selan	-rm -f c-parse.y objc-parse.y
136360925Selan	-rm -f cp-parse.c cp-parse.h cp-parse.output
136460925Selan	-rm -f objc-parse.c objc-parse.output
136560925Selan	-rm -f c-parse.c c-parse.h c-parse.output
136660925Selan	-rm -f cexp.c cexp.output TAGS
136760925Selan	-rm -f cpp.info* cpp.??s cpp.*aux
136860925Selan	-rm -f gcc.info* gcc.??s gcc.*aux
136960925Selan	-rm -f gplus.info* gplus.??s gplus.*aux
137060925Selan
137160925Selan# Entry points `install' and `uninstall'.
137260925Selan# Also temporarily `install-fixincludes' could replace `install-headers'.
137360925Selan# Also use `install-collect2' to install collect2 when the config files don't.
137460925Selan
137560925Selan# The semicolon is to prevent the install.sh -> install default rule
137660925Selan# from doing anything.
137760925Selaninstall: $(INSTALL_TARGET) ;
137860925Selan
137960925Selan# Copy the files of native compiler into directories where they will be run.
138060925Selaninstall-native: install-common install-man install-libgcc
138160925Selan
138260925Selan# Copy the files of cross compiler into directories where they will be run.
138360925Selaninstall-cross: install-common install-common-headers \
138460925Selan   install-man install-cross-tools install-libgcc
138560925Selan
138660925Selan# Do nothing while making gcc with a cross-compiler. The person who
138760925Selan# makes gcc for the target machine has to know how to put a complete
138860925Selan# gcc together by hand.
138960925Selaninstall-build: force
139060925Selan	@echo You have to install gcc on your target machine by hand.
139160925Selan
139260925Selan# Install the tools, libraries and header files for the target machine
139360925Selan# where cross-compilation will look for them.
139460925Selan# Use tooldir to find them.
139560925Selaninstall-cross-tools: install-dir
139660925Selan# The first if makes this a no-op except for a cross compiler.
139760925Selan# The /. after the dirname causes test to follow symlinks.
139860925Selan# Before making a link or an indirection script,
139960925Selan# we verify the desired file does not already exist.
140060925Selan# If a symlink does exist, then making a symlink would certainly fail,
140160925Selan# leading us to overwrite the real file through the symlink.
140260925Selan	-if [ -f gcc-cross ] ; \
140360925Selan	then \
140460925Selan	  if [ -d $(tooldir)/. ] ; \
140560925Selan	  then \
140660925Selan	    for file in as ld ar nm ranlib; do \
140760925Selan	      if [ -f $(libsubdir)/$$file ] ; \
140860925Selan	      then true; \
140960925Selan	      else  \
141060925Selan		rm -rf $(libsubdir)/$$file; \
141160925Selan		$(SYMLINK) $(tooldir)/bin/$$file $(libsubdir)/$$file \
141260925Selan		|| (echo "#!/bin/sh"; echo $(tooldir)/bin/$$file "$$@") > $(libsubdir)/$$file; \
141360925Selan	      fi; \
141460925Selan	    done; \
141560925Selan	    for file in $(tooldir)/lib/*; do \
141660925Selan	      if [ -f $$file ] ; \
141760925Selan	      then \
141860925Selan		if [ -f $(libsubdir)/`basename $$file` ] ; \
141960925Selan		then true; \
142060925Selan		else  \
142160925Selan		  rm -rf $(libsubdir)/`basename $$file`; \
142260925Selan		  $(SYMLINK) $$file $(libsubdir)/`basename $$file` \
142360925Selan		  || $(INSTALL_DATA) $$file $(libsubdir)/`basename $$file`; \
142460925Selan		fi; \
142560925Selan	      else true; \
142660925Selan	      fi; \
142760925Selan	    done; \
142860925Selan	    if [ -d $(tooldir)/include/. ] ; then \
142960925Selan	      rm -rf $(libsubdir)/sys-include; \
143060925Selan	      $(SYMLINK) $(tooldir)/include $(libsubdir)/sys-include \
143160925Selan	      || (if [ -d $(libsubdir)/sys-include ] ; then true ; else mkdir $(libsubdir)/sys-include ; fi; \
143260925Selan		  (cd $(tooldir)/include; tar cf - .) | (cd $(libsubdir)/sys-include; tar xpf -)); \
143360925Selan	    else true; fi; \
143460925Selan	  else true; \
143560925Selan	  fi; \
143660925Selan	else true; \
143760925Selan	fi;
143860925Selan
143960925Selan# Run this on the target machine
144060925Selan# to finish installation of cross compiler.
144160925Selaninstall-cross-rest: install-float-h-cross
144260925Selan
144360925Selan# Install float.h for cross compiler.
144460925Selan# Run this on the target machine!
144560925Selaninstall-float-h-cross:
144660925Selan# I don't see what this line is for.
144760925Selan# If you see what good it does, please tell me.  -- rms.
144860925Selan	if [ -f enquire ] ; then true; else false; fi
144960925Selan	-./enquire -f > $(tmpdir)/float.h
145060925Selan	-rm -f $(libsubdir)/include/float.h
145160925Selan	$(INSTALL_DATA) $(tmpdir)/float.h $(libsubdir)/include/float.h
145260925Selan	-rm -f $(tmpdir)/float.h
145360925Selan	chmod a-x $(libsubdir)/include/float.h
145460925Selan
145560925Selan# Create the installation directory.
145660925Selaninstall-dir:
145760925Selan	-if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; fi
145860925Selan
145960925Selan# Install the compiler executables built during cross compilation.
146060925Selan# Deps on  $(srcdir)/g++ $(srcdir)/c++  would be natural here,
146160925Selan# but the latter would get confused with the target `c++'.
146260925Selan#install-common: native install-dir xgcc $(EXTRA_PARTS)
146360925Selaninstall-common: install-dir xgcc $(EXTRA_PARTS)
146460925Selan	for file in $(COMPILERS); do \
146560925Selan	  if [ -f $$file ] ; then \
146660925Selan	    rm -f $(libsubdir)/$$file; \
146760925Selan	    $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
146860925Selan	  else true; \
146960925Selan	  fi; \
147060925Selan	done
147160925Selan	for file in $(EXTRA_PASSES) $(EXTRA_PARTS) $(EXTRA_PROGRAMS) $(USE_COLLECT2) ..; do \
147260925Selan	  if [ x"$$file" != x.. ]; then \
147360925Selan	    rm -f $(libsubdir)/$$file; \
147460925Selan	    $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
147560925Selan	  else true; fi; \
147660925Selan	done
147760925Selan# Don't mess with specs if it doesn't exist yet.
147860925Selan	-if [ -f specs ] ; then \
147960925Selan	  rm -f $(libsubdir)/specs; \
148060925Selan	  $(INSTALL_DATA) specs $(libsubdir)/specs; \
148160925Selan	fi
148260925Selan# Install the driver program as gcc-$(target)
148360925Selan# and also as either gcc (if native) or $(tooldir)/bin/gcc.
148460925Selan	-if [ -f gcc-cross ] ; then \
148560925Selan	  $(INSTALL_PROGRAM) gcc-cross $(bindir)/gcc-$(target); \
148660925Selan	  if [ -d $(tooldir)/bin/. ] ; then \
148760925Selan	    rm -f $(tooldir)/bin/gcc; \
148860925Selan	    $(INSTALL_PROGRAM) gcc-cross $(tooldir)/bin/gcc; \
148960925Selan	  else true; fi; \
149060925Selan	else \
149160925Selan	  rm -f $(bindir)/gcc; \
149260925Selan	  $(INSTALL_PROGRAM) xgcc $(bindir)/gcc-2.3.3; \
149360925Selan	  ln -s /usr/bin/gcc $(bindir)/gcc-2.3.3 \
149460925Selan	  rm -f $(bindir)/gcc-$(target)-1; \
149560925Selan	  ln $(bindir)/gcc-2.3.3 $(bindir)/gcc-$(target)-1; \
149660925Selan	  mv $(bindir)/gcc-$(target)-1 $(bindir)/gcc-$(target); \
149760925Selan	fi
149860925Selan# Install protoize if it was compiled.
149960925Selan	-if [ -f protoize ]; \
150060925Selan	then \
150160925Selan	    rm -f $(bindir)/protoize-2.3.3; \
150260925Selan	    $(INSTALL_PROGRAM) protoize $(bindir)/protoize-2.3.3; \
150360925Selan	    rm -f $(bindir)/unprotoize; \
150460925Selan	    $(INSTALL_PROGRAM) unprotoize $(bindir)/unprotoize-2.3.3; \
150560925Selan	    rm -f $(libsubdir)/SYSCALLS.c.X; \
150660925Selan	    $(INSTALL_DATA) SYSCALLS.c.X $(libsubdir)/SYSCALLS.c.X; \
150760925Selan	    -chmod a-x $(libsubdir)/SYSCALLS.c.X; \
150860925Selan	fi
150960925Selan	-rm -f $(bindir)/c++-2.3.3
151060925Selan	$(INSTALL_PROGRAM) $(srcdir)/c++ $(bindir)/c++-2.3.3
151160925Selan	-rm -f $(bindir)/g++-2.3.3
151260925Selan	$(INSTALL_PROGRAM) $(srcdir)/g++ $(bindir)/g++-2.3.3
151360925Selan	-rm -f $(libsubdir)/cpp
151460925Selan	$(INSTALL_PROGRAM) cpp $(libsubdir)/cpp
151560925Selan
151660925Selan# Install the man pages.
151760925Selaninstall-man: install-dir $(srcdir)/gcc.1 $(srcdir)/cccp.1 $(srcdir)/g++.1
151860925Selan	-rm -f $(mandir)/gcc$(manext)
151960925Selan	$(GROFF) gcc.1 > gcc.0
152060925Selan	$(GROFF) cccp.1 > cccp.0
152160925Selan	$(GROFF) g++.1 > g++.0
152260925Selan	-$(INSTALL_DATA) $(srcdir)/gcc.0 $(mandir)/gcc$(manext)
152360925Selan	-chmod a-x $(mandir)/gcc$(manext)
152460925Selan	-rm -f $(mandir)/cccp$(manext) $(mandir)/cpp$(manext)
152560925Selan	-$(INSTALL_DATA) $(srcdir)/cccp.0 $(mandir)/cccp$(manext)
152660925Selan	-chmod a-x $(mandir)/cccp$(manext)
152760925Selan	ln -s $(mandir)/cccp$(manext) $(mandir)/cpp$(manext)
152860925Selan	-$(INSTALL_DATA) $(srcdir)/g++.0 $(mandir)/g++$(manext)
152960925Selan	-chmod a-x $(mandir)/g++$(manext)
153060925Selan
153160925Selan# Install the library.
153260925Selan#install-libgcc: libgcc.a install-dir
153360925Selaninstall-libgcc: install-dir
153460925Selan	-if [ -f libgcc.a ] ; then \
153560925Selan	  rm -f $(libsubdir)/libgcc.a; \
153660925Selan	  $(INSTALL_DATA) libgcc.a $(libsubdir)/libgcc.a; \
153760925Selan	  if $(RANLIB_TEST) ; then \
153860925Selan	    (cd $(libsubdir); $(RANLIB) libgcc.a); else true; fi; \
153960925Selan	  chmod a-x $(libsubdir)/libgcc.a; \
154060925Selan	else true; fi
154160925Selan
154260925Selan# Install the objc run time library.
154360925Selaninstall-libobjc: libobjc.a install-dir
154460925Selan	-if [ -f libobjc.a ] ; then \
154560925Selan	  rm -f $(libsubdir)/libobjc.a; \
154660925Selan	  $(INSTALL_DATA) libobjc.a $(libsubdir)/libobjc.a; \
154760925Selan	  if $(RANLIB_TEST) ; then \
154860925Selan	    (cd $(libsubdir); $(RANLIB) libobjc.a); else true; fi; \
154960925Selan	  chmod a-x $(libsubdir)/libobjc.a; \
155060925Selan	else true; fi
155160925Selan
155260925Selan# Install all the header files for native compiler.
155360925Selaninstall-headers: install-common-headers install-float-h install-limits-h
155460925Selan
155560925Selan# Install float.h for native compiler.
155660925Selaninstall-float-h: float.h install-dir
155760925Selan	-rm -f $(libsubdir)/include/float.h
155860925Selan	$(INSTALL_DATA) float.h $(libsubdir)/include/float.h
155960925Selan	-chmod a-x $(libsubdir)/include/float.h
156060925Selan
156160925Selan# Install limits.h.
156260925Selaninstall-limits-h: xlimits.h install-dir
156360925Selan	-rm -f $(libsubdir)/include/limits.h
156460925Selan	$(INSTALL_DATA) xlimits.h $(libsubdir)/include/limits.h
156560925Selan	-chmod a-x $(libsubdir)/include/limits.h
156660925Selan
156760925Selan# Install the fixed headers that are the same for all machines.
156860925Selaninstall-common-headers: install-dir $(USER_H) gvarargs.h gstdarg.h gstddef.h gsyslimits.h assert.h
156960925Selan	-if [ -d $(libsubdir)/include ] ; then true ; else mkdir $(libsubdir)/include ; fi
157060925Selan	-chmod ugo+rx $(libsubdir)/include
157160925Selan# Must compute $(libsubdir) before the cd; the awk script won't work after.
157260925Selan	-shelllibsubdir=$(libsubdir); \
157360925Selan	cd $(srcdir); \
157460925Selan	for file in $(USER_H); do \
157560925Selan	   rm -f $$shelllibsubdir/include/`basename $$file`; \
157660925Selan	   $(INSTALL_DATA) `basename $$file` $$shelllibsubdir/include/`basename $$file`; \
157760925Selan	   chmod a-x $$shelllibsubdir/include/`basename $$file`; \
157860925Selan	done
157960925Selan# Put assert.h in /usr/local/include, so it won't override GNU libc's assert.h.
158060925Selan# Don't replace the assert.h already there if it is not from GCC.
158160925Selan# This code would be simpler if it tested for -f ... && ! grep ...
158260925Selan# but supposedly the ! operator is missing in sh on some systems.
158360925Selan	-if [ -f $(assertdir)/assert.h ]; \
158460925Selan	then \
158560925Selan	  if grep "__eprintf" $(assertdir)/assert.h; \
158660925Selan	    then \
158760925Selan	    rm -f $(assertdir)/assert.h; \
158860925Selan	    $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \
158960925Selan	    chmod a-x $(assertdir)/assert.h; \
159060925Selan	  else true; \
159160925Selan	  fi; \
159260925Selan	else \
159360925Selan	  rm -f $(assertdir)/assert.h; \
159460925Selan	  $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \
159560925Selan	  chmod a-x $(assertdir)/assert.h; \
159660925Selan	fi
159760925Selan	-rm -f $(libsubdir)/include/syslimits.h
159860925Selan	$(INSTALL_DATA) $(srcdir)/gsyslimits.h $(libsubdir)/include/syslimits.h
159960925Selan	-chmod a-x $(libsubdir)/include/syslimits.h
160060925Selan	-rm -f $(libsubdir)/include/varargs.h
160160925Selan	$(INSTALL_DATA) $(srcdir)/gvarargs.h $(libsubdir)/include/varargs.h
160260925Selan	-chmod a-x $(libsubdir)/include/varargs.h
160360925Selan	-rm -f $(libsubdir)/include/stdarg.h
160460925Selan	$(INSTALL_DATA) $(srcdir)/gstdarg.h $(libsubdir)/include/stdarg.h
160560925Selan	-chmod a-x $(libsubdir)/include/stdarg.h
160660925Selan	-rm -f $(libsubdir)/include/stddef.h
160760925Selan	$(INSTALL_DATA) $(srcdir)/gstddef.h $(libsubdir)/include/stddef.h
160860925Selan	-chmod a-x $(libsubdir)/include/stddef.h
160960925Selan# This is turned off because fixinc.svr4 can now get it directly from srcdir.
161060925Selan## Copy byteorder.h into the object file directory
161160925Selan## so that fixinc.svr4 can get at it if necessary.
161260925Selan## If the dirs are the same, this won't do anything.
161360925Selan## Delete file first in case it is read-only
161460925Selan#	-if [ x`cd $(srcdir);pwd` != x`pwd` ]; then rm -f byteorder.h; else true; fi
161560925Selan#	-cp $(srcdir)/byteorder.h . > /dev/null 2>&1
161660925Selan
161760925Selan# $(libsubdir)/include:
161860925Selan#	-if [ -d $(libsubdir)/include ] ; then true ; else mkdir $(libsubdir)/include ; fi
161960925Selan#	-chmod ugo+rx $(libsubdir)/include
162060925Selan
162160925Selan# This appears not to work.  It isn't clear how to fix it.
162260925Selan# $(libsubdir)/include/README: $(libsubdir)/include $(srcdir)/$(FIXINCLUDES)
162360925Selan#	LIB=$(libsubdir)/include $(srcdir)/$(FIXINCLUDES)
162460925Selan#	$(INSTALL_DATA) $(srcdir)/fixincludes-README $@
162560925Selan#	chmod a-x $@
162660925Selan
162760925Selan# Run fixincludes in the proper directory.
162860925Selaninstall-fixincludes: install-headers
162960925Selan	rm -rf $(libsubdir)/tmp
163060925Selan	mkdir $(libsubdir)/tmp
163160925Selan# Move aside the headers that come from GCC; delete all else.
163260925Selan# The sed command gets just the last file name component;
163360925Selan# this is necessary because VPATH could add a dirname.
163460925Selan# Using basename would be simpler, but some systems don't have it.
163560925Selan	cd $(libsubdir)/include; \
163660925Selan	for file in $(INSTALLED_H); do \
163760925Selan	  realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
163860925Selan	  mv $$realfile ../tmp; \
163960925Selan	done; \
164060925Selan	rm -rf *
164160925Selan# Install fixed copies of system files.
164260925Selan	for dir in $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS); do \
164360925Selan	  if [ -d $$dir ]; \
164460925Selan	  then \
164560925Selan	    $(srcdir)/$(FIXINCLUDES) $(libsubdir)/include $$dir $(srcdir); \
164660925Selan	  else true; fi; \
164760925Selan	done
164860925Selan	-cd $(libsubdir)/include; \
164960925Selan	if [ -f limits.h ]; then \
165060925Selan	  rm -f ../tmp/syslimits.h; \
165160925Selan	  cp limits.h ../tmp/syslimits.h; \
165260925Selan	else true; fi
165360925Selan# Bring back gcc's header files.
165460925Selan	cd $(libsubdir)/include; mv ../tmp/* .; rmdir ../tmp
165560925Selan# Install the README
165660925Selan	$(INSTALL_DATA) $(srcdir)/README-fixinc $(libsubdir)/include/README
165760925Selan	-chmod a-x $(libsubdir)/include/README
165860925Selan
165960925Selan# Use this target to install the program `collect2' under the name `ld'.
166060925Selaninstall-collect2: collect2
166160925Selan	$(INSTALL_PROGRAM) collect2 $(libsubdir)/ld
166260925Selan# Install the driver program as $(libsubdir)/gcc for collect2.
166360925Selan	$(INSTALL_PROGRAM) xgcc $(libsubdir)/gcc
166460925Selan
166560925Selan# Cancel installation by deleting the installed files.
166660925Selanuninstall:
166760925Selan	-rm -rf $(libsubdir)
166860925Selan	-rm -rf $(bindir)/gcc
166960925Selan	-rm -rf $(bindir)/protoize
167060925Selan	-rm -rf $(bindir)/unprotoize
167160925Selan	-rm -rf $(mandir)/gcc$(manext)
167260925Selan	-rm -rf $(mandir)/cccp$(manext)
167360925Selan	-rm -rf $(mandir)/protoize$(manext)
167460925Selan	-rm -rf $(mandir)/unprotoize$(manext)
167560925Selan
167660925Selan# These exist for maintenance purposes.
167760925Selan
167860925Selan# Update the tags table.
167960925SelanTAGS: force
168060925Selan	cd $(srcdir);							\
168160925Selan	mkdir temp;							\
168260925Selan	mv -f c-parse.[ch] cp-parse.[ch] objc-parse.c cexp.c =*.[chy] temp; \
168360925Selan	etags *.y *.h *.c;						\
168460925Selan	mv temp/* .;							\
168560925Selan	rmdir temp
168660925Selan
168760925Selan# Create the distribution tar file.
168860925Selan#dist: gcc-$(version).tar.Z
168960925Selandist: gcc.xtar.Z
169060925Selan
169160925Selangcc.xtar.Z: gcc.xtar
169260925Selan	compress < gcc.xtar > tmp-gcc.xtar.Z
169360925Selan	mv tmp-gcc.xtar.Z gcc.xtar.Z
169460925Selan
169560925Selan#gcc-$(version).tar.Z: gcc-$(version).tar
169660925Selan#	compress < gcc-$(version).tar > gcc-$(version).tar.Z
169760925Selan
169860925Selan#gcc-$(version).tar:
169960925Selangcc.xtar: doc c-parse.y objc-parse.y
170060925Selan	if grep -s "for version ${version}" gcc.texi; \
170160925Selan	then true; \
170260925Selan	else echo "You must update the version number in \`gcc.texi'"; sleep 10;\
170360925Selan	fi
170460925Selan# Update the version number in README
170560925Selan	awk '$$1 " " $$2 " " $$3 == "This directory contains" \
170660925Selan		{ $$6 = version; print $$0 } \
170760925Selan	     $$1 " " $$2 " " $$3 != "This directory contains"' \
170860925Selan	  version=$(version) README > tmp.README
170960925Selan	mv tmp.README README
171060925Selan	-rm -rf gcc-$(version) tmp
171160925Selan# Put all the files in a temporary subdirectory
171260925Selan# which has the name that we want to have in the tar file.
171360925Selan	mkdir tmp
171460925Selan	mkdir tmp/config
171560925Selan	mkdir tmp/objc
171660925Selan	for file in *[0-9a-zA-Z+]; do \
171760925Selan	  ln $$file tmp > /dev/null 2>&1 || cp $$file tmp; \
171860925Selan	done
171960925Selan	cd config; \
172060925Selan	for file in *[0-9a-zA-Z+]; do \
172160925Selan	  ln $$file ../tmp/config >/dev/null 2>&1 || cp $$file ../tmp/config; \
172260925Selan	done
172360925Selan	cd objc; \
172460925Selan	for file in *[0-9a-zA-Z+]; do \
172560925Selan	  ln $$file ../tmp/objc >/dev/null 2>&1 || cp $$file ../tmp/objc; \
172660925Selan	done
172760925Selan	ln .gdbinit tmp
172860925Selan	mv tmp gcc-$(version)
172960925Selan# Get rid of everything we don't want in the distribution.
173060925Selan	cd gcc-$(version); make -f Makefile.in extraclean
173160925Selan# Make the distribution.
173260925Selan	tar chf gcc.xtar gcc-$(version)
173360925Selan# Get rid of the temporary directory.
173460925Selan	rm -rf gcc-$(version)
173560925Selan
173660925Selan# do make -f ../gcc/Makefile maketest DIR=../gcc
173760925Selan# in the intended test directory to make it a suitable test directory.
173860925Selan# THIS IS OBSOLETE; use the -srcdir operand in configure instead.
173960925Selanmaketest:
174060925Selan	ln -s $(DIR)/*.[chy] .
174160925Selan	ln -s $(DIR)/configure .
174260925Selan	ln -s $(DIR)/*.def .
174360925Selan	-rm -f =*
174460925Selan	ln -s $(DIR)/.gdbinit .
174560925Selan	ln -s $(DIR)/$(FIXINCLUDES) .
174660925Selan	-ln -s $(DIR)/bison.simple .
174760925Selan	ln -s $(DIR)/config .
174860925Selan	ln -s $(DIR)/move-if-change .
174960925Selan# The then and else were swapped to avoid a problem on Ultrix.
175060925Selan	if [ ! -f Makefile ] ; then ln -s $(DIR)/Makefile .; else false; fi
175160925Selan	-rm tm.h aux-output.c config.h md
175260925Selan	make clean
175360925Selan# You must then run config to set up for compilation.
175460925Selan
175560925Selanbootstrap: force
175660925Selan# Only build the C compiler for stage1, because that is the only one that
175760925Selan# we can guarantee will build with the native compiler, and also it is the
175860925Selan# only thing useful for building stage2.
175960925Selan	$(MAKE) LANGUAGES=c
176060925Selan	$(MAKE) stage1
176160925Selan# This used to define ALLOCA as empty, but that would lead to bad results
176260925Selan# for a subsequent `make install' since that would not have ALLOCA empty.
176360925Selan# To prevent `make install' from compiling alloca.o and then relinking cc1
176460925Selan# because alloca.o is newer, we permit these recursive makes to compile
176560925Selan# alloca.o.  Then cc1 is newer, so it won't have to be relinked.
176660925Selan	$(MAKE) CC="stage1/xgcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
176760925Selan	$(MAKE) stage2
176860925Selan	$(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
176960925Selan
177060925Selanbootstrap2: force
177160925Selan	$(MAKE) CC="stage1/xgcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
177260925Selan	$(MAKE) stage2
177360925Selan	$(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
177460925Selan
177560925Selanbootstrap3: force
177660925Selan	$(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" libdir=$(libdir) LANGUAGES="$(LANGUAGES)"
177760925Selan
177860925Selan# Compare the object files in the current directory with those in the
177960925Selan# stage2 directory.
178060925Selan
178160925Selancompare: force
178260925Selan	for file in *.o; do \
178360925Selan	  tail +16c $$file > tmp-foo1; \
178460925Selan	  tail +16c stage2/$$file > tmp-foo2 2>/dev/null \
178560925Selan	    && (cmp tmp-foo1 tmp-foo2 || echo $$file differs); \
178660925Selan	done
178760925Selan	-rm -f tmp-foo*
178860925Selan
178960925Selan# Similar, but compare with stage3 directory
179060925Selancompare3: force
179160925Selan	for file in *.o; do \
179260925Selan	  tail +16c $$file > tmp-foo1; \
179360925Selan	  tail +16c stage3/$$file > tmp-foo2 2>/dev/null \
179460925Selan	    && (cmp tmp-foo1 tmp-foo2 || echo $$file differs); \
179560925Selan	done
179660925Selan	-rm -f tmp-foo*
179760925Selan
179860925Selan# Copy the object files from a particular stage into a subdirectory.
179960925Selanstage1: force
180060925Selan	-if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
180160925Selan	-mv $(STAGESTUFF) stage1
180260925Selan	-rm -f stage1/libgcc.a
180360925Selan	-cp libgcc.a stage1
180460925Selan	-if $(RANLIB_TEST) ; then $(RANLIB) stage1/libgcc.a; else true; fi
180560925Selan
180660925Selanstage2: force
180760925Selan	-if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
180860925Selan	-mv $(STAGESTUFF) stage2
180960925Selan	-rm -f stage2/libgcc.a
181060925Selan	-cp libgcc.a stage2
181160925Selan	-if $(RANLIB_TEST) ; then $(RANLIB) stage2/libgcc.a; else true; fi
181260925Selan
181360925Selanstage3: force
181460925Selan	-if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
181560925Selan	-mv $(STAGESTUFF) stage3
181660925Selan	-rm -f stage3/libgcc.a
181760925Selan	-cp libgcc.a stage3
181860925Selan	-if $(RANLIB_TEST) ; then $(RANLIB) stage3/libgcc.a; else true; fi
181960925Selan
182060925Selanstage4: force
182160925Selan	-if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
182260925Selan	-mv $(STAGESTUFF) stage4
182360925Selan	-rm -f stage4/libgcc.a
182460925Selan	-cp libgcc.a stage4
182560925Selan	-if $(RANLIB_TEST) ; then $(RANLIB) stage4/libgcc.a; else true; fi
182660925Selan
182760925Selan# Copy just the executable files from a particular stage into a subdirectory,
182860925Selan# and delete the object files.  Use this if you're just verifying a version
182960925Selan# that is pretty sure to work, and you are short of disk space.
183060925Selanrisky-stage1: force
183160925Selan	-if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
183260925Selan	-mv cc1 cpp cccp gcc stage1
183360925Selan	-rm -f stage1/libgcc.a
183460925Selan	-cp libgcc.a stage1 && $(RANLIB) stage1/libgcc.a
183560925Selan	-make clean
183660925Selan
183760925Selanrisky-stage2: force
183860925Selan	-if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
183960925Selan	-mv cc1 cpp cccp gcc stage2
184060925Selan	-rm -f stage2/libgcc.a
184160925Selan	-cp libgcc.a stage2 && $(RANLIB) stage2/libgcc.a
184260925Selan	-make clean
184360925Selan
184460925Selanrisky-stage3: force
184560925Selan	-if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
184660925Selan	-mv cc1 cpp cccp gcc stage3
184760925Selan	-rm -f stage3/libgcc.a
184860925Selan	-cp libgcc.a stage3 && $(RANLIB) stage3/libgcc.a
184960925Selan	-make clean
185060925Selan
185160925Selanrisky-stage4: force
185260925Selan	-if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
185360925Selan	-mv cc1 cpp cccp gcc stage4
185460925Selan	-rm -f stage4/libgcc.a
185560925Selan	-cp libgcc.a stage4 && $(RANLIB) stage4/libgcc.a
185660925Selan	-make clean
185760925Selan
185860925Selan#In GNU Make, ignore whether `stage*' exists.
185960925Selan.PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
186060925Selan.PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
186160925Selan
186260925Selanforce:
1863