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