]> gcc.gnu.org Git - gcc.git/blame - gcc/Makefile.in
(reload.o): Added expr.h to dependencies list.
[gcc.git] / gcc / Makefile.in
CommitLineData
79d8453e 1# Makefile for GNU C compiler.
1496daef 2# Copyright (C) 1987, 88, 90-96, 1997 Free Software Foundation, Inc.
79d8453e
RS
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
940d9d63
RK
18#the Free Software Foundation, 59 Temple Place - Suite 330,
19#Boston MA 02111-1307, USA.
79d8453e
RS
20
21# The targets for external use include:
22# all, doc, proto, install, install-cross, install-cross-rest,
f1908d70 23# uninstall, TAGS, mostlyclean, clean, distclean, maintainer-clean,
79d8453e
RS
24# stage1, stage2, stage3, stage4.
25
2e494f70
RS
26# Suppress smart makes who think they know how to automake Yacc files
27.y.c:
28
79d8453e
RS
29# Variables that exist for you to override.
30# See below for how to change them for certain systems.
31
013a2ee0
DE
32# List of language subdirectories.
33# This is overridden by configure.
34SUBDIRS =
35
79d8453e 36# Selection of languages to be made.
013a2ee0
DE
37# This is overridden by configure.
38LANGUAGES = c objective-c proto
79d8453e 39
5e31e473
RK
40# Selection of languages to be made during stage1 build.
41# This is overridden by configure.
42BOOT_LANGUAGES = c
43
79d8453e 44ALLOCA =
8d86aaea 45ALLOCA_FLAGS =
2a7bccbb 46ALLOCA_FINISH = true
79d8453e
RS
47
48# Various ways of specifying flags for compilations:
49# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
50# BOOT_CFLAGS is the value of CFLAGS to pass
51# to the stage2 and stage3 compilations
52# XCFLAGS is used for most compilations but not when using the GCC just built.
54577c52 53# TCFLAGS is used for compilations with the GCC just built.
79d8453e 54XCFLAGS =
54577c52 55TCFLAGS =
79d8453e
RS
56CFLAGS = -g
57BOOT_CFLAGS = -O $(CFLAGS)
58# These exists to be overridden by the x-* and t-* files, respectively.
59X_CFLAGS =
60T_CFLAGS =
61
62X_CPPFLAGS =
63T_CPPFLAGS =
64
65CC = cc
66BISON = bison
0777e4c6 67BISONFLAGS =
013a2ee0
DE
68LEX = flex
69LEXFLAGS =
79d8453e
RS
70AR = ar
71OLDAR_FLAGS = qc
72AR_FLAGS = rc
73SHELL = /bin/sh
74# on sysV, define this as cp.
75INSTALL = install -c
76# These permit overriding just for certain files.
77INSTALL_PROGRAM = $(INSTALL)
78INSTALL_DATA = $(INSTALL)
fcd40e95 79MAKEINFO = makeinfo
3ef4c269 80MAKEINFOFLAGS =
d8984b6e 81TEXI2DVI = texi2dvi
013a2ee0
DE
82# For GNUmake: let us decide what gets passed to recursive makes.
83MAKEOVERRIDES =
79d8453e
RS
84
85# Define this as & to perform parallel make on a Sequent.
86# Note that this has some bugs, and it seems currently necessary
87# to compile all the gen* files first by hand to avoid erroneous results.
88P =
89
90# How to invoke ranlib.
91RANLIB = ranlib
92# Test to use to see whether ranlib exists on the system.
93RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
94
95# Compiler to use for compiling libgcc1.a.
96# OLDCC should not be the GNU C compiler,
97# since that would compile typical libgcc1.a functions such as mulsi3
98# into infinite recursions.
99OLDCC = cc
100
101# CFLAGS for use with OLDCC, for compiling libgcc1.a.
102# NOTE: -O does not work on some Unix systems!
103CCLIBFLAGS = -O
104
2e494f70 105# Version of ar to use when compiling libgcc1.a.
79d8453e
RS
106OLDAR = ar
107
ba1811f1
ILT
108# Target to use when installing include directory. Either
109# install-headers-tar or install-headers-cpio.
110INSTALL_HEADERS_DIR = install-headers-tar
111
d7371761
RK
112# Header files that are made available under the same name
113# to programs compiled with GCC.
114USER_H = $(srcdir)/ginclude/stdarg.h $(srcdir)/ginclude/stddef.h \
115 $(srcdir)/ginclude/varargs.h $(srcdir)/ginclude/va-alpha.h \
116 $(srcdir)/ginclude/va-h8300.h $(srcdir)/ginclude/va-i860.h \
117 $(srcdir)/ginclude/va-i960.h $(srcdir)/ginclude/va-mips.h \
118 $(srcdir)/ginclude/va-m88k.h $(srcdir)/ginclude/va-pa.h \
119 $(srcdir)/ginclude/va-pyr.h $(srcdir)/ginclude/va-sparc.h \
120 $(srcdir)/ginclude/va-clipper.h $(srcdir)/ginclude/va-spur.h \
121 $(srcdir)/ginclude/iso646.h $(srcdir)/ginclude/va-ppc.h \
f7055b09
JM
122 $(srcdir)/ginclude/proto.h $(srcdir)/ginclude/va-sh.h $(EXTRA_HEADERS) \
123 $(LANG_EXTRA_HEADERS)
d7371761
RK
124
125# Target to use whe installing assert.h. Some systems may
126# want to set this empty.
127INSTALL_ASSERT_H = install-assert-h
128
a2d163c4 129# The GCC to use for compiling libgcc2.a, enquire, and libgcc1-test.
bf428f48 130# Usually the one we just built.
79d8453e 131# Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
f2e663b6 132GCC_FOR_TARGET = ./xgcc -B./
79d8453e
RS
133
134# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
135# It omits XCFLAGS, and specifies -B./.
de9253a0 136# It also specifies -I./include to find, e.g., stddef.h.
54577c52 137GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) -I./include $(TCFLAGS)
79d8453e
RS
138
139# Special flags for compiling enquire.
140# We disable optimization to make floating point more reliable.
0dbb682d 141ENQUIRE_CFLAGS = -DNO_MEM -DNO_LONG_DOUBLE_IO -O0
79d8453e
RS
142ENQUIRE_LDFLAGS = $(LDFLAGS)
143
338023d4 144# Sed command to transform gcc to installed name. Overwritten by configure.
822ef9df 145program_transform_name = -e s,x,x,
8b06b20a 146program_transform_cross_name = -e s,^,$(target_alias)-,
338023d4 147
79d8453e
RS
148# Tools to use when building a cross-compiler.
149# These are used because `configure' appends `cross-make'
150# to the makefile when making a cross-compiler.
151
152TARGET_TOOLPREFIX = $(tooldir)/bin/
153AR_FOR_TARGET = $(TARGET_TOOLPREFIX)ar
154AR_FOR_TARGET_FLAGS = rc
155RANLIB_FOR_TARGET = $(TARGET_TOOLPREFIX)ranlib
156RANLIB_TEST_FOR_TARGET = [ -f $(TARGET_TOOLPREFIX)ranlib ]
79d8453e 157
1402d22c
RS
158# Dir to search for system headers. Overridden by cross-make.
159SYSTEM_HEADER_DIR = /usr/include
160
75b6984c
RS
161# Control whether to run fixproto.
162STMP_FIXPROTO = stmp-fixproto
ac1284f9 163
40dc28fc
ILT
164# Test to see whether <limits.h> exists in the system header files.
165LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
166
20bd0ab1
RS
167# There may be a premade insn-attrtab.c for this machine.
168# (You could rebuild it with genattrtab as usual, but it takes a long time.)
169# PREMADE_ATTRTAB is the file name of the file to use.
170# PREMADE_ATTRTAB_MD is the md file it corresponds to.
171PREMADE_ATTRTAB_MD = Makefile # Guaranteed not to cmp equal to md.
172PREMADE_ATTRTAB =
173
79d8453e 174target= ... `configure' substitutes actual target name here.
8b06b20a 175target_alias= ... `configure' substitutes specified target name here.
79d8453e
RS
176xmake_file= ... `configure' substitutes actual x- file name here.
177tmake_file= ... `configure' substitutes actual t- file name here.
8bd57699
RK
178out_file= ... `configure' substitutes actual out file name here.
179out_object_file= ... `configure' substitutes actual out object file name here.
7ac16ba0
RK
180md_file= ... `configure' substitutes actual md file name here.
181tm_file= ... `configure' substitutes actual tm file name here.
182build_xm_file= ... `configure' substitutes actual build xm- file name here.
183host_xm_file= ... `configure' substitutes actual host xm- file name here.
c40d5de4
RK
184lang_specs_files= ... `configure' substitutes actual lang spec file names here.
185lang_options_files= ... `configure' puts actual lang options file names here.
bb029709 186OBJC_THREAD_FILE= ... `configure' puts actual objc thread file name here.
2c514f26 187version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
1cf94605 188mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
79d8453e
RS
189
190# Directory where sources are, from where we are.
191srcdir = .
192# Common prefix for installation directories.
193# NOTE: This directory must exist when you start installation.
194prefix = /usr/local
c844ddda
RS
195# Directory in which to put localized header files. On the systems with
196# gcc as the native cc, `local_prefix' may not be `prefix' which is
197# `/usr'.
0b2fbcb2
RS
198# NOTE: local_prefix *should not* default from prefix.
199local_prefix = /usr/local
2e494f70
RS
200# Directory in which to put host dependent programs and libraries
201exec_prefix = $(prefix)
79d8453e 202# Directory in which to put the executable for the command `gcc'
2e494f70 203bindir = $(exec_prefix)/bin
79d8453e 204# Directory in which to put the directories used by the compiler.
2e494f70 205libdir = $(exec_prefix)/lib
79d8453e 206# Directory in which the compiler finds executables, libraries, etc.
8b06b20a 207libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(version)
89b3e3b4 208# Directory in which the compiler finds g++ includes.
5d6be9c8
RK
209gxx_include_dir= $(prefix)/include/g++
210# Directory in which the old g++ header files may be found.
211old_gxx_include_dir= $(libdir)/g++-include
49ba557e 212# Directory to search for site-specific includes.
4b7179be 213includedir = $(local_prefix)/include
6204c24f 214# assertdir is overridden in cross-make.
7b4d5f42
RS
215# (But this currently agrees with what is in cross-make.)
216assertdir = $(tooldir)/include
0b2fbcb2
RS
217# where the info files go
218infodir = $(prefix)/info
79d8453e
RS
219# Extension (if any) to put in installed man-page filename.
220manext = .1
173712fb 221objext = .o
aab26e16 222exeext =
173712fb 223
79d8453e
RS
224# Directory in which to put man pages.
225mandir = $(prefix)/man/man1
226# Directory in which to find other cross-compilation tools and headers.
227# Used in install-cross.
8b06b20a 228tooldir = $(exec_prefix)/$(target_alias)
62c13b81
RS
229# Dir for temp files.
230tmpdir = /tmp
79d8453e
RS
231
232# Additional system libraries to link with.
233CLIB=
234
235# Change this to a null string if obstacks are installed in the
236# system library.
237OBSTACK=obstack.o
238
b583eed8
DE
239# Specify the rule for actually making libgcc.a,
240LIBGCC = libgcc.a
241# and the rule for installing it.
242INSTALL_LIBGCC = install-libgcc
243
79d8453e 244# Specify the rule for actually making libgcc1.a.
2e494f70
RS
245# The value may be empty; that means to do absolutely nothing
246# with or for libgcc1.a.
79d8453e
RS
247LIBGCC1 = libgcc1.a
248
b0bfa186
ILT
249# Specify the rule for making libgcc1.a for a cross-compiler.
250# The default rule assumes that libgcc1.a is supplied by the user.
251CROSS_LIBGCC1 = libgcc1.cross
252
79d8453e
RS
253# Specify the rule for actually making libgcc2.a.
254LIBGCC2 = libgcc2.a
255
256# Options to use when compiling libgcc2.a.
257# -g1 causes output of debug info only for file-scope entities.
258# we use this here because that should be enough, and also
259# so that -g1 will be tested.
c92ca241
JW
260LIBGCC2_DEBUG_CFLAGS = -g1
261LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) $(LIBGCC2_DEBUG_CFLAGS) -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED
56f9206d
ILT
262
263# Additional options to use when compiling libgcc2.a.
264# Some targets override this to -Iinclude
265LIBGCC2_INCLUDES =
266
7bb7f3df
RK
267# Additional target-dependent options for compiling libgcc2.a.
268TARGET_LIBGCC2_CFLAGS =
269
56f9206d
ILT
270# Things which must be built before building libgcc2.a.
271# Some targets override this to stmp-int-hdrs
272LIBGCC2_DEPS =
79d8453e 273
0defb1d5
RS
274# Enquire target (This is a variable so that a target can choose not to
275# build it.)
276ENQUIRE = enquire
277
a2d163c4
DE
278# libgcc1-test target (must also be overridable for a target)
279LIBGCC1_TEST = libgcc1-test
0defb1d5 280
79d8453e
RS
281# List of extra executables that should be compiled for this target machine
282# that are used for compiling from source code to object code.
283# The rules for compiling them should be in the t-* file for the machine.
284EXTRA_PASSES =
285
2e494f70
RS
286# Like EXTRA_PASSES, but these are used when linking.
287EXTRA_PROGRAMS =
288
289# List of extra object files that should be compiled for this target machine.
79d8453e
RS
290# The rules for compiling them should be in the t-* file for the machine.
291EXTRA_PARTS =
292
2e494f70
RS
293# List of extra object files that should be compiled and linked with
294# compiler proper (cc1, cc1obj, cc1plus).
295EXTRA_OBJS =
296
43554690
RK
297# List of extra object files that should be compiled and linked with
298# the gcc driver.
299EXTRA_GCC_OBJS =
300
f780d21b
RS
301# List of additional header files to install.
302# Often this is edited directly by `configure'.
303EXTRA_HEADERS =
304
47547081
RS
305# Set this to `ld' to enable use of collect2.
306# USE_COLLECT2 =
307# It is convenient for configure to add the assignment at the beginning,
308# so don't override it here.
309
79d8453e
RS
310# List of extra C and assembler files to add to libgcc1.a.
311# Assembler files should have names ending in `.asm'.
312LIB1FUNCS_EXTRA =
313
314# List of extra C and assembler files to add to libgcc2.a.
315# Assembler files should have names ending in `.asm'.
316LIB2FUNCS_EXTRA =
317
ba1811f1 318# Default float.h source to use for cross-compiler.
67446ffe 319# This is overidden by configure.
ba1811f1
ILT
320CROSS_FLOAT_H=float.h-cross
321
79d8453e
RS
322# Program to convert libraries.
323LIBCONVERT =
324
325# Control whether header files are installed.
79d8453e
RS
326INSTALL_HEADERS=install-headers
327
0d4d8174
RS
328# Options for tar when copying trees. So HPUX can override it.
329TAROUTOPTS = xpBf
330
79d8453e 331# Select which version of fixincludes to use (I.E. regular versus SVR4)
98e4b835 332# This value is overridden directly by configure.
79d8453e
RS
333FIXINCLUDES=fixincludes
334
66d7ffbf 335# Additional directories of header files to run fixincludes on.
4ab08223
RS
336# These should be directories searched automatically by default
337# just as /usr/include is.
338# *Do not* use this for directories that happen to contain
339# header files, but are not searched automatically by default.
66d7ffbf
RS
340# On most systems, this is empty.
341OTHER_FIXINCLUDES_DIRS=
342
7c27f801
RK
343# A list of all the language-specific executables.
344# This is overridden by configure.
345COMPILERS = cc1$(exeext) cc1obj$(exeext)
346
acbbf3d9 347# List of things which should already be built whenever we try to use xgcc
79d8453e 348# to compile anything (without linking).
7c27f801 349GCC_PASSES=xgcc$(exeext) $(COMPILERS) cpp$(exeext) $(EXTRA_PASSES)
79d8453e 350
acbbf3d9 351# List of things which should already be built whenever we try to use xgcc
79d8453e 352# to link anything.
b583eed8 353GCC_PARTS=$(GCC_PASSES) $(LIBGCC) $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS)
79d8453e 354
79d8453e
RS
355# Directory to link to, when using the target `maketest'.
356DIR = ../gcc
357
c3efc7c4 358# Guaranteed to not exist when not passing md through cpp.
aa90345a 359# This value is overridden directly by configure.
c3efc7c4
DE
360MD_FILE = md-cpp-not-used
361
79d8453e
RS
362# Flags to use when cross-building GCC.
363# Prefix to apply to names of object files when using them
364# to run on the machine we are compiling on.
365HOST_PREFIX=
366# Prefix to apply to names of object files when compiling them
367# to run on the machine we are compiling on.
368# The default for this variable is chosen to keep these rules
369# out of the way of the other rules for compiling the same source files.
370HOST_PREFIX_1=loser-
371HOST_CC=$(CC)
372HOST_CFLAGS=$(ALL_CFLAGS)
2e494f70 373HOST_CLIB=$(CLIB)
79d8453e
RS
374HOST_LDFLAGS=$(LDFLAGS)
375HOST_CPPFLAGS=$(ALL_CPPFLAGS)
2e494f70
RS
376HOST_ALLOCA=$(ALLOCA)
377HOST_MALLOC=$(MALLOC)
378HOST_OBSTACK=$(OBSTACK)
79d8453e 379
338023d4
DE
380# Actual name to use when installing a native compiler.
381GCC_INSTALL_NAME = `t='$(program_transform_name)'; echo gcc | sed $$t`
382
383# Actual name to use when installing a cross-compiler.
384GCC_CROSS_NAME = `t='$(program_transform_cross_name)'; echo gcc | sed $$t`
385
79d8453e
RS
386# Choose the real default target.
387ALL=all.internal
388
389# Choose the real install target.
ba1811f1
ILT
390INSTALL_TARGET=install-normal
391
392# Source for float.h. Overridden by cross-make.
393FLOAT_H=float.h-nat
79d8453e 394
aefc3801
JM
395# Extra symbols for fixproto to define when parsing headers.
396FIXPROTO_DEFINES =
397
68d69835
JM
398# Extra flags to use when compiling crt{begin,end}.o.
399CRTSTUFF_T_CFLAGS =
400
522170ca
RK
401# Extra flags to use when compiling [m]crt0.o.
402CRT0STUFF_T_CFLAGS =
403
79d8453e
RS
404# End of variables for you to override.
405
406# Definition of `all' is here so that new rules inserted by sed
407# do not specify the default target.
408# The real definition is under `all.internal' (for native compilers)
409# or `all.cross' (for cross compilers).
2e494f70 410all: all.indirect
79d8453e 411
be0d23ff
RS
412# This tells GNU Make version 3 not to put all variables in the environment.
413.NOEXPORT:
414
79d8453e 415# sed inserts variable overrides after the following line.
60d00117
TW
416####target overrides
417####host overrides
418####cross overrides
057f494b 419####build overrides
79d8453e
RS
420\f
421# Now figure out from those variables how to compile and link.
422
2e494f70
RS
423all.indirect: $(ALL)
424
eea77e5f
JW
425# IN_GCC tells obstack.h that we are using gcc's <stddef.h> file.
426# ??? IN_GCC should be obsolete now.
b4f96011 427INTERNAL_CFLAGS = $(CROSS) -DIN_GCC
79d8453e
RS
428
429# This is the variable actually used when we compile.
430ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS)
431
432# Likewise.
433ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
434
435# Even if ALLOCA is set, don't use it if compiling with GCC.
e0a1b6d2 436USE_ALLOCA= ` case "${CC}" in "${OLDCC}") echo "${ALLOCA}" ;; esac `
2e494f70
RS
437USE_HOST_ALLOCA= ` case "${HOST_CC}"@"${HOST_ALLOCA}" in "${OLDCC}"@?*) echo ${HOST_PREFIX}${HOST_ALLOCA} ;; esac `
438USE_HOST_MALLOC= ` case "${HOST_MALLOC}" in ?*) echo ${HOST_PREFIX}${HOST_MALLOC} ;; esac `
439USE_HOST_OBSTACK= ` case "${HOST_OBSTACK}" in ?*) echo ${HOST_PREFIX}${HOST_OBSTACK} ;; esac `
79d8453e
RS
440
441# Dependency on obstack, alloca, malloc or whatever library facilities
442# are not installed in the system libraries.
443# We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
444LIBDEPS= $(OBSTACK) $(ALLOCA) $(MALLOC)
445
446# Likewise, for use in the tools that must run on this machine
447# even if we are cross-building GCC.
448# We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
2e494f70 449HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_ALLOCA) $(HOST_PREFIX)$(HOST_MALLOC)
79d8453e
RS
450
451# How to link with both our special library facilities
452# and the system's installed libraries.
453LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(CLIB)
454
455# Likewise, for use in the tools that must run on this machine
456# even if we are cross-building GCC.
2e494f70
RS
457HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC) \
458 $(HOST_CLIB)
79d8453e
RS
459
460HOST_RTL = $(HOST_PREFIX)rtl.o
461HOST_RTLANAL = $(HOST_PREFIX)rtlanal.o
d3614a37 462HOST_PRINT = $(HOST_PREFIX)print-rtl.o
79d8453e
RS
463
464# Specify the directories to be searched for header files.
465# Both . and srcdir are used, in that order,
466# so that tm.h and config.h will be found in the compilation
467# subdirectory rather than in the source directory.
468INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config
79d8453e
RS
469
470# Always use -I$(srcdir)/config when compiling.
471.c.o:
472 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
473
474# This tells GNU make version 3 not to export all the variables
475# defined in this file into the environment.
476.NOEXPORT:
477\f
013a2ee0
DE
478# Support for additional languages (other than c and objc).
479# ??? objc can be supported this way too (leave for later).
480
481# These next lines are overridden by configure.
482LANG_MAKEFILES =
483LANG_STAGESTUFF =
484LANG_DIFF_EXCLUDES =
f7055b09
JM
485LANG_LIB2FUNCS =
486LANG_EXTRA_HEADERS =
013a2ee0
DE
487
488# Flags to pass to recursive makes.
489# CC is set by configure. Hosts without symlinks need special handling
490# because we need CC="stage1/xgcc -Bstage1/" to work in the language
491# subdirectories.
492# ??? The choices here will need some experimenting with.
493FLAGS_TO_PASS = \
494 "AR_FLAGS=$(AR_FLAGS)" \
495 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
496 "BISON=$(BISON)" \
497 "BISONFLAGS=$(BISONFLAGS)" \
498 "CC=set-by-configure" \
499 "CFLAGS=$(CFLAGS)" \
89c8019a 500 "CLIB=$(CLIB)" \
dc93cff0 501 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
013a2ee0
DE
502 "LDFLAGS=$(LDFLAGS)" \
503 "LEX=$(LEX)" \
504 "LEXFLAGS=$(LEXFLAGS)" \
505 "MAKEINFO=$(MAKEINFO)" \
506 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
013a2ee0
DE
507 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
508 "RANLIB_TEST_FOR_TARGET=$(RANLIB_TEST_FOR_TARGET)" \
509 "SHELL=$(SHELL)" \
1496daef 510 "STAGE_PREFIX=set-by-configure" \
aab26e16
RK
511 "exeext=$(exeext)" \
512 "objext=$(objext)" \
013a2ee0
DE
513 "exec_prefix=$(exec_prefix)" \
514 "prefix=$(prefix)" \
515 "tooldir=$(tooldir)" \
516 "bindir=$(bindir)" \
517 "libsubdir=$(libsubdir)"
518\f
79d8453e
RS
519# Lists of files for various purposes.
520
79d8453e 521# Language-specific object files for C.
f10fec92
RS
522C_OBJS = c-parse.o c-lang.o c-lex.o c-pragma.o \
523 c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-iterate.o
79d8453e 524
ccfc4033 525# Language-specific object files for Objective C.
f10fec92
RS
526OBJC_OBJS = objc-parse.o objc-act.o c-lex.o c-pragma.o \
527 c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-iterate.o
79d8453e 528
ca695ac9
JB
529# Files specific to the C interpreter bytecode compiler(s).
530BC_OBJS = bc-emit.o bc-optab.o
531
0b15d35f
RK
532# Bytecode header files constructed at build time; vmsconfig.com wants this.
533BC_ALL = bc-arity.h bc-opcode.h bc-opname.h
534
79d8453e
RS
535# Language-independent object files.
536OBJS = toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
3d195391
MS
537 function.o stmt.o except.o expr.o calls.o expmed.o explow.o optabs.o \
538 varasm.o rtl.o print-rtl.o rtlanal.o emit-rtl.o real.o \
1d7cf143 539 dbxout.o sdbout.o dwarfout.o dwarf2out.o xcoffout.o \
79d8453e 540 integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o \
f0ec1f64 541 regclass.o local-alloc.o global.o reload.o reload1.o caller-save.o \
79d8453e 542 insn-peep.o reorg.o sched.o final.o recog.o reg-stack.o \
118bdbf8 543 insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o \
8bd57699 544 insn-attrtab.o $(out_object_file) getpwd.o convert.o $(EXTRA_OBJS)
79d8453e
RS
545
546# GEN files are listed separately, so they can be built before doing parallel
547# makes for cc1 or cc1plus. Otherwise sequent parallel make attempts to load
548# them before rtl.o is compiled.
549GEN= genemit genoutput genrecog genextract genflags gencodes genconfig genpeep
550
59949f60
PB
551CCCP=cccp
552# Uncomment this line if you want to use cppmain (w/cpplib) as cpp.
553#CCCP=cppmain
554
79d8453e 555# Files to be copied away after each stage in building.
aab26e16 556STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
79d8453e 557 insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
8fad1c10 558 insn-attr.h insn-attrtab.c insn-opinit.c \
961b7009 559 stamp-flags stamp-config stamp-codes stamp-mlib \
79d8453e 560 stamp-output stamp-recog stamp-emit stamp-extract stamp-peep \
522170ca 561 stamp-attr stamp-attrtab stamp-opinit stamp-proto stamp-crt stamp-crtS stamp-crt0 \
bf3556b3
RK
562 genemit$(exeext) genoutput$(exeext) genrecog$(exeext) genextract$(exeext) \
563 genflags$(exeext) gencodes$(exeext) genconfig$(exeext) genpeep$(exeext) \
564 genattrtab$(exeext) genattr$(exeext) genopinit$(exeext) \
0b15d35f 565 $(BC_ALL) \
2da63e2a 566 stamp-bcarity stamp-bcopcode stamp-bcopname \
bf3556b3 567 bi-arity$(exeext) bi-opcode$(exeext) bi-opname$(exeext) \
aab26e16
RK
568 $(GCC_PASSES) $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
569 $(CCCP)$(exeext) cc1obj$(exeext) enquire$(exeext) \
570 protoize$(exeext) unprotoize$(exeext) \
7ac16ba0 571 specs collect2$(exeext) $(USE_COLLECT2) underscore.c \
ed8a0e58
RK
572 *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop \
573 *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack \
574 *.[si] \
013a2ee0 575 $(LANG_STAGESTUFF)
79d8453e
RS
576
577# Members of libgcc1.a.
578LIB1FUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
b6eb802a 579 _lshrsi3 _ashrsi3 _ashlsi3 \
79d8453e
RS
580 _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 \
581 _fixdfsi _fixsfsi _floatsidf _floatsisf _truncdfsf2 _extendsfdf2 \
582 _addsf3 _negsf2 _subsf3 _mulsf3 _divsf3 \
583 _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \
584 _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2
585
586# Library members defined in libgcc2.c.
587LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
b6eb802a 588 _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 \
3af18470 589 _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \
79d8453e 590 _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \
3971e415 591 _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \
d1b4b7c1 592 _fixtfdi _fixunstfdi _floatditf \
c4124c29
RK
593 __gcc_bcmp _varargs __dummy _eprintf _op_new _op_vnew _new_handler \
594 _op_delete _op_vdel _bb _shtab _clear_cache _trampoline __main _exit \
595 _ctors _eh _pure
79d8453e 596
79d8453e
RS
597# The files that "belong" in CONFIG_H are deliberately omitted
598# because having them there would not be useful in actual practice.
599# All they would do is cause complete recompilation every time
600# one of the machine description files is edited.
601# That may or may not be what one wants to do.
602# If it is, rm *.o is an easy way to do it.
7ac16ba0 603# CONFIG_H = $(host_xm_file) $(tm_file)
79d8453e
RS
604CONFIG_H =
605RTL_H = rtl.h rtl.def machmode.h machmode.def
606TREE_H = tree.h real.h tree.def machmode.h machmode.def
ca695ac9 607BYTECODE_H = bytecode.h bc-emit.h bc-optab.h
47a22692
JM
608
609# "t" or nothing, for building multilibbed versions of, say, crtbegin.o.
610T =
79d8453e 611\f
013a2ee0
DE
612# Language makefile fragments.
613
614# The following targets define the interface between us and the languages.
615#
616# all.build, all.cross, start.encap, rest.encap,
617# info, dvi,
618# install-normal, install-common, install-info, install-man,
619# uninstall, distdir,
f1908d70 620# mostlyclean, clean, distclean, extraclean, maintainer-clean,
013a2ee0
DE
621# stage1, stage2, stage3, stage4
622#
623# Each language is linked in with a series of hooks (since we can't use `::'
624# targets). The name of each hooked is "lang.${target_name}" (eg: lang.info).
625# Configure computes and adds these here.
626
627####language hooks
628
629# sed inserts language fragments after the following line.
630####language fragments
631
632# End of language makefile fragments.
633\f
79d8453e
RS
634# Avoid a lot of time thinking about remaking Makefile.in and *.def.
635.SUFFIXES: .in .def
636
47547081 637Makefile: $(srcdir)/Makefile.in $(srcdir)/configure $(srcdir)/version.c \
2a64bb2f 638 $(xmake_file) $(tmake_file) \
013a2ee0 639 $(LANG_MAKEFILES)
173712fb
RK
640 cp config.status config.run
641 $(SHELL) config.run
da0d7cb1 642 rm -f config.run
79d8453e
RS
643
644all.internal: start.encap rest.encap
645# This is what to compile if making a cross-compiler.
013a2ee0 646# Note that we can compile enquire using the cross-compiler just built,
42396e97 647# although we can't run it on this machine.
013a2ee0 648all.cross: native gcc-cross specs stmp-headers $(LIBGCC) $(STMP_FIXPROTO) \
a2d163c4 649 $(LIBGCC1_TEST) $(EXTRA_PARTS) lang.all.cross
057f494b 650# This is what to compile if making gcc with a cross-compiler.
013a2ee0 651all.build: native xgcc $(EXTRA_PARTS) lang.all.build
79d8453e 652# This is what must be made before installing GCC and converting libraries.
013a2ee0 653start.encap: native xgcc specs $(LIBGCC1) xlimits.h lang.start.encap
eea77e5f 654# These can't be made until after GCC can run.
013a2ee0 655rest.encap: stmp-headers $(LIBGCC) $(STMP_FIXPROTO) $(EXTRA_PARTS) lang.rest.encap
79d8453e
RS
656# This is what is made with the host's compiler
657# whether making a cross compiler or not.
d591efa1 658native: config.status cpp $(LANGUAGES) $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2)
79d8453e
RS
659
660# Define the names for selecting languages in LANGUAGES.
661C c: cc1
cce7aea7
JW
662OBJC objc: cc1obj objc-runtime
663OBJECTIVE-C objective-c: cc1obj objc-runtime
79d8453e
RS
664PROTO: proto
665
bff3fc41
DE
666# Tell GNU make these are phony targets.
667.PHONY: C c OBJC objc OBJECTIVE-C objective-c PROTO proto
668
2e494f70
RS
669# Really, really stupid make features, such as SUN's KEEP_STATE, may force
670# a target to build even if it is up-to-date. So we must verify that
671# config.status does not exist before failing.
79d8453e 672config.status:
2e494f70
RS
673 @if [ ! -f config.status ] ; then \
674 echo You must configure gcc. Look at the INSTALL file for details.; \
675 false; \
676 else \
677 true; \
678 fi
79d8453e 679
3aa072f2
RS
680# On the target machine, finish building a cross compiler.
681# This does the things that can't be done on the host machine.
b583eed8 682rest.cross: $(LIBGCC) gfloat.h specs
3aa072f2 683
a2d163c4 684# Verify that it works to compile and link libgcc1-test.
e97ed334 685# If it does, then there are sufficient replacements for libgcc1.a.
a2d163c4 686libgcc1-test: libgcc1-test.o native $(GCC_PARTS)
8f28aa33 687 @echo "Testing libgcc1. Ignore linker warning messages."
a2d163c4 688 $(GCC_FOR_TARGET) $(GCC_CFLAGS) libgcc1-test.o -o libgcc1-test \
fda92428 689 -nostartfiles -nostdlib `$(GCC_FOR_TARGET) --print-libgcc-file-name`
a2d163c4
DE
690libgcc1-test.o: libgcc1-test.c native xgcc
691 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -c $(srcdir)/libgcc1-test.c
e97ed334 692
3aa072f2
RS
693# Recompile all the language-independent object files.
694# This is used only if the user explicitly asks for it.
79d8453e
RS
695compilations: ${OBJS}
696
6c1cc7fa
DE
697# Create a list of the language-independent object files so the language
698# subdirectories needn't mention their names explicitly.
f7055b09 699stamp-objlist: $(OBJS) $(BC_OBJS)
aa568834 700 echo " $(OBJS) $(BC_OBJS)" | sed -e 's, \([a-z0-9]\), ../\1,g' -e 's/\.o/$(objext)/g' >stamp-objlist
6c1cc7fa 701
acbbf3d9
RS
702# We call this executable `xgcc' rather than `gcc'
703# to avoid confusion if the current directory is in the path
704# and CC is `gcc'. It is renamed to `gcc' when it is installed.
c6e087c5
DE
705xgcc: gcc.o version.o choose-temp.o pexecute.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
706 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o version.o \
707 choose-temp.o pexecute.o $(EXTRA_GCC_OBJS) $(LIBS)
3aa072f2
RS
708
709# Dump a specs file to make -B./ read these specs over installed ones.
43554690 710specs: xgcc
d521a023
RK
711 $(GCC_FOR_TARGET) -dumpspecs > tmp-specs
712 mv tmp-specs specs
79d8453e 713
acbbf3d9 714# We do want to create an executable named `xgcc', so we can use it to
79d8453e
RS
715# compile libgcc2.a.
716# Also create gcc-cross, so that install-common will install properly.
acbbf3d9 717gcc-cross: xgcc
aab26e16 718 cp xgcc$(exeext) gcc-cross$(exeext)
79d8453e 719
0e54aab2 720cc1: $(P) $(C_OBJS) $(OBJS) $(BC_OBJS) $(LIBDEPS)
aab26e16 721 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) $(OBJS) $(BC_OBJS) $(LIBS)
79d8453e 722
0e54aab2 723cc1obj: $(P) $(OBJC_OBJS) $(OBJS) $(BC_OBJS) $(LIBDEPS)
aab26e16 724 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(OBJC_OBJS) $(OBJS) $(BC_OBJS) $(LIBS)
79d8453e 725
ba1811f1 726# Copy float.h from its source.
42118350 727gfloat.h: $(FLOAT_H)
5a00de6f 728 -rm -f gfloat.h
42118350 729 cp $(FLOAT_H) gfloat.h
ba1811f1
ILT
730
731# Create float.h source for the native machine.
732float.h-nat: enquire
1e558d35
RS
733 -./enquire -f > tmp-float.h
734 mv tmp-float.h float.h-nat
ba1811f1
ILT
735
736# Create a dummy float.h source for a cross-compiler.
67446ffe
DE
737# ??? This isn't used anymore. Should we create config/float-unkn.h
738# and make that the default float_format in configure?
ba1811f1 739float.h-cross:
54577c52
RK
740 echo "#ifndef __GCC_FLOAT_NOT_NEEDED" > t-float.h-cross
741 echo "#error float.h values not known for cross-compiler" >> t-float.h-cross
742 echo "#endif" >> t-float.h-cross
d521a023 743 mv t-float.h-cross float.h-cross
79d8453e
RS
744
745# Used to compile enquire with standard cc, but have forgotten why.
746# Let's try with GCC.
747enquire: enquire.o $(GCC_PARTS)
aab26e16 748 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ENQUIRE_LDFLAGS) enquire.o -o $@
94b7bf21 749enquire.o: $(srcdir)/enquire.c $(GCC_PASSES) stmp-int-hdrs
2e494f70 750# Breaking this line caused a problem with one version of GNU make.
e3e873d2 751 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(ENQUIRE_CFLAGS) -I. -c $(srcdir)/enquire.c
1402d22c
RS
752
753# Build the version of limits.h that we will install.
754xlimits.h: glimits.h limitx.h limity.h
40dc28fc 755 if $(LIMITS_H_TEST) ; then \
d521a023 756 cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > tmp-xlimits.h; \
1402d22c 757 else \
d521a023 758 cat $(srcdir)/glimits.h > tmp-xlimits.h; \
1402d22c 759 fi
d521a023 760 mv tmp-xlimits.h xlimits.h
79d8453e
RS
761\f
762# Build libgcc.a.
763# This is done in two parts because some functions, in libgcc1.c,
acbbf3d9
RS
764# must be compiled with something other than GCC,
765# while the rest, in libgcc2.c, must be compiled with xgcc.
766# That means we can't do libgcc2.c until after xgcc, cc1, etc.
79d8453e
RS
767
768# Use this as value of LIBGCC1 to cause conversion to GNU library format.
769# LIBCONVERT should put its output in libgcc1.conv.
770libgcc1.conv: libgcc1.a
771 $(LIBCONVERT) libgcc1.a libgcc1.conv
772
773# Use this as value of LIBGCC1 to inhibit use of libgcc1.c entirely.
774# Make an empty file instead.
57cd2ea1 775libgcc1.null: $(GCC_PASSES)
79d8453e
RS
776 echo "__foo () {}" > dummy.c
777 $(GCC_FOR_TARGET) $(GCC_CFLAGS) -c dummy.c
aab26e16
RK
778 $(OLDAR) $(OLDAR_FLAGS) libgcc1.null dummy$(objext)
779 rm -f dummy$(objext) dummy.c
79d8453e 780
b7ac21e3
RS
781# This is $(LIBGCC1) for a cross-compiler.
782# We have no automatic way of building libgcc1.a,
783# so it's up to the installer to find a way to do that.
784# This rule deliberately does not depend on libgcc1.a
785# so that it will fail if the installer hasn't provided it.
786libgcc1.cross:
787 mv libgcc1.a libgcc1.cross || (echo You must find a way to make libgcc1.a; false)
788
79d8453e 789# Compile the library of arithmetic subroutines with the native compiler.
acbbf3d9 790# Don't compile it with GCC!
79d8453e 791# (That would cause most arithmetic functions to call themselves.)
38b3fa08
RK
792#
793# NOTE: If you modify these rules substantially, please be sure to
794# check at least config/i386/t-sco5 and possibly other makefile
795# fragments.
79d8453e
RS
796libgcc1.a: libgcc1.c $(CONFIG_H) $(LIB1FUNCS_EXTRA) config.status
797 -rm -f tmplibgcc1.a
798# Actually build it in tmplibgcc1.a, then rename at end,
799# so that libgcc1.a itself remains nonexistent if compilation is aborted.
800# -e causes any failing command to make this rule fail.
801# -e doesn't work in certain shells, so we test $$? as well.
432fde52
JW
802# lynx has a broken ar, it always complains when the initial library is
803# empty, thus this command works only if we don't do -e
804# There is a trailing backslash (\) deleted from the following line.
805# set -e;
79d8453e
RS
806 for name in $(LIB1FUNCS); \
807 do \
808 echo $${name}; \
aab26e16 809 rm -f $${name}$(objext); \
38b3fa08 810 $(OLDCC) -DIN_LIBGCC1 $(CCLIBFLAGS) $(INCLUDES) -c -DL$${name} $(srcdir)/libgcc1.c; \
79d8453e 811 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
aab26e16
RK
812 mv libgcc1$(objext) $${name}$(objext); \
813 $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}$(objext); \
814 rm -f $${name}$(objext); \
79d8453e
RS
815 done
816# Some shells crash when a loop has no items.
817# So make sure there is always at least one--`..'.
818# Then ignore it.
819# We don't use -e here because there are if statements
820# that should not make the command give up when the if condition is false.
821# Instead, we test for failure after each command where it matters.
49041557 822 for file in .. $(LIB1FUNCS_EXTRA); \
79d8453e
RS
823 do \
824 if [ x$${file} != x.. ]; then \
5918c853 825 name=`echo $${file} | sed -e 's/[.][cS]$$//' -e 's/[.]asm$$//'`; \
79d8453e
RS
826 echo $${name}; \
827 if [ $${name}.asm = $${file} ]; then \
62c13b81 828 cp $${file} $${name}.s || exit 1; file=$${name}.s; \
79d8453e 829 else true; fi; \
38b3fa08 830 $(OLDCC) -DIN_LIBGCC1 $(CCLIBFLAGS) $(INCLUDES) -c $${file}; \
79d8453e 831 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
aab26e16 832 $(OLDAR) $(OLDAR_FLAGS) tmplibgcc1.a $${name}$(objext); \
79d8453e 833 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
aab26e16 834 rm -f $${name}.s $${name}$(objext); \
79d8453e
RS
835 else true; \
836 fi; \
837 done
3ff34537 838 -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc1.a; else true; fi
79d8453e
RS
839 mv tmplibgcc1.a libgcc1.a
840
44d65d84
DE
841# Build libgcc1.a from assembler source. LIB1ASMFUNCS is the list of
842# functions. LIB1ASMSRC is the name of the source file in the config
843# subdirectory.
844libgcc1-asm.a: libgcc2.ready config.status $(srcdir)/config/$(LIB1ASMSRC)
845 -rm -f tmplibgcc1.a libgcc1.S
846 cp $(srcdir)/config/$(LIB1ASMSRC) libgcc1.S
847# Actually build it in tmplibgcc1.a, then rename at end,
848# so that libgcc1-asm.a itself remains nonexistent if compilation is aborted.
849# -e causes any failing command to make this rule fail.
850# -e doesn't work in certain shells, so we test $$? as well.
851# lynx has a broken ar, it always complains when the initial library is
852# empty, thus this command works only if we don't do -e
853# There is a trailing backslash (\) deleted from the following line.
854# set -e;
855 for name in $(LIB1ASMFUNCS); \
856 do \
857 echo $${name}; \
858 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} libgcc1.S; \
859 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
aab26e16
RK
860 mv libgcc1$(objext) $${name}$(objext); \
861 $(AR) $(AR_FLAGS) tmplibgcc1.a $${name}$(objext); \
862 rm -f $${name}$(objext); \
44d65d84
DE
863 done
864 -rm -f libgcc1.S
865 mv tmplibgcc1.a libgcc1-asm.a
866
a2ab7f2b
DE
867# Generate assembly versions of the functions required for libgcc1.
868# You'll still need to massage the code by hand (possibly hacking
869# underscores and local labels) but this will get you started.
870libgcc1.S: libgcc1.c $(CONFIG_H) config.status
871 -rm -f libgcc1.S
872 touch libgcc1.S
873 for name in $(LIB1FUNCS); \
874 do \
875 echo $${name}; \
38b3fa08 876 $(OLDCC) -DIN_LIBGCC1 $(CCLIBFLAGS) $(INCLUDES) -S -DL$${name} $(srcdir)/libgcc1.c; \
a2ab7f2b
DE
877 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
878 echo '#ifdef ' L$${name} >> libgcc1.S; \
879 cat libgcc1.s >> libgcc1.S; \
880 echo '#endif /*' L$${name} '*/' >> libgcc1.S; \
881 echo "" >> libgcc1.S; \
882 done
883
79d8453e
RS
884# Compiling libgcc2.a requires making sure that cc1, etc. have been compiled.
885# But recompiling cc1 should not force recompilation of libgcc2.a.
886# If you want to force recompilation, delete libgcc2.a.
cce7aea7 887libgcc2.ready: $(GCC_PASSES) $(LIBGCC2_DEPS) stmp-int-hdrs
79d8453e
RS
888 -if [ -f libgcc2.ready ] ; then \
889 true; \
890 else \
891 touch libgcc2.ready; \
892 fi
893
894libgcc2.a: libgcc2.c libgcc2.ready $(CONFIG_H) $(LIB2FUNCS_EXTRA) \
f7055b09 895 $(LANG_LIB2FUNCS) machmode.h longlong.h gbl-ctors.h config.status
79d8453e
RS
896# Actually build it in tmplibgcc2.a, then rename at end,
897# so that libgcc2.a itself remains nonexistent if compilation is aborted.
898 -rm -f tmplibgcc2.a
899# -e causes any failing command to make this rule fail.
900# -e doesn't work in certain shells, so we test $$? as well.
432fde52
JW
901# lynx has a broken ar, it always complains when the initial library is
902# empty, thus this command works only if we don't do -e
903# There is a trailing backslash (\) deleted from the following line.
904# set -e;
79d8453e
RS
905 for name in $(LIB2FUNCS); \
906 do \
907 echo $${name}; \
2e494f70 908 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
aab26e16 909 $(srcdir)/libgcc2.c -o $${name}$(objext); \
79d8453e 910 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
aab26e16
RK
911 $(AR) $(AR_FLAGS) tmplibgcc2.a $${name}$(objext); \
912 rm -f $${name}$(objext); \
79d8453e
RS
913 done
914# Some shells crash when a loop has no items.
915# So make sure there is always at least one--`..'.
916# Then ignore it.
917# We don't use -e here because there are if statements
918# that should not make the command give up when the if condition is false.
919# Instead, we test for failure after each command where it matters.
f7055b09 920 for file in .. $(LIB2FUNCS_EXTRA) $(LANG_LIB2FUNCS); \
79d8453e
RS
921 do \
922 if [ x$${file} != x.. ]; then \
f7055b09 923 name=`echo $${file} | sed -e 's/[.][cSo]$$//' -e 's/[.]asm$$//' -e 's/[.]txt$$//'`; \
58fe4e59 924 oname=` echo $${name} | sed -e 's,.*/,,'`; \
f7055b09
JM
925 if [ $${name}.txt = $${file} ]; then \
926 for f in .. `cat $${file}`; do if [ x$${f} != x.. ]; then \
927 $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
928 AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" CC="$(CC)" \
929 CFLAGS="$(CFLAGS)" HOST_PREFIX="$(HOST_PREFIX)" \
930 HOST_PREFIX_1="$(HOST_PREFIX_1)" \
931 LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" $${f}; \
932 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
933 $(AR) $(AR_FLAGS) tmplibgcc2.a $${f}; \
934 rm -f $${f}; \
935 fi; done; \
936 else \
937 echo $${name}; \
938 if [ $${name}.asm = $${file} ]; then \
939 cp $${file} $${name}.s || exit 1; file=$${name}.s; \
940 else true; fi; \
941 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
942 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
943 $(AR) $(AR_FLAGS) tmplibgcc2.a $${oname}$(objext); \
944 rm -f $${name}.s $${oname}$(objext); \
945 fi; \
79d8453e
RS
946 else true; \
947 fi; \
948 done
949 mv tmplibgcc2.a libgcc2.a
950# These lines were deleted from above the mv command
951# because ranlibing libgcc.a itself should suffice.
952# -if [ x${HPUX_GAS} = x ] ; then \
f9a32908 953# if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc2.a; else true; fi; \
79d8453e
RS
954# else true; fi
955
956# Combine the various libraries into a single library, libgcc.a.
957libgcc.a: $(LIBGCC1) $(LIBGCC2)
958 -rm -rf tmplibgcc.a libgcc.a tmpcopy
959 mkdir tmpcopy
2e494f70
RS
960 -if [ x$(LIBGCC1) != x ]; \
961 then (cd tmpcopy; $(AR) x ../$(LIBGCC1)); \
962 else true; \
963 fi
2516bc12
JW
964# Some versions of ar (specifically the one in RISC/os 5.x), create an
965# unwritable table of contents file, and then print an error message when
966# the second ar command tries to overwrite this file. To avoid the error
967# message from ar, we make sure all files are writable.
cfc327a2 968 -(cd tmpcopy; chmod +w * > /dev/null 2>&1)
79d8453e 969 (cd tmpcopy; $(AR) x ../$(LIBGCC2))
aab26e16 970 (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *$(objext))
79d8453e
RS
971 rm -rf tmpcopy
972 -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi
973# Actually build it in tmplibgcc.a, then rename at end,
974# so that libgcc.a itself remains nonexistent if compilation is aborted.
975 mv tmplibgcc.a libgcc.a
976
f6cdc7ea
DE
977# Use the genmultilib shell script to generate the information the gcc
978# driver program needs to select the library directory based on the
979# switches.
961b7009
MM
980multilib.h: stamp-mlib; @true
981stamp-mlib: $(srcdir)/genmultilib Makefile
982 $(SHELL) $(srcdir)/genmultilib \
983 "$(MULTILIB_OPTIONS)" \
984 "$(MULTILIB_DIRNAMES)" \
985 "$(MULTILIB_MATCHES)" \
986 "$(MULTILIB_EXCEPTIONS)" \
987 "$(MULTILIB_EXTRA_OPTS)" > tmp-mlib.h
988 $(srcdir)/move-if-change tmp-mlib.h multilib.h
989 touch stamp-mlib
f6cdc7ea
DE
990
991# Build multiple copies of libgcc.a, one for each target switch.
992stmp-multilib: $(LIBGCC1) libgcc2.c libgcc2.ready $(CONFIG_H) \
c7d13c76
JM
993 $(LIB2FUNCS_EXTRA) $(LANG_LIB2FUNCS) machmode.h longlong.h gbl-ctors.h \
994 config.status
f6cdc7ea
DE
995 for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
996 dir=`echo $$i | sed -e 's/;.*$$//'`; \
997 flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
f6cdc7ea 998 $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
32e2dec7 999 AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
ad3a9224 1000 RANLIB="$(RANLIB)" RANLIB_TEST="$(RANLIB_TEST)" \
f6cdc7ea 1001 HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
ad3a9224 1002 LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS) $${flags}" \
47a22692 1003 MULTILIB_CFLAGS="$${flags}" \
ad3a9224
DE
1004 LIBGCC1="$(LIBGCC1)" LIBGCC2="$(LIBGCC2)" \
1005 dir="$${dir}" stmp-multilib-sub; \
bff3fc41 1006 if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
f6cdc7ea
DE
1007 done
1008 touch stmp-multilib
1009
ad3a9224
DE
1010# Subroutine of stmp-multilib so make -n works.
1011stmp-multilib-sub:
47a22692
JM
1012 rm -f $(LIBGCC2)
1013 if [ -d $(dir) ]; then \
1014 cd $(dir); \
1015 rm -f libgcc.a $(EXTRA_MULTILIB_PARTS); \
88029ff8 1016 else true; \
47a22692 1017 fi
ad3a9224 1018 $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
32e2dec7 1019 AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
ad3a9224
DE
1020 HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
1021 LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" $(LIBGCC2)
1022 if [ x$(LIBGCC1) != xlibgcc1-asm.a ]; \
1023 then true; \
1024 else rm -f $(LIBGCC1); \
1025 fi
1026 if [ x$(LIBGCC1) != xlibgcc1-asm.a ]; \
1027 then true; \
1028 else \
1029 $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
32e2dec7 1030 AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
ad3a9224
DE
1031 HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
1032 LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" $(LIBGCC1); \
1033 fi
1034 rm -rf tmplibgcc.a tmpcopy
1035 mkdir tmpcopy
1036 if [ x$(LIBGCC1) != x ]; \
1037 then (cd tmpcopy; $(AR) x ../$(LIBGCC1)); \
1038 else true; \
1039 fi
1040 (cd tmpcopy; $(AR) x ../$(LIBGCC2))
7a7e1cfb 1041 (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *$(objext))
ad3a9224
DE
1042 rm -rf libgcc2.a tmpcopy
1043 if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi
1044 if [ -d $(dir) ]; then true; else mkdir $(dir); fi
1045 mv tmplibgcc.a $(dir)/libgcc.a
47a22692
JM
1046 for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
1047 $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
1048 AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
1049 HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
1050 MULTILIB_CFLAGS="$(MULTILIB_CFLAGS)" T="t" t$${f}; \
1051 mv t$${f} $(dir)/$${f}; \
88029ff8 1052 else true; \
47a22692 1053 fi; done
ad3a9224 1054
ea727bbf
RS
1055objc-runtime: libobjc.a
1056
8ba23f20 1057# Build the Objective C runtime library.
d04362c9 1058libobjc.a: cc1obj specs stmp-int-hdrs libgcc2.ready $(USE_COLLECT2) $(EXTRA_PARTS)
f1553cbb 1059 if [ -d objc ]; then true; else mkdir objc; fi
ea727bbf 1060 thisdir1=`pwd`; \
265ce9f8 1061 srcdir1=`cd $(srcdir); pwd`; \
ea727bbf 1062 cd objc; \
5baa9d1f
RS
1063 $(MAKE) -f $${srcdir1}/objc/Makefile libobjc.a \
1064 srcdir=$${srcdir1} tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
1065 GCC_FOR_TARGET="$${thisdir1}/xgcc -B$${thisdir1}/" \
bb029709 1066 GCC_CFLAGS="$(GCC_CFLAGS)" OBJC_THREAD_FILE="$(OBJC_THREAD_FILE)"
d8880fea 1067 -rm -f libobjc.a
7c3b4722 1068 ln objc/libobjc.a . >/dev/null 2>&1 || cp objc/libobjc.a .
ea727bbf
RS
1069 -if $(RANLIB_TEST) ; then $(RANLIB) libobjc.a; else true; fi
1070
1071# This is used by objc/Makefile if the user runs that directly.
d04362c9 1072sublibobjc.a: cc1obj specs stmp-int-hdrs libgcc2.ready
265ce9f8
TW
1073 thisdir1=`pwd`; \
1074 srcdir1=`cd $(srcdir); pwd`; \
1075 cd objc; \
d8880fea 1076 $(MAKE) -f $$srcdir1/objc/Makefile libobjc.a \
265ce9f8
TW
1077 srcdir=$$srcdir1 tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
1078 GCC_FOR_TARGET="$$thisdir1/xgcc -B$$thisdir1/" \
bb029709 1079 GCC_CFLAGS="$(GCC_CFLAGS)" OBJC_THREAD_FILE="$(OBJC_THREAD_FILE)"
79d8453e
RS
1080
1081# Compile two additional files that are linked with every program
32988c4a
RM
1082# linked using GCC on systems using COFF or ELF, for the sake of C++
1083# constructors.
47a22692 1084$(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h
a94dbf2c
JM
1085 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
1086 -finhibit-size-directive -fno-inline-functions $(CRTSTUFF_T_CFLAGS) \
1087 -c $(srcdir)/crtstuff.c -DCRT_BEGIN -o $(T)crtbegin$(objext)
47a22692
JM
1088
1089$(T)crtend.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h
a94dbf2c
JM
1090 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
1091 -finhibit-size-directive -fno-inline-functions $(CRTSTUFF_T_CFLAGS) \
1092 -c $(srcdir)/crtstuff.c -DCRT_END -o $(T)crtend$(objext)
32988c4a
RM
1093
1094# On some systems we also want to install versions of these files
1095# compiled using PIC for use in shared libraries.
1096crtbeginS.o crtendS.o: stamp-crtS ; @true
1097
1098stamp-crtS: crtstuff.c $(GCC_PASSES) $(CONFIG_H) gbl-ctors.h
38b3fa08 1099 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS_S) \
32988c4a 1100 -DCRT_BEGIN -finhibit-size-directive -fno-inline-functions \
38b3fa08 1101 -g0 -c $(srcdir)/crtstuff.c
32988c4a 1102 mv crtstuff$(objext) crtbeginS$(objext)
38b3fa08 1103 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS_S) \
32988c4a 1104 -DCRT_END -finhibit-size-directive -fno-inline-functions \
21d4969d 1105 -g0 -c $(srcdir)/crtstuff.c -o crtendS$(objext)
32988c4a 1106 touch stamp-crtS
522170ca
RK
1107
1108# Compile the start modules crt0.o and mcrt0.o that are linked with every program
1109crt0.o: stamp-crt0 ; @true
1110mcrt0.o: stamp-crt0; @true
1111
1112stamp-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
1113 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
1114 -o crt0.o -c $(CRT0_S)
1115 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
1116 -o mcrt0.o -c $(MCRT0_S)
1117 touch stamp-crt0
79d8453e
RS
1118\f
1119# Compiling object files from source files.
1120
1121# Note that dependencies on obstack.h are not written
1122# because that file is not part of GCC.
79d8453e
RS
1123
1124# C language specific files.
1125
44dbcb17
RK
1126c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h \
1127 $(srcdir)/c-parse.h c-tree.h input.h flags.h
79d8453e 1128 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
a1fa1e22
DE
1129$(srcdir)/c-parse.h: $(srcdir)/c-parse.c
1130$(srcdir)/c-parse.c: $(srcdir)/c-parse.y
26095868 1131 cd $(srcdir); $(BISON) $(BISONFLAGS) -d c-parse.y -o c-parse.c
3ff34537 1132$(srcdir)/c-parse.y: c-parse.in
49381011 1133 echo '/*WARNING: This file is automatically generated!*/' >tmp-c-parse.y
1c48d17e
RS
1134 sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \
1135 -e "/^ifc$$/d" -e "/^end ifc$$/d" \
49381011 1136 $(srcdir)/c-parse.in >>tmp-c-parse.y
2c33b8c2 1137 $(srcdir)/move-if-change tmp-c-parse.y $(srcdir)/c-parse.y
1c48d17e 1138
3ff34537 1139$(srcdir)/c-gperf.h: c-parse.gperf
f137e7dc 1140 gperf -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$$ \
2c33b8c2
TG
1141 $(srcdir)/c-parse.gperf >tmp-gperf.h
1142 $(srcdir)/move-if-change tmp-gperf.h $(srcdir)/c-gperf.h
f137e7dc 1143
ad0ad213
RK
1144c-decl.o : c-decl.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h output.h
1145c-typeck.o : c-typeck.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h output.h
79d8453e 1146c-lang.o : c-lang.c $(CONFIG_H) $(TREE_H)
44dbcb17 1147c-lex.o : c-lex.c $(CONFIG_H) $(TREE_H) c-lex.h c-tree.h $(srcdir)/c-parse.h \
3d6f7931 1148 input.h flags.h $(srcdir)/c-gperf.h c-pragma.h
79d8453e
RS
1149c-aux-info.o : c-aux-info.c $(CONFIG_H) $(TREE_H) c-tree.h flags.h
1150c-convert.o : c-convert.c $(CONFIG_H) $(TREE_H) flags.h
89c8019a
RK
1151c-pragma.o: c-pragma.c $(CONFIG_H) $(TREE_H) except.h function.h \
1152 defaults.h c-pragma.h
f10fec92 1153c-iterate.o: c-iterate.c $(CONFIG_H) $(TREE_H) $(RTL_H) c-tree.h flags.h
79d8453e 1154
47547081
RS
1155# To make a configuration always use collect2, set USE_COLLECT2 to ld.
1156ld: collect2
173712fb 1157 rm -f ld$(exeext)
919e340a
RK
1158 ln collect2$(exeext) ld$(exeext) > /dev/null 2>&1 \
1159 || cp collect2$(exeext) ld$(exeext)
47547081 1160
dae14688
DE
1161collect2 : collect2.o cplus-dem.o underscore.o version.o \
1162 choose-temp.o $(LIBDEPS)
057f494b 1163# Don't try modifying collect2 (aka ld) in place--it might be linking this.
aab26e16
RK
1164 -rm -f collect2$(exeext)
1165 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ collect2.o \
dae14688 1166 cplus-dem.o underscore.o version.o choose-temp.o $(LIBS)
79d8453e 1167
a3184468 1168collect2.o : collect2.c $(CONFIG_H) gstab.h obstack.h demangle.h
b7b08dcd 1169 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
8b06b20a 1170 -DTARGET_MACHINE=\"$(target_alias)\" $(MAYBE_USE_COLLECT2) \
b7b08dcd 1171 -c `echo $(srcdir)/collect2.c | sed 's,^\./,,'`
79d8453e 1172
a3184468
JM
1173cplus-dem.o: cplus-dem.c demangle.h
1174
7af4e697
RK
1175underscore.c: stamp-under ; @true
1176
1177stamp-under: $(GCC_PASSES)
7ac16ba0
RK
1178 echo "int xxy_us_dummy;" >tmp-dum.c
1179 $(GCC_FOR_TARGET) -S tmp-dum.c
1180 echo '/*WARNING: This file is automatically generated!*/' >tmp-under.c
1181 if grep _xxy_us_dummy tmp-dum.s > /dev/null ; then \
1182 echo "int prepends_underscore = 1;" >>tmp-under.c; \
a3184468 1183 else \
7ac16ba0 1184 echo "int prepends_underscore = 0;" >>tmp-under.c; \
a3184468 1185 fi
7ac16ba0
RK
1186 $(srcdir)/move-if-change tmp-under.c underscore.c
1187 -rm -f tmp-dum.c tmp-dum.s
7af4e697 1188 touch stamp-under
a3184468 1189
ccfc4033 1190# Objective C language specific files.
79d8453e
RS
1191
1192objc-parse.o : $(srcdir)/objc-parse.c $(CONFIG_H) $(TREE_H) c-lex.h \
812e2cfe 1193 c-tree.h input.h flags.h objc-act.h
79d8453e
RS
1194 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/objc-parse.c
1195$(srcdir)/objc-parse.c : $(srcdir)/objc-parse.y
1196 cd $(srcdir); $(BISON) $(BISONFLAGS) objc-parse.y -o objc-parse.c
26095868 1197$(srcdir)/objc-parse.y: $(srcdir)/c-parse.in
9d8757d4 1198 echo '/*WARNING: This file is automatically generated!*/' >tmp-objc-prs.y
26095868
RS
1199 sed -e "/^ifc$$/,/^end ifc$$/d" \
1200 -e "/^ifobjc$$/d" -e "/^end ifobjc$$/d" \
49381011 1201 $(srcdir)/c-parse.in >>tmp-objc-prs.y
70d791f4 1202 $(srcdir)/move-if-change tmp-objc-prs.y $(srcdir)/objc-parse.y
79d8453e 1203
469778e2
RS
1204objc-act.o : objc-act.c $(CONFIG_H) $(TREE_H) $(RTL_H) c-tree.h c-lex.h \
1205 flags.h objc-act.h input.h function.h $(srcdir)/c-parse.h
79d8453e
RS
1206
1207# A file used by all variants of C.
1208
1209c-common.o : c-common.c $(CONFIG_H) $(TREE_H) c-tree.h c-lex.h flags.h
1210
1211# Language-independent files.
1212
610c62ac 1213DRIVER_DEFINES = \
79d8453e 1214 -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
2e494f70 1215 -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
964ceda1 1216 -DDEFAULT_TARGET_VERSION=\"$(version)\" \
8b06b20a 1217 -DDEFAULT_TARGET_MACHINE=\"$(target_alias)\" \
610c62ac
BK
1218 -DTOOLDIR_BASE_PREFIX=\"$(exec_prefix)/\"
1219gcc.o: gcc.c $(CONFIG_H) multilib.h config.status $(lang_specs_files)
1220 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1221 $(DRIVER_DEFINES) \
79d8453e
RS
1222 -c `echo $(srcdir)/gcc.c | sed 's,^\./,,'`
1223
1224dumpvers: dumpvers.c
1225
1226version.o: version.c
1227obstack.o: obstack.c
dae14688 1228choose-temp.o: choose-temp.c
c6e087c5 1229pexecute.o: pexecute.c
79d8453e 1230
c5d3565c
BK
1231convert.o: convert.c $(CONFIG_H) $(TREE_H) flags.h convert.h
1232
eea77e5f 1233tree.o : tree.c $(CONFIG_H) $(TREE_H) flags.h function.h
79d8453e 1234print-tree.o : print-tree.c $(CONFIG_H) $(TREE_H)
566cdc73 1235stor-layout.o : stor-layout.c $(CONFIG_H) $(TREE_H) flags.h function.h
79d8453e 1236fold-const.o : fold-const.c $(CONFIG_H) $(TREE_H) flags.h
c40d5de4
RK
1237toplev.o : toplev.c $(CONFIG_H) $(TREE_H) $(RTL_H) bytecode.h bc-emit.h \
1238 flags.h input.h insn-attr.h xcoffout.h defaults.h output.h \
1239 $(lang_options_files)
9c6e68c2 1240 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(MAYBE_USE_COLLECT2) \
8b06b20a 1241 -DTARGET_NAME=\"$(target_alias)\" \
b7ac21e3 1242 -c `echo $(srcdir)/toplev.c | sed 's,^\./,,'`
79d8453e
RS
1243
1244rtl.o : rtl.c $(CONFIG_H) $(RTL_H)
1245
1246print-rtl.o : print-rtl.c $(CONFIG_H) $(RTL_H)
1247rtlanal.o : rtlanal.c $(CONFIG_H) $(RTL_H)
1248
88e71d24 1249varasm.o : varasm.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h function.h \
ad0ad213 1250 defaults.h insn-codes.h expr.h hard-reg-set.h regs.h xcoffout.h \
3d6f7931 1251 output.h bytecode.h c-pragma.h
79d8453e
RS
1252function.o : function.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h \
1253 insn-flags.h insn-codes.h expr.h regs.h hard-reg-set.h insn-config.h \
e3068d6f 1254 recog.h output.h bytecode.h bc-emit.h
79d8453e 1255stmt.o : stmt.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h \
3d195391
MS
1256 insn-flags.h insn-config.h insn-codes.h hard-reg-set.h expr.h except.h \
1257 loop.h recog.h bytecode.h bc-typecd.h bc-typecd.def bc-opcode.h \
1258 bc-optab.h bc-emit.h
1259except.o : except.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h \
1260 insn-flags.h insn-codes.h expr.h regs.h hard-reg-set.h insn-config.h \
1261 recog.h output.h except.h
8309a1bc 1262expr.o : expr.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h function.h regs.h \
b92a98fd
DE
1263 insn-flags.h insn-codes.h expr.h insn-config.h recog.h output.h \
1264 typeclass.h bytecode.h bc-opcode.h bc-typecd.h bc-typecd.def bc-optab.h \
3f83ac49 1265 bc-emit.h modemap.def hard-reg-set.h
79d8453e 1266calls.o : calls.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h expr.h insn-codes.h \
eea77e5f 1267 insn-flags.h
79d8453e
RS
1268expmed.o : expmed.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
1269 insn-flags.h insn-config.h insn-codes.h expr.h recog.h real.h
1270explow.o : explow.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h hard-reg-set.h \
1271 insn-config.h expr.h recog.h insn-flags.h insn-codes.h
1272optabs.o : optabs.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
109bcc7e 1273 insn-flags.h insn-config.h insn-codes.h expr.h recog.h reload.h
79d8453e 1274dbxout.o : dbxout.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h regs.h \
6aa4e0b4 1275 insn-config.h reload.h gstab.h xcoffout.h defaults.h output.h
33aeec28
RK
1276sdbout.o : sdbout.c $(CONFIG_H) $(TREE_H) $(RTL_H) flags.h except.h \
1277 function.h expr.h output.h hard-reg-set.h regs.h defaults.h real.h \
1278 bytecode.h obstack.h xcoffout.h c-pragma.h
79d8453e 1279dwarfout.o : dwarfout.c $(CONFIG_H) $(TREE_H) $(RTL_H) dwarf.h flags.h \
8b7ec00c 1280 insn-config.h reload.h output.h defaults.h
1d7cf143
JW
1281dwarf2out.o : dwarf2out.c $(CONFIG_H) $(TREE_H) $(RTL_H) dwarf2.h flags.h \
1282 insn-config.h reload.h output.h defaults.h hard-reg-set.h regs.h
47547081 1283xcoffout.o : xcoffout.c $(CONFIG_H) $(TREE_H) $(RTL_H) xcoffout.h flags.h
eea77e5f 1284emit-rtl.o : emit-rtl.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
32e6ec6f
RK
1285 function.h regs.h insn-config.h insn-codes.h real.h expr.h bytecode.h \
1286 bc-opcode.h bc-typecd.h bc-typecd.def bc-optab.h bc-emit.h bc-opname.h
ee7e5441 1287real.o : real.c $(CONFIG_H) $(TREE_H)
2e494f70 1288getpwd.o : getpwd.c $(CONFIG_H)
79d8453e
RS
1289
1290integrate.o : integrate.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h integrate.h \
0e75bea2 1291 insn-flags.h insn-config.h insn-codes.h expr.h real.h regs.h function.h \
672fd7e2 1292 bytecode.h
79d8453e
RS
1293
1294jump.o : jump.c $(CONFIG_H) $(RTL_H) flags.h hard-reg-set.h regs.h \
1295 insn-config.h insn-flags.h insn-codes.h expr.h real.h
1296stupid.o : stupid.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h
1297
1298cse.o : cse.c $(CONFIG_H) $(RTL_H) regs.h hard-reg-set.h flags.h real.h \
1299 insn-config.h recog.h
1300loop.o : loop.c $(CONFIG_H) $(RTL_H) flags.h loop.h insn-config.h \
1301 insn-flags.h insn-codes.h regs.h hard-reg-set.h recog.h expr.h real.h
1302unroll.o : unroll.c $(CONFIG_H) $(RTL_H) insn-config.h insn-codes.h \
1303 integrate.h regs.h flags.h expr.h loop.h
1304flow.o : flow.c $(CONFIG_H) $(RTL_H) flags.h insn-config.h \
1305 basic-block.h regs.h hard-reg-set.h output.h
eea77e5f 1306combine.o : combine.c $(CONFIG_H) $(RTL_H) flags.h \
79d8453e 1307 insn-config.h insn-flags.h insn-codes.h insn-attr.h regs.h expr.h \
1717563d 1308 basic-block.h recog.h real.h hard-reg-set.h
79d8453e 1309regclass.o : regclass.c $(CONFIG_H) $(RTL_H) hard-reg-set.h flags.h \
672fd7e2 1310 basic-block.h regs.h insn-config.h recog.h reload.h real.h bytecode.h
79d8453e
RS
1311local-alloc.o : local-alloc.c $(CONFIG_H) $(RTL_H) flags.h basic-block.h \
1312 regs.h hard-reg-set.h insn-config.h recog.h output.h
f0ec1f64 1313global.o : global.c $(CONFIG_H) $(RTL_H) flags.h \
79d8453e
RS
1314 basic-block.h regs.h hard-reg-set.h insn-config.h output.h
1315
7dee9e6a 1316reload.o : reload.c $(CONFIG_H) $(RTL_H) flags.h output.h expr.h\
79d8453e 1317 reload.h recog.h hard-reg-set.h insn-config.h insn-codes.h regs.h real.h
c6e11279 1318reload1.o : reload1.c $(CONFIG_H) $(RTL_H) real.h flags.h expr.h \
79d8453e
RS
1319 reload.h regs.h hard-reg-set.h insn-config.h insn-flags.h insn-codes.h \
1320 basic-block.h recog.h output.h
1321caller-save.o : caller-save.c $(CONFIG_H) $(RTL_H) flags.h \
6136d594
RK
1322 regs.h hard-reg-set.h insn-codes.h insn-config.h basic-block.h recog.h \
1323 reload.h expr.h
79d8453e
RS
1324reorg.o : reorg.c $(CONFIG_H) $(RTL_H) conditions.h hard-reg-set.h \
1325 basic-block.h regs.h insn-config.h insn-attr.h insn-flags.h recog.h \
1326 flags.h output.h
1327sched.o : sched.c $(CONFIG_H) $(RTL_H) basic-block.h regs.h hard-reg-set.h \
1328 flags.h insn-config.h insn-attr.h
eea77e5f 1329final.o : final.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h regs.h \
3d195391 1330 recog.h conditions.h insn-config.h insn-attr.h except.h real.h output.h \
b7ac21e3 1331 hard-reg-set.h insn-flags.h insn-codes.h gstab.h xcoffout.h defaults.h
79d8453e
RS
1332recog.o : recog.c $(CONFIG_H) $(RTL_H) \
1333 regs.h recog.h hard-reg-set.h flags.h insn-config.h insn-attr.h \
1334 insn-flags.h insn-codes.h real.h
1335reg-stack.o : reg-stack.c $(CONFIG_H) $(RTL_H) $(TREE_H) \
e3068d6f 1336 regs.h hard-reg-set.h flags.h insn-config.h insn-flags.h
dcfedcd0 1337
b4978ce7 1338$(out_object_file): $(out_file) $(CONFIG_H) $(TREE_H) \
79d8453e
RS
1339 $(RTL_H) regs.h hard-reg-set.h real.h insn-config.h conditions.h \
1340 insn-flags.h output.h insn-attr.h insn-codes.h
9c6e68c2 1341 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(out_file)
79d8453e 1342
4e0db2ce
RK
1343# Build auxiliary files that support ecoff format.
1344mips-tfile: mips-tfile.o version.o $(LIBDEPS)
aab26e16 1345 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS)
4e0db2ce
RK
1346
1347mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H)
1348
1349mips-tdump: mips-tdump.o version.o $(LIBDEPS)
aab26e16 1350 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tdump.o version.o $(LIBS)
4e0db2ce
RK
1351
1352mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H)
1353
579d0ecf
RK
1354# Build file to support OSF/rose half-pic format.
1355halfpic.o: halfpic.c $(CONFIG_H) $(RTL_H) $(TREE_H)
1356
79d8453e
RS
1357# Normally this target is not used; but it is used if you
1358# define ALLOCA=alloca.o. In that case, you must get a suitable alloca.c
1359# from the GNU Emacs distribution.
79d8453e 1360alloca.o: alloca.c
79d8453e 1361 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ALLOCA_FLAGS) \
1d839079 1362 -c `echo $(srcdir)/alloca.c | sed 's,^\./,,'`
79d8453e
RS
1363 $(ALLOCA_FINISH)
1364\f
1365# Generate header and source files from the machine description,
1366# and compile them.
1367
1368.PRECIOUS: insn-config.h insn-flags.h insn-codes.h \
1369 insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \
1370 insn-attr.h insn-attrtab.c
1371
1372# The following pair of rules has this effect:
1373# genconfig is run only if the md has changed since genconfig was last run;
1374# but the file insn-config.h is touched only when its contents actually change.
1375
1376# Each of the other insn-* files is handled by a similar pair of rules.
1377
1402d22c
RS
1378# This causes an anomaly in the results of make -n
1379# because insn-* is older than stamp-*
1380# and thus make -n thinks that insn-* will be updated
1381# and force recompilation of things that depend on it.
424aa086 1382# We use move-if-change precisely to avoid such recompilation.
1402d22c
RS
1383# But there is no way to teach make -n that it will be avoided.
1384
79d8453e
RS
1385# Each of the insn-*.[ch] rules has a semicolon at the end,
1386# for otherwise the system Make on SunOS 4.1 never tries
7bd95cc1
BK
1387# to recompile insn-*.o. To avoid problems and extra noise from
1388# versions of make which don't like empty commands (nothing after the
1389# trailing `;'), we call true for each.
79d8453e 1390
d960abef 1391insn-config.h: stamp-config ; @true
7ac16ba0
RK
1392stamp-config : $(md_file) genconfig $(srcdir)/move-if-change
1393 ./genconfig $(md_file) > tmp-config.h
79d8453e
RS
1394 $(srcdir)/move-if-change tmp-config.h insn-config.h
1395 touch stamp-config
1396
d960abef 1397insn-flags.h: stamp-flags ; @true
7ac16ba0
RK
1398stamp-flags : $(md_file) genflags $(srcdir)/move-if-change
1399 ./genflags $(md_file) > tmp-flags.h
79d8453e
RS
1400 $(srcdir)/move-if-change tmp-flags.h insn-flags.h
1401 touch stamp-flags
1402
d960abef 1403insn-codes.h: stamp-codes ; @true
7ac16ba0
RK
1404stamp-codes : $(md_file) gencodes $(srcdir)/move-if-change
1405 ./gencodes $(md_file) > tmp-codes.h
79d8453e
RS
1406 $(srcdir)/move-if-change tmp-codes.h insn-codes.h
1407 touch stamp-codes
1408
1409insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) expr.h real.h output.h \
1410 insn-config.h insn-flags.h insn-codes.h
1411 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c
1412
d960abef 1413insn-emit.c: stamp-emit ; @true
7ac16ba0
RK
1414stamp-emit : $(md_file) genemit $(srcdir)/move-if-change
1415 ./genemit $(md_file) > tmp-emit.c
79d8453e
RS
1416 $(srcdir)/move-if-change tmp-emit.c insn-emit.c
1417 touch stamp-emit
1418
1419insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h recog.h \
1420 real.h output.h flags.h
1421 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c
1422
d960abef 1423insn-recog.c: stamp-recog ; @true
7ac16ba0
RK
1424stamp-recog : $(md_file) genrecog $(srcdir)/move-if-change
1425 ./genrecog $(md_file) > tmp-recog.c
79d8453e
RS
1426 $(srcdir)/move-if-change tmp-recog.c insn-recog.c
1427 touch stamp-recog
1428
118bdbf8
RK
1429insn-opinit.o : insn-opinit.c $(CONFIG_H) $(RTL_H) insn-codes.h insn-flags.h \
1430 insn-config.h flags.h rtl.h recog.h expr.h reload.h
1431 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-opinit.c
1432
1433insn-opinit.c: stamp-opinit ; @true
7ac16ba0
RK
1434stamp-opinit : $(md_file) genopinit $(srcdir)/move-if-change
1435 ./genopinit $(md_file) > tmp-opinit.c
118bdbf8
RK
1436 $(srcdir)/move-if-change tmp-opinit.c insn-opinit.c
1437 touch stamp-opinit
1438
79d8453e
RS
1439insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H)
1440 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-extract.c
1441
d960abef 1442insn-extract.c: stamp-extract ; @true
7ac16ba0
RK
1443stamp-extract : $(md_file) genextract $(srcdir)/move-if-change
1444 ./genextract $(md_file) > tmp-extract.c
79d8453e
RS
1445 $(srcdir)/move-if-change tmp-extract.c insn-extract.c
1446 touch stamp-extract
1447
1448insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) regs.h output.h real.h
1449 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c
1450
d960abef 1451insn-peep.c: stamp-peep ; @true
7ac16ba0
RK
1452stamp-peep : $(md_file) genpeep $(srcdir)/move-if-change
1453 ./genpeep $(md_file) > tmp-peep.c
79d8453e
RS
1454 $(srcdir)/move-if-change tmp-peep.c insn-peep.c
1455 touch stamp-peep
1456
1457insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(RTL_H) regs.h real.h output.h \
1458 insn-attr.h insn-config.h
1459 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c
1460
d960abef 1461insn-attr.h: stamp-attr ; @true
7ac16ba0
RK
1462stamp-attr : $(md_file) genattr $(srcdir)/move-if-change
1463 ./genattr $(md_file) > tmp-attr.h
79d8453e
RS
1464 $(srcdir)/move-if-change tmp-attr.h insn-attr.h
1465 touch stamp-attr
1466
d960abef 1467insn-attrtab.c: stamp-attrtab ; @true
7ac16ba0
RK
1468stamp-attrtab : $(md_file) genattrtab $(srcdir)/move-if-change
1469 if cmp -s $(PREMADE_ATTRTAB_MD) $(md_file); \
20bd0ab1
RS
1470 then \
1471 echo Using $(PREMADE_ATTRTAB); \
2e0b13db 1472 cp $(PREMADE_ATTRTAB) tmp-attrtab.c; \
20bd0ab1 1473 else \
7ac16ba0 1474 ./genattrtab $(md_file) > tmp-attrtab.c; \
20bd0ab1 1475 fi
79d8453e
RS
1476 $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
1477 touch stamp-attrtab
1478
1479insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) regs.h real.h conditions.h \
1480 hard-reg-set.h insn-config.h insn-flags.h insn-attr.h output.h recog.h \
1481 insn-codes.h
1482 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c
1483
d960abef 1484insn-output.c: stamp-output ; @true
7ac16ba0
RK
1485stamp-output : $(md_file) genoutput $(srcdir)/move-if-change
1486 ./genoutput $(md_file) > tmp-output.c
79d8453e
RS
1487 $(srcdir)/move-if-change tmp-output.c insn-output.c
1488 touch stamp-output
1489\f
1490# Compile the programs that generate insn-* from the machine description.
1491# They are compiled with $(HOST_CC), and associated libraries,
1492# since they need to run on this machine
1493# even if GCC is being compiled to run on some other machine.
1494
1495# $(CONFIG_H) is omitted from the deps of the gen*.o
1496# because these programs don't really depend on anything
1497# about the target machine. They do depend on config.h itself,
1498# since that describes the host machine.
1499
c3efc7c4 1500# Pass the md file through cpp if the target requests it.
aa90345a
RK
1501$(MD_FILE): $(MD_DEPS)
1502 rm -f $@
7ac16ba0 1503 $(MD_CPP) $(MD_CPPFLAGS) $(md_file) | sed 's/^# /; /g' > tmp-$@
d521a023 1504 mv tmp-$@ $@
c3efc7c4 1505
79d8453e 1506genconfig : genconfig.o $(HOST_RTL) $(HOST_LIBDEPS)
aab26e16 1507 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
79d8453e
RS
1508 genconfig.o $(HOST_RTL) $(HOST_LIBS)
1509
7ac16ba0 1510genconfig.o : genconfig.c $(RTL_H) $(build_xm_file)
79d8453e
RS
1511 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c
1512
1513genflags : genflags.o $(HOST_RTL) $(HOST_LIBDEPS)
aab26e16 1514 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
79d8453e
RS
1515 genflags.o $(HOST_RTL) $(HOST_LIBS)
1516
7ac16ba0 1517genflags.o : genflags.c $(RTL_H) $(build_xm_file)
79d8453e
RS
1518 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c
1519
1520gencodes : gencodes.o $(HOST_RTL) $(HOST_LIBDEPS)
aab26e16 1521 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
79d8453e
RS
1522 gencodes.o $(HOST_RTL) $(HOST_LIBS)
1523
7ac16ba0 1524gencodes.o : gencodes.c $(RTL_H) $(build_xm_file)
79d8453e
RS
1525 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c
1526
1527genemit : genemit.o $(HOST_RTL) $(HOST_LIBDEPS)
aab26e16 1528 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
79d8453e
RS
1529 genemit.o $(HOST_RTL) $(HOST_LIBS)
1530
7ac16ba0 1531genemit.o : genemit.c $(RTL_H) $(build_xm_file)
79d8453e
RS
1532 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c
1533
118bdbf8 1534genopinit : genopinit.o $(HOST_RTL) $(HOST_LIBDEPS)
aab26e16 1535 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
118bdbf8
RK
1536 genopinit.o $(HOST_RTL) $(HOST_LIBS)
1537
7ac16ba0 1538genopinit.o : genopinit.c $(RTL_H) $(build_xm_file)
118bdbf8
RK
1539 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genopinit.c
1540
79d8453e 1541genrecog : genrecog.o $(HOST_RTL) $(HOST_LIBDEPS)
aab26e16 1542 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
79d8453e
RS
1543 genrecog.o $(HOST_RTL) $(HOST_LIBS)
1544
7ac16ba0 1545genrecog.o : genrecog.c $(RTL_H) $(build_xm_file)
79d8453e
RS
1546 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c
1547
1548genextract : genextract.o $(HOST_RTL) $(HOST_LIBDEPS)
aab26e16 1549 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
79d8453e
RS
1550 genextract.o $(HOST_RTL) $(HOST_LIBS)
1551
7ac16ba0 1552genextract.o : genextract.c $(RTL_H) $(build_xm_file) insn-config.h
79d8453e
RS
1553 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c
1554
1555genpeep : genpeep.o $(HOST_RTL) $(HOST_LIBDEPS)
aab26e16 1556 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
79d8453e
RS
1557 genpeep.o $(HOST_RTL) $(HOST_LIBS)
1558
7ac16ba0 1559genpeep.o : genpeep.c $(RTL_H) $(build_xm_file)
79d8453e
RS
1560 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c
1561
1562genattr : genattr.o $(HOST_RTL) $(HOST_LIBDEPS)
aab26e16 1563 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
79d8453e
RS
1564 genattr.o $(HOST_RTL) $(HOST_LIBS)
1565
7ac16ba0 1566genattr.o : genattr.c $(RTL_H) $(build_xm_file)
79d8453e
RS
1567 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c
1568
d3614a37 1569genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBDEPS)
aab26e16 1570 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
d3614a37 1571 genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_RTLANAL) $(HOST_LIBS)
79d8453e 1572
7ac16ba0 1573genattrtab.o : genattrtab.c $(RTL_H) $(build_xm_file) insn-config.h
79d8453e
RS
1574 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c
1575
1576genoutput : genoutput.o $(HOST_RTL) $(HOST_LIBDEPS)
aab26e16 1577 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
79d8453e
RS
1578 genoutput.o $(HOST_RTL) $(HOST_LIBS)
1579
7ac16ba0 1580genoutput.o : genoutput.c $(RTL_H) $(build_xm_file)
79d8453e
RS
1581 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c
1582\f
1583# Compile the libraries to be used by gen*.
1584# If we are not cross-building, gen* use the same .o's that cc1 will use,
1585# and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict
1586# with the rules for rtl.o, alloca.o, etc.
1587$(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(CONFIG_H) $(RTL_H)
1588 rm -f $(HOST_PREFIX)rtl.c
057f494b 1589 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtl.c > $(HOST_PREFIX)rtl.c
79d8453e
RS
1590 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtl.c
1591
d3614a37
RS
1592$(HOST_PREFIX_1)print-rtl.o: $(srcdir)/print-rtl.c $(CONFIG_H) $(RTL_H)
1593 rm -f $(HOST_PREFIX)print-rtl.c
057f494b 1594 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/print-rtl.c > $(HOST_PREFIX)print-rtl.c
d3614a37
RS
1595 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)print-rtl.c
1596
79d8453e
RS
1597$(HOST_PREFIX_1)rtlanal.o: $(srcdir)/rtlanal.c $(CONFIG_H) $(RTL_H)
1598 rm -f $(HOST_PREFIX)rtlanal.c
057f494b 1599 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtlanal.c > $(HOST_PREFIX)rtlanal.c
79d8453e
RS
1600 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtlanal.c
1601
1602$(HOST_PREFIX_1)alloca.o: alloca.c
1603 rm -f $(HOST_PREFIX)alloca.c
1604 cp $(srcdir)/alloca.c $(HOST_PREFIX)alloca.c
1605 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c
1606
1607$(HOST_PREFIX_1)obstack.o: obstack.c
1608 rm -f $(HOST_PREFIX)obstack.c
057f494b 1609 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/obstack.c > $(HOST_PREFIX)obstack.c
79d8453e
RS
1610 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c
1611
1612$(HOST_PREFIX_1)malloc.o: malloc.c
1613 rm -f $(HOST_PREFIX)malloc.c
057f494b 1614 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/malloc.c > $(HOST_PREFIX)malloc.c
79d8453e
RS
1615 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)malloc.c
1616
1617# This satisfies the dependency that we get if you cross-compile a compiler
1618# that does not need to compile alloca, malloc or whatever.
1619$(HOST_PREFIX_1):
1620 touch $(HOST_PREFIX_1)
1621\f
ca695ac9 1622# Remake bytecode files.
ca695ac9
JB
1623BI_OBJ=bi-parser.o bi-lexer.o bi-reverse.o
1624
4f1c4914 1625bc-emit.o : bc-emit.c $(CONFIG_H) $(RTL_H) real.h $(BYTECODE_H) \
aab26e16 1626 bc-arity.h bc-opcode.h bc-typecd.h bc-typecd.def bi-run.h bytetypes.h
4f1c4914 1627bc-optab.o : bc-optab.c $(CONFIG_H) $(REAL_H) $(BYTECODE_H) \
aab26e16 1628 bc-opcode.h bc-typecd.h bc-typecd.def
ca695ac9 1629
4f1c4914 1630bi-arity: bi-arity.o $(BI_OBJ) $(HOST_LIBDEPS)
aab26e16 1631 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
258a0dd4 1632 bi-arity.o $(BI_OBJ) $(HOST_LIBS)
4f1c4914 1633bi-opcode: bi-opcode.o $(BI_OBJ) $(HOST_LIBDEPS)
aab26e16 1634 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
258a0dd4 1635 bi-opcode.o $(BI_OBJ) $(HOST_LIBS)
4f1c4914 1636bi-opname: bi-opname.o $(BI_OBJ) $(HOST_LIBDEPS)
aab26e16 1637 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
258a0dd4 1638 bi-opname.o $(BI_OBJ) $(HOST_LIBS)
4f1c4914 1639
a1fa1e22
DE
1640$(srcdir)/bi-parser.h: $(srcdir)/bi-parser.c
1641$(srcdir)/bi-parser.c: $(srcdir)/bi-parser.y
4f1c4914 1642 cd $(srcdir); $(BISON) $(BISONFLAGS) -d bi-parser.y -o bi-parser.c
aab26e16 1643
3ff34537 1644bi-parser.o: $(srcdir)/bi-parser.c bi-defs.h $(build_xm_file)
4f1c4914
RS
1645 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
1646 $(srcdir)/bi-parser.c
3ff34537 1647bi-lexer.o: bi-lexer.c $(srcdir)/bi-parser.h $(build_xm_file)
4f1c4914
RS
1648 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
1649 $(srcdir)/bi-lexer.c
aab26e16 1650bi-arity.o: bi-arity.c bi-defs.h $(build_xm_file)
4f1c4914
RS
1651 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
1652 $(srcdir)/bi-arity.c
aab26e16 1653bi-opcode.o: bi-opcode.c bi-defs.h $(build_xm_file)
4f1c4914
RS
1654 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
1655 $(srcdir)/bi-opcode.c
aab26e16 1656bi-opname.o: bi-opname.c bi-defs.h $(build_xm_file)
4f1c4914
RS
1657 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
1658 $(srcdir)/bi-opname.c
aab26e16 1659bi-reverse.o: bi-reverse.c bi-defs.h
4f1c4914
RS
1660 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
1661 $(srcdir)/bi-reverse.c
672fd7e2 1662
cd7fd682
RS
1663bc-arity.h: stamp-bcarity ; @true
1664stamp-bcarity : $(srcdir)/bytecode.def bi-arity $(srcdir)/move-if-change
bd7b47c7
JB
1665 ./bi-arity < $(srcdir)/bytecode.def >tmp-bc-arity.h
1666 $(srcdir)/move-if-change tmp-bc-arity.h bc-arity.h
0e54aab2 1667 touch stamp-bcarity
ca695ac9 1668
cd7fd682
RS
1669bc-opcode.h: stamp-bcopcode ; @true
1670stamp-bcopcode : $(srcdir)/bytecode.def bi-opcode $(srcdir)/move-if-change
a11826d1
RS
1671 ./bi-opcode < $(srcdir)/bytecode.def >tmp-bcopcd.h
1672 $(srcdir)/move-if-change tmp-bcopcd.h bc-opcode.h
0e54aab2 1673 touch stamp-bcopcode
ca695ac9 1674
cd7fd682
RS
1675bc-opname.h: stamp-bcopname ; @true
1676stamp-bcopname : $(srcdir)/bytecode.def bi-opname $(srcdir)/move-if-change
a11826d1
RS
1677 ./bi-opname < $(srcdir)/bytecode.def >tmp-bcopnm.h
1678 $(srcdir)/move-if-change tmp-bcopnm.h bc-opname.h
0e54aab2 1679 touch stamp-bcopname
ca695ac9
JB
1680
1681bytecode.mostlyclean:
1682 -rm -f bc-arity.h bc-opcode.h bc-opname.h
1683
1684bytecode.distclean bytecode.clean: bytecode.mostlyclean
4f1c4914 1685 -rm -f bi-arity bi-opcode bi-opname bi-lexer
ca695ac9 1686
f1908d70 1687bytecode.maintainer-clean: bytecode.clean
bc573003 1688 -rm -f bi-parser.c bi-parser.h
ca695ac9
JB
1689
1690\f
79d8453e
RS
1691# Remake cpp and protoize.
1692
1693# Making the preprocessor
59949f60 1694cpp: $(CCCP)
173712fb 1695 -rm -f cpp$(exeext)
59949f60
PB
1696 ln $(CCCP)$(exeext) cpp$(exeext) > /dev/null 2>&1 \
1697 || cp $(CCCP)$(exeext) cpp$(exeext)
79d8453e 1698cccp: cccp.o cexp.o version.o $(LIBDEPS)
aab26e16
RK
1699 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ cccp.o cexp.o \
1700 version.o $(LIBS)
3ff34537 1701cexp.o: $(srcdir)/cexp.c $(CONFIG_H)
79d8453e
RS
1702 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/cexp.c
1703$(srcdir)/cexp.c: $(srcdir)/cexp.y
1704 cd $(srcdir); $(BISON) -o cexp.c cexp.y
aab26e16 1705
5c539087 1706cccp.o: cccp.c $(CONFIG_H) pcp.h version.c config.status
79d8453e
RS
1707# The reason we use $(libdir)/g++-include rather than using libsubdir
1708# is for compatibility with the current version of libg++.
1709 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2e494f70 1710 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
89b3e3b4 1711 -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
5d6be9c8 1712 -DOLD_GPLUSPLUS_INCLUDE_DIR=\"$(old_gxx_include_dir)\" \
3d5e2367 1713 -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
2e494f70 1714 -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
14b18068 1715 -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
79d8453e
RS
1716 -c `echo $(srcdir)/cccp.c | sed 's,^\./,,'`
1717
59949f60
PB
1718cppmain: cppmain.o cpplib.o cpphash.o cppalloc.o cpperror.o cppexp.o \
1719 version.o $(LIBDEPS)
aab26e16
RK
1720 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ cppmain.o cpplib.o cpphash.o \
1721 cppalloc.o cpperror.o cppexp.o version.o $(LIBS)
59949f60 1722
66334b64
RK
1723cppmain.o: cppmain.c $(CONFIG_H) cpplib.h
1724
594f6fc5 1725cpplib.o: cpplib.c $(CONFIG_H) cpplib.h cpphash.h config.status
59949f60
PB
1726 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1727 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
1728 -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
5d6be9c8 1729 -DOLD_GPLUSPLUS_INCLUDE_DIR=\"$(old_gxx_include_dir)\" \
59949f60
PB
1730 -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
1731 -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
1732 -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
1733 -c `echo $(srcdir)/cpplib.c | sed 's,^\./,,'`
1734
594f6fc5
RK
1735cpperror.o: cpperror.c $(CONFIG_H) cpplib.h
1736
1737cppexp.o: cppexp.c $(CONFIG_H) cpplib.h
1738
1739cpphash.o: cpphash.c cpplib.h cpphash.h
1740
293af484
RK
1741cppalloc.o: cppalloc.c $(CONFIG_H)
1742
7bd95cc1
BK
1743# Note for the stamp targets, we run the program `true' instead of
1744# having an empty command (nothing following the semicolon).
1745
cce7aea7 1746proto: config.status protoize unprotoize SYSCALLS.c.X
79d8453e 1747
c6e087c5
DE
1748protoize: protoize.o getopt.o getopt1.o getpwd.o version.o \
1749 pexecute.o choose-temp.o $(LIBDEPS)
aab26e16 1750 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
c6e087c5
DE
1751 protoize.o getopt.o getopt1.o getpwd.o version.o \
1752 pexecute.o choose-temp.o $(LIBS)
d960abef 1753protoize.o: stamp-proto ; @true
2e0b13db 1754
c6e087c5
DE
1755unprotoize: unprotoize.o getopt.o getopt1.o getpwd.o version.o \
1756 pexecute.o choose-temp.o $(LIBDEPS)
aab26e16 1757 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
c6e087c5
DE
1758 unprotoize.o getopt.o getopt1.o getpwd.o version.o \
1759 pexecute.o choose-temp.o $(LIBS)
d960abef 1760unprotoize.o: stamp-proto ; @true
2e0b13db 1761
aab26e16 1762stamp-proto: protoize.c getopt.h $(CONFIG_H)
79d8453e
RS
1763 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1764 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
89b3e3b4 1765 -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
79d8453e 1766 -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
14b18068 1767 -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
3d5e2367 1768 -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
79d8453e 1769 -DSTD_PROTO_DIR=\"$(libsubdir)\" \
2e0b13db 1770 -DUNPROTOIZE $(srcdir)/protoize.c
aab26e16 1771 mv protoize$(objext) unprotoize$(objext)
79d8453e
RS
1772 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1773 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
89b3e3b4 1774 -DGPLUSPLUS_INCLUDE_DIR=\"$(gxx_include_dir)\" \
79d8453e 1775 -DCROSS_INCLUDE_DIR=\"$(libsubdir)/sys-include\" \
14b18068 1776 -DTOOL_INCLUDE_DIR=\"$(tooldir)/include\" \
3d5e2367 1777 -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
79d8453e 1778 -DSTD_PROTO_DIR=\"$(libsubdir)\" \
2e0b13db 1779 $(srcdir)/protoize.c
acbbf3d9 1780 touch stamp-proto
79d8453e 1781
aab26e16 1782getopt.o: getopt.c getopt.h
79d8453e 1783 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt.c
aab26e16 1784getopt1.o: getopt1.c getopt.h
79d8453e
RS
1785 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/getopt1.c
1786
79d8453e 1787# This info describes the target machine, so compile with GCC just built.
aab26e16
RK
1788SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES) \
1789 stmp-int-hdrs
c21cf0a7 1790 -rm -f SYSCALLS.c tmp-SYSCALLS.s
47547081 1791 cat $(srcdir)/sys-types.h $(srcdir)/sys-protos.h > SYSCALLS.c
79d8453e 1792 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
c21cf0a7
RS
1793 -aux-info $@ -S -o tmp-SYSCALLS.s SYSCALLS.c
1794 -rm -f SYSCALLS.c tmp-SYSCALLS.s
9c0022f6 1795
ac1284f9 1796
9c0022f6 1797test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES)
4803a34a 1798 -rm -f tmp-proto.[cso]
d3614a37
RS
1799 cp $(srcdir)/protoize.c tmp-proto.c
1800 chmod u+w tmp-proto.c
4803a34a
RK
1801 ./protoize -N -B ./ -x getopt.h -c "-B./ -Wall -Wwrite-strings \
1802 $(CFLAGS) $(INCLUDES) \
9c0022f6
RS
1803 -DGCC_INCLUDE_DIR=0 \
1804 -DGPLUSPLUS_INCLUDE_DIR=0 \
1805 -DCROSS_INCLUDE_DIR=0 \
14b18068 1806 -DTOOL_INCLUDE_DIR=0 \
d3614a37 1807 -DSTD_PROTO_DIR=0" tmp-proto.c
e3e873d2 1808 @echo '**********' Expect 400 lines of differences.
4803a34a
RK
1809 -diff $(srcdir)/protoize.c tmp-proto.c > tmp-proto.diff
1810 -wc -l tmp-proto.diff
1811 ./unprotoize -N -x getopt.h -c "-B./ -Wall -Wwrite-strings \
1812 $(CFLAGS) $(INCLUDES) \
9c0022f6
RS
1813 -DGCC_INCLUDE_DIR=0 \
1814 -DGPLUSPLUS_INCLUDE_DIR=0 \
1815 -DCROSS_INCLUDE_DIR=0 \
14b18068 1816 -DTOOL_INCLUDE_DIR=0 \
d3614a37 1817 -DSTD_PROTO_DIR=0" tmp-proto.c
9c0022f6 1818 @echo Expect zero differences.
d3614a37 1819 diff $(srcdir)/protoize.c tmp-proto.c | cat
aab26e16 1820 -rm -f tmp-proto.[cs] tmp-proto$(objext)
79d8453e 1821\f
ba1811f1
ILT
1822# Build the include directory. The stamp files are stmp-* rather than
1823# stamp-* so that mostlyclean does not force the include directory to
1824# be rebuilt.
1825
56f9206d
ILT
1826# Build the include directory except for float.h (which depends upon
1827# enquire).
eea77e5f 1828stmp-int-hdrs: stmp-fixinc $(USER_H) xlimits.h objc-headers
ba1811f1
ILT
1829# Copy in the headers provided with gcc.
1830# The sed command gets just the last file name component;
1831# this is necessary because VPATH could add a dirname.
1832# Using basename would be simpler, but some systems don't have it.
d7371761
RK
1833 for file in .. $(USER_H); do \
1834 if [ X$$file != X.. ]; then \
1835 realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
ae678a13
JW
1836 rm -f include/$$realfile; \
1837 cp $$file include; \
1838 chmod a+r include/$$realfile; \
d7371761 1839 fi; \
ba1811f1 1840 done
1f050b9b 1841 rm -f include/limits.h
ba1811f1
ILT
1842 cp xlimits.h include/limits.h
1843 chmod a+r include/limits.h
ba1811f1 1844# Install the README
1f050b9b 1845 rm -f include/README
ba1811f1
ILT
1846 cp $(srcdir)/README-fixinc include/README
1847 chmod a+r include/README
56f9206d
ILT
1848 touch stmp-int-hdrs
1849
1850# Build the complete include directory.
1851stmp-headers: stmp-int-hdrs gfloat.h
1852 rm -f include/float.h
1853 cp gfloat.h include/float.h
1854 chmod a+r include/float.h
ba1811f1
ILT
1855 touch stmp-headers
1856
1857# Build fixed copies of system files.
aab26e16 1858stmp-fixinc: $(FIXINCLUDES) gsyslimits.h
ba1811f1
ILT
1859 rm -rf include
1860 mkdir include
b82a0ad9 1861 if [ x$(FIXINCLUDES) != xMakefile.in ]; \
98e4b835
RS
1862 then \
1863 for dir in $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS); do \
1864 if [ -d $$dir ]; \
1865 then \
eb3af43c 1866 $(SHELL) $(srcdir)/$(FIXINCLUDES) include $$dir; \
98e4b835 1867 else true; fi; \
b82a0ad9 1868 done; \
98e4b835
RS
1869 else true; \
1870 fi
3dc4a939
RK
1871 rm -f include/syslimits.h
1872 if [ -f include/limits.h ]; then \
1873 mv include/limits.h include/syslimits.h; \
1874 else \
1875 cp $(srcdir)/gsyslimits.h include/syslimits.h; \
1876 fi
1877 chmod a+r include/syslimits.h
49b6e255 1878 touch stmp-fixinc
469778e2 1879
41fe5ef9 1880# copy objc header files into build directory
c2dd11d9 1881objc-headers: stmp-fixinc
0dbb682d 1882 if [ -d include ]; then true; else mkdir include; fi
d68d6b81 1883 if [ -d objc ]; then true; else mkdir objc; fi
469778e2
RS
1884 thisdir1=`pwd`; \
1885 srcdir1=`cd $(srcdir); pwd`; \
1886 cd objc; \
26bbb206
MS
1887 if [ -f $${srcdir1}/objc/Makefile ]; then \
1888 $(MAKE) -f $${srcdir1}/objc/Makefile copy-headers \
1889 srcdir=$${srcdir1} tooldir=$(tooldir) AR="$(AR)" AR_FLAGS="$(AR_FLAGS)" \
1890 GCC_FOR_TARGET="$${thisdir1}/xgcc -B$${thisdir1}/" \
1891 GCC_CFLAGS="$(GCC_CFLAGS)" incinstalldir=$${thisdir1}/include; \
1892 fi
41fe5ef9 1893 touch objc-headers
ac1284f9
PB
1894
1895# Files related to the fixproto script.
1896
74bb4fdf 1897deduced.h: $(GCC_PASSES) $(srcdir)/scan-types.sh stmp-int-hdrs
4fc15c03 1898 CC="$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -I. -I$(srcdir) -Iinclude -I${SYSTEM_HEADER_DIR}"; \
ac1284f9 1899 export CC; \
9cfb5dd6 1900 $(SHELL) $(srcdir)/scan-types.sh "$(srcdir)" >tmp-deduced.h
ac1284f9
PB
1901 mv tmp-deduced.h deduced.h
1902
b3ca463c 1903gen-protos: gen-protos.o scan.o cppalloc.o $(HOST_LIBDEPS)
aab26e16 1904 ${HOST_CC} $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
b3ca463c 1905 gen-protos.o scan.o cppalloc.o $(HOST_LIBS)
ac1284f9 1906
7ac16ba0 1907gen-protos.o: gen-protos.c scan.h $(build_xm_file)
c192da27
RK
1908 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gen-protos.c
1909
7ac16ba0 1910scan.o: scan.c scan.h $(build_xm_file)
c192da27 1911 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan.c
7b41f815 1912
74bb4fdf 1913xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos Makefile
d521a023
RK
1914 cat deduced.h $(srcdir)/sys-protos.h > tmp-fixtmp.c
1915 mv tmp-fixtmp.c fixtmp.c
c061c5d7 1916 $(GCC_FOR_TARGET) fixtmp.c -w -U__SIZE_TYPE__ -U__PTRDIFF_TYPE__ -U__WCHAR_TYPE__ -E \
c1b9947f 1917 | sed -e 's/ / /g' -e 's/ *(/ (/g' -e 's/ [ ]*/ /g' -e 's/( )/()/' \
d521a023
RK
1918 | ./gen-protos >xsys-protos.hT
1919 mv xsys-protos.hT xsys-protos.h
d7a58f93 1920 rm -rf fixtmp.c
ac1284f9 1921
aab26e16
RK
1922fix-header: fix-header.o scan-decls.o scan.o xsys-protos.h $(HOST_LIBDEPS) \
1923 cpplib.o cpphash.o cppalloc.o cppexp.o cpperror.o version.o
1924 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ fix-header.o \
1925 scan-decls.o scan.o cpplib.o cpphash.o cppalloc.o version.o \
1926 cppexp.o $(HOST_LIBS)
ac1284f9 1927
0de9e56a 1928fix-header.o: fix-header.c obstack.h scan.h xsys-protos.h $(build_xm_file)
c192da27
RK
1929 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/fix-header.c
1930
44e62a7a 1931scan-decls.o: scan-decls.c scan.h cpplib.h $(build_xm_file)
c192da27 1932 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan-decls.c
ac1284f9 1933
74bb4fdf
RS
1934# stmp-fixproto depends on this, not on fix-header directly.
1935# The idea is to make sure fix-header gets built,
1936# but not rerun fixproto after each stage
1937# just because fix-header's mtime has changed.
1938fixhdr.ready: fix-header
1939 -if [ -f fixhdr.ready ] ; then \
1940 true; \
1941 else \
1942 touch fixhdr.ready; \
1943 fi
1944
ccaf7a07 1945# stmp-headers is to make sure fixincludes has already finished.
700ba19c
RS
1946# The if statement is so that we don't run fixproto a second time
1947# if it has already been run on the files in `include'.
c28464ad 1948stmp-fixproto: fixhdr.ready fixproto stmp-headers
db4e119f 1949 @echo "Various warnings and error messages from fixproto are normal"
70fbceee 1950 -if [ -d include ] ; then true; else mkdir include; fi
6e5bea54 1951 -if [ -f include/fixed ] ; then true; \
700ba19c 1952 else \
b1f99e2f 1953 : This line works around a 'make' bug in BSDI 1.1.; \
b3ca463c
PB
1954 FIXPROTO_DEFINES="$(FIXPROTO_DEFINES)"; export FIXPROTO_DEFINES; \
1955 $(SHELL) ${srcdir}/fixproto include include $(SYSTEM_HEADER_DIR); \
700ba19c
RS
1956 touch include/fixed; \
1957 fi
ac1284f9 1958 touch stmp-fixproto
ba1811f1 1959\f
79d8453e
RS
1960# Remake the info files.
1961
8dbda01e 1962doc: info
013a2ee0 1963info: $(srcdir)/cpp.info $(srcdir)/gcc.info lang.info
79d8453e 1964
f780d21b 1965$(srcdir)/cpp.info: cpp.texi
3ef4c269 1966 cd $(srcdir); $(MAKEINFO) $(MAKEINFOFLAGS) cpp.texi
79d8453e 1967
f780d21b
RS
1968$(srcdir)/gcc.info: gcc.texi extend.texi install.texi invoke.texi \
1969 md.texi rtl.texi tm.texi
3ef4c269 1970 cd $(srcdir); $(MAKEINFO) $(MAKEINFOFLAGS) gcc.texi
f780d21b 1971
013a2ee0 1972dvi: $(srcdir)/gcc.dvi $(srcdir)/cpp.dvi lang.dvi
8dbda01e 1973
dd08cdda
RS
1974# This works with GNU Make's default rule.
1975$(srcdir)/gcc.dvi: gcc.texi extend.texi install.texi invoke.texi \
1976 md.texi rtl.texi tm.texi
d8984b6e 1977 $(TEXI2DVI) $<
dd08cdda
RS
1978
1979# This works with GNU Make's default rule.
1980$(srcdir)/cpp.dvi: cpp.texi
d8984b6e 1981 $(TEXI2DVI) $<
dd08cdda 1982
f780d21b 1983$(srcdir)/INSTALL: install1.texi install.texi
b3b08966
RS
1984 $(MAKEINFO) -D INSTALLONLY --no-header --no-split \
1985 `echo $(srcdir)/install1.texi | sed 's,^\./,,'`
79d8453e
RS
1986\f
1987# Deletion of files made during compilation.
1988# There are four levels of this:
f1908d70 1989# `mostlyclean', `clean', `distclean' and `maintainer-clean'.
79d8453e 1990# `mostlyclean' is useful while working on a particular type of machine.
2e494f70 1991# It deletes most, but not all, of the files made by compilation.
79d8453e 1992# It does not delete libgcc.a or its parts, so it won't have to be recompiled.
2e494f70 1993# `clean' deletes everything made by running `make all'.
47547081 1994# `distclean' also deletes the files made by config.
f1908d70
RK
1995# `maintainer-clean' also deletes everything that could be regenerated
1996# automatically. We remove as much from the language subdirectories as we can
013a2ee0 1997# (less duplicated code).
79d8453e 1998
47547081 1999
013a2ee0 2000mostlyclean: bytecode.mostlyclean lang.mostlyclean
79d8453e 2001 -rm -f $(STAGESTUFF)
b7677189
RS
2002# Clean the objc subdir if we created one.
2003 if [ -d objc ]; then \
2004 srcdir1=`cd $(srcdir); pwd`; \
dbe56a66 2005 cd objc; $(MAKE) -f $$srcdir1/objc/Makefile mostlyclean; \
b7677189 2006 else true; fi
8ba23f20 2007 -rm -f libobjc.a
79d8453e
RS
2008# Delete the temporary source copies for cross compilation.
2009 -rm -f $(HOST_PREFIX_1)rtl.c $(HOST_PREFIX_1)rtlanal.c
2010 -rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c
2011 -rm -f $(HOST_PREFIX_1)obstack.c
2012# Delete the temp files made in the course of building libgcc.a.
7c65f72c 2013 -rm -f tmplibgcc* tmpcopy xlimits.h
79d8453e
RS
2014 for name in $(LIB1FUNCS); do rm -f $${name}.c; done
2015# Delete other temporary files.
cadb41d5 2016 -rm -f tmp-float.h tmp-gcc.xtar.gz
c21cf0a7 2017 -rm -f tmp-foo1 tmp-foo2 tmp-proto.* tmp-unproto.1 tmp-SYSCALLS.s
70d791f4 2018 -rm -f tmp-c-parse.y tmp-objc-prs.y tmp-gperf.h
d521a023
RK
2019 -rm -f tmp-specs t-float.h-cross tmp-xlimits.h
2020 -rm -f tmp-fixtmp.c xsys-protos.hT
79d8453e
RS
2021# Delete the stamp files.
2022 -rm -f stamp-* tmp-*
013a2ee0 2023 -rm -f */stamp-* */tmp-*
2e494f70 2024# Delete debugging dump files.
79d8453e 2025 -rm -f *.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop
2e494f70 2026 -rm -f *.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack
013a2ee0
DE
2027 -rm -f */*.greg */*.lreg */*.combine */*.flow */*.cse */*.jump */*.rtl
2028 -rm -f */*.tree */*.loop */*.dbr */*.jump2 */*.sched */*.cse2
2029 -rm -f */*.sched2 */*.stack
2e494f70 2030# Delete some files made during installation.
42118350 2031 -rm -f specs gfloat.h float.h-* enquire SYSCALLS.c.X SYSCALLS.c
813fc11c 2032 -rm -f collect collect2 mips-tfile mips-tdump alloca.s
ac1284f9 2033# Delete files generated for fixproto
1162b3a6 2034 -rm -rf fix-header xsys-protos.h deduced.h tmp-deduced.h \
02521409 2035 gen-protos fixproto.list fixtmp.* fixhdr.ready
2e494f70
RS
2036# Delete unwanted output files from TeX.
2037 -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
013a2ee0 2038 -rm -f */*.toc */*.log */*.vr */*.fn */*.cp */*.tp */*.ky */*.pg
47547081
RS
2039# Delete sorted indices we don't actually use.
2040 -rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns
2e494f70 2041# Delete core dumps.
013a2ee0 2042 -rm -f core */core
79d8453e 2043
47547081
RS
2044# Delete all files made by compilation
2045# that don't exist in the distribution.
013a2ee0 2046clean: mostlyclean bytecode.clean lang.clean
20bd0ab1
RS
2047# It may not be quite desirable to delete unprotoize.c here,
2048# but the spec for `make clean' requires it.
2049# Using unprotoize.c is not quite right in the first place,
2050# but what better way is there?
8521c499 2051 -rm -f libgcc.a libgcc1.a libgcc1-asm.a libgcc2.a libgcc2.ready
43554690 2052 -rm -f libgcc1.null
be0d23ff 2053 -rm -f *.dvi
013a2ee0 2054 -rm -f */*.dvi
c3efc7c4
DE
2055 -if [ -f md.pre-cpp ]; then \
2056 rm -f md ; \
2057 fi
ba1811f1 2058# Delete the include directory.
9a52cd0d 2059 -rm -rf stmp-* include objc-headers
013a2ee0 2060 -rm -f */stmp-*
75ed5d8b 2061# Delete files used by the "multilib" facility (including libgcc subdirs).
f6cdc7ea 2062 -rm -f multilib.h tmpmultilib*
75ed5d8b
DE
2063 -if [ "x$(MULTILIB_DIRNAMES)" != x ] ; then \
2064 rm -rf $(MULTILIB_DIRNAMES); \
2065 else if [ "x$(MULTILIB_OPTIONS)" != x ] ; then \
2066 rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \
2067 fi ; fi
79d8453e 2068
47547081
RS
2069# Delete all files that users would normally create
2070# while building and installing GCC.
013a2ee0 2071distclean: clean bytecode.distclean lang.distclean
c40d5de4 2072 -rm -f tm.h config.h tconfig.h hconfig.h md
da0d7cb1 2073 -rm -f config.status config.run
c40d5de4 2074 -rm -f Makefile specs.h options.h *.oaux
47547081 2075 -rm -fr stage1 stage2 stage3 stage4
26f887e5 2076 -rm -f */stage1 */stage2 */stage3 */stage4 */include
3dab45b7
RS
2077 -rm -f objc-parse.output
2078 -rm -f c-parse.output
338023d4 2079 -rm -f *.asm
67446ffe 2080 -rm -f float.h
2e494f70
RS
2081
2082# Delete anything likely to be found in the source directory
2083# that shouldn't be in the distribution.
013a2ee0 2084extraclean: distclean lang.extraclean
fb92d909 2085 -rm -rf =* ./"#"* *~* config/=* config/"#"* config/*~*
be0d23ff 2086 -rm -f patch* *.orig *.rej config/patch* config/*.orig config/*.rej
3dab45b7
RS
2087 -rm -f config/*/=* config/*/"#"* config/*/*~*
2088 -rm -f config/*/*.orig config/*/*.rej
d72a7857 2089 -rm -f *.dvi *.ps *.oaux *.d *.[zZ] *.gz
184be4bf 2090 -rm -f *.tar *.xtar *diff *.diff.* *.tar.* *.xtar.* *diffs
3dab45b7 2091 -rm -f *lose config/*lose config/*/*lose
32e6e69a 2092 -rm -f *.s *.s[0-9] *.i install1.texi config/ChangeLog
013a2ee0
DE
2093 -rm -f */=* */"#"* */*~*
2094 -rm -f */patch* */*.orig */*.rej
2095 -rm -f */*.dvi */*.oaux */*.d */*.[zZ] */*.gz
2096 -rm -f */*.tar */*.xtar */*diff */*.diff.* */*.tar.* */*.xtar.* */*diffs
2097 -rm -f */*lose */*.s */*.s[0-9] */*.i
79d8453e
RS
2098
2099# Get rid of every file that's generated from some other file.
2100# Most of these files ARE PRESENT in the GCC distribution.
f1908d70 2101maintainer-clean: distclean bytecode.maintainer-clean lang.maintainer-clean
f137e7dc 2102 -rm -f c-parse.y c-gperf.h objc-parse.y
79d8453e 2103 -rm -f objc-parse.c objc-parse.output
79d8453e
RS
2104 -rm -f c-parse.c c-parse.h c-parse.output
2105 -rm -f cexp.c cexp.output TAGS
2e494f70
RS
2106 -rm -f cpp.info* cpp.??s cpp.*aux
2107 -rm -f gcc.info* gcc.??s gcc.*aux
79d8453e
RS
2108\f
2109# Entry points `install' and `uninstall'.
2e494f70 2110# Also use `install-collect2' to install collect2 when the config files don't.
79d8453e 2111
1402d22c 2112# The semicolon is to prevent the install.sh -> install default rule
7bd95cc1
BK
2113# from doing anything. Having it run true helps avoid problems and
2114# noise from versions of make which don't like to have null commands.
d960abef 2115install: $(INSTALL_TARGET) ; @true
79d8453e 2116
ba1811f1 2117# Copy the compiler files into directories where they will be run.
aab26e16
RK
2118# Install the driver last so that the window when things are
2119# broken is small.
b583eed8 2120install-normal: install-common $(INSTALL_HEADERS) $(INSTALL_LIBGCC) \
aab26e16 2121 install-libobjc install-man install-info lang.install-normal install-driver
79d8453e 2122
057f494b
RS
2123# Do nothing while making gcc with a cross-compiler. The person who
2124# makes gcc for the target machine has to know how to put a complete
2125# gcc together by hand.
2126install-build: force
2127 @echo You have to install gcc on your target machine by hand.
2128
79d8453e
RS
2129# Run this on the target machine
2130# to finish installation of cross compiler.
2131install-cross-rest: install-float-h-cross
2132
2133# Install float.h for cross compiler.
2134# Run this on the target machine!
69cbb85a 2135install-float-h-cross: installdirs
3f7531db
RS
2136# if [ -f enquire ] ; then true; else false; fi
2137# Note: don't use -. We should fail right away if enquire was not made.
2138 ./enquire -f > $(tmpdir)/float.h
79d8453e 2139 -rm -f $(libsubdir)/include/float.h
62c13b81
RS
2140 $(INSTALL_DATA) $(tmpdir)/float.h $(libsubdir)/include/float.h
2141 -rm -f $(tmpdir)/float.h
79d8453e
RS
2142 chmod a-x $(libsubdir)/include/float.h
2143
69cbb85a
RK
2144# Create the installation directories.
2145installdirs:
2146 -if [ -d $(prefix) ] ; then true ; else mkdir $(prefix) ; chmod a+rx $(prefix) ; fi
2147 -if [ -d $(exec_prefix) ] ; then true ; else mkdir $(exec_prefix) ; chmod a+rx $(exec_prefix) ; fi
394fa7c8
JW
2148 -if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; chmod a+rx $(libdir) ; fi
2149 -if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib ; chmod a+rx $(libdir)/gcc-lib ; fi
9eb91772 2150# This dir isn't currently searched by cpp.
394fa7c8 2151# -if [ -d $(libdir)/gcc-lib/include ] ; then true ; else mkdir $(libdir)/gcc-lib/include ; chmod a+rx $(libdir)/gcc-lib/include ; fi
8b06b20a
RK
2152 -if [ -d $(libdir)/gcc-lib/$(target_alias) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias) ; chmod a+rx $(libdir)/gcc-lib/$(target_alias) ; fi
2153 -if [ -d $(libdir)/gcc-lib/$(target_alias)/$(version) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias)/$(version) ; chmod a+rx $(libdir)/gcc-lib/$(target_alias)/$(version) ; fi
2154 -if [ -d $(libdir)/gcc-lib/$(target_alias)/$(version)/include ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias)/$(version)/include ; chmod a+rx $(libdir)/gcc-lib/$(target_alias)/$(version)/include ; fi
394fa7c8
JW
2155 -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; chmod a+rx $(bindir) ; fi
2156 -if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; chmod a+rx $(includedir) ; fi
2157 -if [ -d $(tooldir) ] ; then true ; else mkdir $(tooldir) ; chmod a+rx $(tooldir) ; fi
2158 -if [ -d $(assertdir) ] ; then true ; else mkdir $(assertdir) ; chmod a+rx $(assertdir) ; fi
2159 -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; chmod a+rx $(infodir) ; fi
79d8453e
RS
2160# We don't use mkdir -p to create the parents of mandir,
2161# because some systems don't support it.
2162# Instead, we use this technique to create the immediate parent of mandir.
935e11b0 2163 -parent=`echo $(mandir)|sed -e 's@/[^/]*$$@@'`; \
394fa7c8
JW
2164 if [ -d $$parent ] ; then true ; else mkdir $$parent ; chmod a+rx $$parent ; fi
2165 -if [ -d $(mandir) ] ; then true ; else mkdir $(mandir) ; chmod a+rx $(mandir) ; fi
79d8453e
RS
2166
2167# Install the compiler executables built during cross compilation.
69cbb85a 2168install-common: native installdirs $(EXTRA_PARTS) lang.install-common
79d8453e
RS
2169 for file in $(COMPILERS); do \
2170 if [ -f $$file ] ; then \
2171 rm -f $(libsubdir)/$$file; \
2172 $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
2173 else true; \
2174 fi; \
2175 done
2fe8d2d6 2176 for file in $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2) ..; do \
79d8453e
RS
2177 if [ x"$$file" != x.. ]; then \
2178 rm -f $(libsubdir)/$$file; \
2179 $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
2180 else true; fi; \
2181 done
2fe8d2d6
RK
2182 for file in $(EXTRA_PARTS) ..; do \
2183 if [ x"$$file" != x.. ]; then \
2184 rm -f $(libsubdir)/$$file; \
2185 $(INSTALL_DATA) $$file $(libsubdir)/$$file; \
2186 else true; fi; \
2187 done
f0ec1f64 2188# Don't mess with specs if it doesn't exist yet.
2a7bccbb
TG
2189 -if [ -f specs ] ; then \
2190 rm -f $(libsubdir)/specs; \
f0ec1f64
RS
2191 $(INSTALL_DATA) specs $(libsubdir)/specs; \
2192 fi
aab26e16
RK
2193# Install protoize if it was compiled.
2194 -if [ -f protoize$(exeext) ]; \
2195 then \
2196 rm -f $(bindir)/protoize$(exeext); \
2197 $(INSTALL_PROGRAM) protoize$(exeext) $(bindir)/protoize$(exeext); \
2198 rm -f $(bindir)/unprotoize$(exeext); \
2199 $(INSTALL_PROGRAM) unprotoize$(exeext) $(bindir)/unprotoize$(exeext); \
2200 rm -f $(libsubdir)/SYSCALLS.c.X; \
2201 $(INSTALL_DATA) SYSCALLS.c.X $(libsubdir)/SYSCALLS.c.X; \
2202 chmod a-x $(libsubdir)/SYSCALLS.c.X; \
2203 fi
2204 -rm -f $(libsubdir)/cpp$(exeext)
2205 $(INSTALL_PROGRAM) cpp$(exeext) $(libsubdir)/cpp$(exeext)
2206
8b06b20a 2207# Install the driver program as $(target_alias)-gcc
79d8453e 2208# and also as either gcc (if native) or $(tooldir)/bin/gcc.
aab26e16 2209install-driver: xgcc
173712fb
RK
2210 -if [ -f gcc-cross$(exeext) ] ; then \
2211 rm -f $(bindir)/$(GCC_CROSS_NAME)$(exeext); \
94a8b9fe 2212 $(INSTALL_PROGRAM) gcc-cross$(exeext) $(bindir)/$(GCC_CROSS_NAME)$(exeext); \
79d8453e 2213 if [ -d $(tooldir)/bin/. ] ; then \
173712fb
RK
2214 rm -f $(tooldir)/bin/gcc$(exeext); \
2215 $(INSTALL_PROGRAM) gcc-cross$(exeext) $(tooldir)/bin/gcc$(exeext); \
79d8453e
RS
2216 else true; fi; \
2217 else \
173712fb
RK
2218 rm -f $(bindir)/$(GCC_INSTALL_NAME)$(exeext); \
2219 $(INSTALL_PROGRAM) xgcc$(exeext) $(bindir)/$(GCC_INSTALL_NAME)$(exeext); \
8b06b20a
RK
2220 rm -f $(bindir)/$(target_alias)-gcc-1$(exeext); \
2221 ln $(bindir)/$(GCC_INSTALL_NAME)$(exeext) $(bindir)/$(target_alias)-gcc-1$(exeext) \
173712fb 2222 > /dev/null 2>&1 \
8b06b20a
RK
2223 || cp $(bindir)/$(GCC_INSTALL_NAME)$(exeext) $(bindir)/$(target_alias)-gcc-1$(exeext); \
2224 mv $(bindir)/$(target_alias)-gcc-1$(exeext) $(bindir)/$(target_alias)-gcc$(exeext); \
79d8453e 2225 fi
79d8453e 2226
0b2fbcb2 2227# Install the info files.
69cbb85a 2228install-info: doc installdirs lang.install-info
0b2fbcb2
RS
2229 -rm -f $(infodir)/cpp.info* $(infodir)/gcc.info*
2230 cd $(srcdir); for f in cpp.info* gcc.info*; \
2231 do $(INSTALL_DATA) $$f $(infodir)/$$f; done
2232 -chmod a-x $(infodir)/cpp.info* $(infodir)/gcc.info*
2233
79d8453e 2234# Install the man pages.
69cbb85a 2235install-man: installdirs $(srcdir)/gcc.1 $(srcdir)/cccp.1 lang.install-man
338023d4
DE
2236 -if [ -f gcc-cross ] ; then \
2237 rm -f $(mandir)/$(GCC_CROSS_NAME)$(manext); \
2238 $(INSTALL_DATA) $(srcdir)/gcc.1 $(mandir)/$(GCC_CROSS_NAME)$(manext); \
2239 chmod a-x $(mandir)/$(GCC_CROSS_NAME)$(manext); \
2240 else \
2241 rm -f $(mandir)/$(GCC_INSTALL_NAME)$(manext); \
2242 $(INSTALL_DATA) $(srcdir)/gcc.1 $(mandir)/$(GCC_INSTALL_NAME)$(manext); \
2243 chmod a-x $(mandir)/$(GCC_INSTALL_NAME)$(manext); \
2244 fi
2e494f70 2245 -rm -f $(mandir)/cccp$(manext)
2e0b13db
RS
2246 -$(INSTALL_DATA) $(srcdir)/cccp.1 $(mandir)/cccp$(manext)
2247 -chmod a-x $(mandir)/cccp$(manext)
79d8453e
RS
2248
2249# Install the library.
69cbb85a 2250install-libgcc: libgcc.a installdirs
79d8453e
RS
2251 -if [ -f libgcc.a ] ; then \
2252 rm -f $(libsubdir)/libgcc.a; \
2253 $(INSTALL_DATA) libgcc.a $(libsubdir)/libgcc.a; \
2254 if $(RANLIB_TEST) ; then \
2255 (cd $(libsubdir); $(RANLIB) libgcc.a); else true; fi; \
2256 chmod a-x $(libsubdir)/libgcc.a; \
2257 else true; fi
2258
f6cdc7ea 2259# Install multiple versions of libgcc.a.
69cbb85a 2260install-multilib: stmp-multilib installdirs
f6cdc7ea
DE
2261 for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
2262 dir=`echo $$i | sed -e 's/;.*$$//'`; \
2263 if [ -d $(libsubdir)/$${dir} ]; then true; else mkdir $(libsubdir)/$${dir}; fi; \
47a22692
JM
2264 for f in libgcc.a $(EXTRA_MULTILIB_PARTS); do \
2265 rm -f $(libsubdir)/$${dir}/$${f}; \
2266 $(INSTALL_DATA) $${dir}/$${f} $(libsubdir)/$${dir}/$${f}; \
2267 done; \
f6cdc7ea
DE
2268 if $(RANLIB_TEST); then \
2269 (cd $(libsubdir)/$${dir}; $(RANLIB) libgcc.a); else true; fi; \
2270 chmod a-x $(libsubdir)/$${dir}/libgcc.a; \
2271 done
2272
62c13b81 2273# Install the objc run time library.
69cbb85a 2274install-libobjc: installdirs
62c13b81
RS
2275 -if [ -f libobjc.a ] ; then \
2276 rm -f $(libsubdir)/libobjc.a; \
2277 $(INSTALL_DATA) libobjc.a $(libsubdir)/libobjc.a; \
2278 if $(RANLIB_TEST) ; then \
2279 (cd $(libsubdir); $(RANLIB) libobjc.a); else true; fi; \
2280 chmod a-x $(libsubdir)/libobjc.a; \
2281 else true; fi
2282
ba1811f1 2283# Install all the header files built in the include subdirectory.
d7371761 2284install-headers: install-include-dir $(INSTALL_HEADERS_DIR) $(INSTALL_ASSERT_H)
ba1811f1
ILT
2285# Fix symlinks to absolute paths in the installed include directory to
2286# point to the installed directory, not the build directory.
2287 -files=`cd $(libsubdir)/include; find . -type l -print 2>/dev/null`; \
2288 if [ $$? -eq 0 ]; then \
2289 dir=`cd include; pwd`; \
2290 for i in $$files; do \
2291 dest=`ls -ld $(libsubdir)/include/$$i | sed -n 's/.*-> //p'`; \
2292 if expr "$$dest" : "$$dir.*" > /dev/null; then \
2293 rm -f $(libsubdir)/include/$$i; \
44735512 2294 ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(libsubdir)/include/$$i; \
ba1811f1
ILT
2295 fi; \
2296 done; \
2297 fi
79d8453e 2298
ba1811f1 2299# Create or recreate the gcc private include file directory.
69cbb85a 2300install-include-dir: installdirs
ba1811f1
ILT
2301 -rm -rf $(libsubdir)/include
2302 mkdir $(libsubdir)/include
2303 -chmod a+rx $(libsubdir)/include
2304
2305# Install the include directory using tar.
ac1284f9 2306install-headers-tar: stmp-headers $(STMP_FIXPROTO) install-include-dir
78ea9cda 2307 (cd include; \
6e5bea54 2308 tar -cf - .; exit 0) | (cd $(libsubdir)/include; tar $(TAROUTOPTS) - )
e6431ec5
RS
2309# /bin/sh on some systems returns the status of the first tar,
2310# and that can lose with GNU tar which always writes a full block.
2311# So use `exit 0' to ignore its exit status.
ba1811f1
ILT
2312
2313# Install the include directory using cpio.
ac1284f9 2314install-headers-cpio: stmp-headers $(STMP_FIXPROTO) install-include-dir
609f7031 2315 (cd include; find . -print) | (cd include; cpio -pdum $(libsubdir)/include)
79d8453e 2316
49ba557e
RS
2317# Put assert.h where it won't override GNU libc's assert.h.
2318# It goes in a dir that is searched after GNU libc's headers;
2319# thus, the following conditionals are no longer needed.
2320# But it's not worth deleting them now.
2321## Don't replace the assert.h already there if it is not from GCC.
2322## This code would be simpler if it tested for -f ... && ! grep ...
2323## but supposedly the ! operator is missing in sh on some systems.
69cbb85a 2324install-assert-h: assert.h installdirs
c9d929d7
RS
2325 if [ -f $(assertdir)/assert.h ]; \
2326 then \
998812ac 2327 if grep "__eprintf" $(assertdir)/assert.h >/dev/null; \
396f9edb 2328 then \
c9d929d7
RS
2329 rm -f $(assertdir)/assert.h; \
2330 $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \
0cd4060d 2331 chmod a-x $(assertdir)/assert.h; \
c9d929d7
RS
2332 else true; \
2333 fi; \
9fcedbef 2334 else \
6204c24f
RS
2335 rm -f $(assertdir)/assert.h; \
2336 $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \
0cd4060d 2337 chmod a-x $(assertdir)/assert.h; \
9fcedbef 2338 fi
79d8453e 2339
2e494f70 2340# Use this target to install the program `collect2' under the name `ld'.
69cbb85a 2341install-collect2: collect2 installdirs
173712fb 2342 $(INSTALL_PROGRAM) collect2$(exeext) $(libsubdir)/ld$(exeext)
2e494f70 2343# Install the driver program as $(libsubdir)/gcc for collect2.
173712fb 2344 $(INSTALL_PROGRAM) xgcc$(exeext) $(libsubdir)/gcc$(exeext)
2e494f70 2345
79d8453e 2346# Cancel installation by deleting the installed files.
013a2ee0 2347uninstall: lang.uninstall
79d8453e 2348 -rm -rf $(libsubdir)
173712fb
RK
2349 -rm -rf $(bindir)/$(GCC_INSTALL_NAME)$(exeext)
2350 -rm -rf $(bindir)/$(GCC_CROSS_NAME)$(exeext)
2351 -rm -rf $(bindir)/protoize$(exeext)
2352 -rm -rf $(bindir)/unprotoize$(exeext)
338023d4
DE
2353 -rm -rf $(mandir)/$(GCC_INSTALL_NAME)$(manext)
2354 -rm -rf $(mandir)/$(GCC_CROSS_NAME)$(manext)
2e494f70 2355 -rm -rf $(mandir)/cccp$(manext)
79d8453e
RS
2356 -rm -rf $(mandir)/protoize$(manext)
2357 -rm -rf $(mandir)/unprotoize$(manext)
2358\f
2359# These exist for maintenance purposes.
2360
2361# Update the tags table.
2362TAGS: force
2363 cd $(srcdir); \
2364 mkdir temp; \
013a2ee0 2365 mv -f c-parse.[ch] objc-parse.c cexp.c =*.[chy] temp; \
79d8453e
RS
2366 etags *.y *.h *.c; \
2367 mv temp/* .; \
2368 rmdir temp
2369
2370# Create the distribution tar file.
cadb41d5
RS
2371#dist: gcc-$(version).tar.gz
2372dist: gcc.xtar.gz
79d8453e 2373
cadb41d5 2374gcc.xtar.gz: gcc.xtar
80bdd32a 2375 gzip --best < gcc.xtar > tmp-gcc.xtar.gz
cadb41d5 2376 mv tmp-gcc.xtar.gz gcc.xtar.gz
79d8453e 2377
cadb41d5
RS
2378#gcc-$(version).tar.gz: gcc-$(version).tar
2379# gzip < gcc-$(version).tar > gcc-$(version).tar.gz
79d8453e
RS
2380
2381#gcc-$(version).tar:
7d27b36c
RS
2382gcc.xtar: distdir
2383# Make the distribution.
6e5bea54 2384 tar -chf gcc.xtar gcc-$(version)
7d27b36c 2385
013a2ee0
DE
2386# This target exists to do the initial work before the language specific
2387# stuff gets done.
3ff34537
RK
2388distdir-start: doc $(srcdir)/INSTALL $(srcdir)/c-parse.y $(srcdir)/c-gperf.h \
2389 $(srcdir)/objc-parse.y $(srcdir)/c-parse.c $(srcdir)/objc-parse.c \
2390 $(srcdir)/cexp.c
db4e119f 2391 @if grep -s "for version ${mainversion}" gcc.texi > /dev/null; \
f780d21b 2392 then true; \
96b5daff 2393 else echo "You must update the version number in \`gcc.texi'"; sleep 10;\
f780d21b 2394 fi
be0d23ff
RS
2395# Update the version number in README
2396 awk '$$1 " " $$2 " " $$3 == "This directory contains" \
2397 { $$6 = version; print $$0 } \
2398 $$1 " " $$2 " " $$3 != "This directory contains"' \
2399 version=$(version) README > tmp.README
2400 mv tmp.README README
2e494f70 2401 -rm -rf gcc-$(version) tmp
79d8453e
RS
2402# Put all the files in a temporary subdirectory
2403# which has the name that we want to have in the tar file.
2e494f70
RS
2404 mkdir tmp
2405 mkdir tmp/config
eb3a6507 2406 mkdir tmp/ginclude
ea727bbf 2407 mkdir tmp/objc
2e494f70 2408 for file in *[0-9a-zA-Z+]; do \
be0d23ff 2409 ln $$file tmp > /dev/null 2>&1 || cp $$file tmp; \
2e494f70
RS
2410 done
2411 cd config; \
2412 for file in *[0-9a-zA-Z+]; do \
f95640cc 2413 if test -d $$file && test "$$file" != RCS; then \
e52114f8
RM
2414 mkdir ../tmp/config/$$file; \
2415 cd $$file; \
2416 for subfile in *[0-9a-zA-Z+]; do \
2417 ln $$subfile ../../tmp/config/$$file >/dev/null 2>&1 \
2418 || cp $$subfile ../../tmp/config/$$file; \
2419 done; \
2420 cd ..; \
2421 else \
2422 ln $$file ../tmp/config >/dev/null 2>&1 \
2423 || cp $$file ../tmp/config; \
2424 fi; \
79d8453e 2425 done
eb3a6507
RK
2426 cd ginclude; \
2427 for file in *[0-9a-zA-Z+]; do \
173712fb
RK
2428 ln $$file ../tmp/ginclude >/dev/null 2>&1 \
2429 || cp $$file ../tmp/ginclude; \
eb3a6507 2430 done
ea727bbf
RS
2431 cd objc; \
2432 for file in *[0-9a-zA-Z+]; do \
057f494b 2433 ln $$file ../tmp/objc >/dev/null 2>&1 || cp $$file ../tmp/objc; \
ea727bbf 2434 done
2e494f70 2435 ln .gdbinit tmp
013a2ee0
DE
2436
2437# Finish making `distdir', after the languages have done their thing.
2438distdir-finish:
2e494f70 2439 mv tmp gcc-$(version)
eb3a6507
RK
2440# Get rid of everything we don't want in the distribution. We'd want
2441# this to use Makefile.in, but it doesn't have the `lang.foo' targets
2442# expanded.
2443 cd gcc-$(version); make extraclean
79d8453e 2444
013a2ee0
DE
2445distdir: distdir-start lang.distdir distdir-finish
2446
db4e119f
RS
2447# make diff oldversion=M.N
2448# creates a diff file between an older distribution and this one.
2449# The -P option assumes this is GNU diff.
2450diff:
f137e7dc 2451 diff -rc2P -x c-parse.y -x c-parse.c -x c-parse.h -x c-gperf.h \
013a2ee0
DE
2452 -x cexp.c -x bi-parser.c -x objc-parse.y -x objc-parse.c \
2453 -x TAGS \
2454 -x "gcc.??" -x "gcc.??s" -x gcc.aux -x "gcc.info*" \
2455 -x "cpp.??" -x "cpp.??s" -x cpp.aux -x "cpp.info*" \
2456 $(LANG_DIFF_EXCLUDES) \
db4e119f
RS
2457 gcc-$(oldversion) gcc-$(version) > diffs
2458
9c4614c3
TW
2459bootstrap: force
2460# Only build the C compiler for stage1, because that is the only one that
2461# we can guarantee will build with the native compiler, and also it is the
2462# only thing useful for building stage2.
5e31e473 2463 $(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)"
79d8453e 2464 $(MAKE) stage1
2e494f70
RS
2465# This used to define ALLOCA as empty, but that would lead to bad results
2466# for a subsequent `make install' since that would not have ALLOCA empty.
2467# To prevent `make install' from compiling alloca.o and then relinking cc1
2468# because alloca.o is newer, we permit these recursive makes to compile
2469# alloca.o. Then cc1 is newer, so it won't have to be relinked.
648300d7 2470 $(MAKE) CC="stage1/xgcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
79d8453e 2471 $(MAKE) stage2
648300d7 2472 $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
79d8453e
RS
2473
2474bootstrap2: force
648300d7 2475 $(MAKE) CC="stage1/xgcc -Bstage1/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage1/ LANGUAGES="$(LANGUAGES)"
79d8453e 2476 $(MAKE) stage2
648300d7 2477 $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
79d8453e
RS
2478
2479bootstrap3: force
648300d7 2480 $(MAKE) CC="stage2/xgcc -Bstage2/" CFLAGS="$(BOOT_CFLAGS)" LDFLAGS="$(BOOT_LDFLAGS)" libdir=$(libdir) STAGE_PREFIX=stage2/ LANGUAGES="$(LANGUAGES)"
79d8453e 2481
dcfedcd0
RK
2482# Compare the object files in the current directory with those in the
2483# stage2 directory.
2484
9825189b 2485# ./ avoids bug in some versions of tail.
dcfedcd0 2486compare: force
aab26e16 2487 for file in *$(objext); do \
9825189b 2488 tail +16c ./$$file > tmp-foo1; \
acbbf3d9 2489 tail +16c stage2/$$file > tmp-foo2 2>/dev/null \
63a014a0 2490 && (cmp tmp-foo1 tmp-foo2 || echo $$file differs) || true; \
dcfedcd0 2491 done
013a2ee0 2492 for dir in tmp-foo $(SUBDIRS); do \
aab26e16
RK
2493 if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
2494 for file in $$dir/*$(objext); do \
013a2ee0
DE
2495 tail +16c ./$$file > tmp-foo1; \
2496 tail +16c stage2/$$file > tmp-foo2 2>/dev/null \
63a014a0 2497 && (cmp tmp-foo1 tmp-foo2 || echo $$file differs) || true; \
094ecbb0
RK
2498 done; \
2499 fi; \
013a2ee0 2500 done
dcfedcd0
RK
2501 -rm -f tmp-foo*
2502
2503# Similar, but compare with stage3 directory
2504compare3: force
aab26e16 2505 for file in *$(objext); do \
013a2ee0 2506 tail +16c ./$$file > tmp-foo1; \
acbbf3d9 2507 tail +16c stage3/$$file > tmp-foo2 2>/dev/null \
63a014a0 2508 && (cmp tmp-foo1 tmp-foo2 || echo $$file differs) || true; \
dcfedcd0 2509 done
013a2ee0 2510 for dir in tmp-foo $(SUBDIRS); do \
aab26e16
RK
2511 if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
2512 for file in $$dir/*$(objext); do \
013a2ee0
DE
2513 tail +16c ./$$file > tmp-foo1; \
2514 tail +16c stage3/$$file > tmp-foo2 2>/dev/null \
63a014a0 2515 && (cmp tmp-foo1 tmp-foo2 || echo $$file differs) || true; \
094ecbb0
RK
2516 done; \
2517 fi; \
013a2ee0 2518 done
dcfedcd0
RK
2519 -rm -f tmp-foo*
2520
ede57549
RK
2521# Compare the object files in the current directory with those in the
2522# stage2 directory. Use gnu cmp (diffutils v2.4 or later) to avoid
2523# running tail and the overhead of twice copying each object file.
2524
2525gnucompare: force
aab26e16 2526 for file in *$(objext); do \
ede57549
RK
2527 cmp --ignore-initial=16 $$file stage2/$$file || true ; \
2528 done
013a2ee0 2529 for dir in tmp-foo $(SUBDIRS); do \
aab26e16 2530 if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
7a7e1cfb 2531 for file in $$dir/*$(objext); do \
013a2ee0 2532 cmp --ignore-initial=16 $$file stage2/$$file || true ; \
094ecbb0
RK
2533 done; \
2534 fi; \
013a2ee0 2535 done
ede57549
RK
2536
2537# Similar, but compare with stage3 directory
2538gnucompare3: force
aab26e16 2539 for file in *$(objext); do \
ede57549
RK
2540 cmp --ignore-initial=16 $$file stage3/$$file || true ; \
2541 done
013a2ee0 2542 for dir in tmp-foo $(SUBDIRS); do \
aab26e16
RK
2543 if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
2544 for file in $$dir/*$(objext); do \
013a2ee0 2545 cmp --ignore-initial=16 $$file stage3/$$file || true ; \
094ecbb0
RK
2546 done; \
2547 fi; \
013a2ee0 2548 done
ede57549 2549
79d8453e 2550# Copy the object files from a particular stage into a subdirectory.
013a2ee0 2551stage1-start:
2e494f70 2552 -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
013a2ee0
DE
2553 -for dir in . $(SUBDIRS) ; \
2554 do \
9a517e7b 2555 if [ -d stage1/$$dir ] ; then true ; else mkdir stage1/$$dir ; fi ; \
013a2ee0 2556 done
79d8453e 2557 -mv $(STAGESTUFF) stage1
338023d4
DE
2558# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
2559# dir will work properly.
b4d63183
RK
2560 -if [ -f as$(exeext) ] ; then ln -s ../as$(exeext) stage1 || cp as$(exeext) stage1 ; else true ; fi
2561 -if [ -f ld$(exeext) ] ; then ln -s ../ld$(exeext) stage1 || cp ld$(exeext) stage1 ; else true ; fi
2562 -if [ -f collect-ld$(exeext) ] ; then ln -s ../collect-ld$(exeext) stage1 || cp collect-ld$(exeext) stage1 ; else true ; fi
79d8453e
RS
2563 -rm -f stage1/libgcc.a
2564 -cp libgcc.a stage1
2565 -if $(RANLIB_TEST) ; then $(RANLIB) stage1/libgcc.a; else true; fi
04e95620
JM
2566 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
2567 cp stage1/$${f} . ; \
2568 fi; done
013a2ee0 2569stage1: force stage1-start lang.stage1
79d8453e 2570
013a2ee0 2571stage2-start:
2e494f70 2572 -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
013a2ee0
DE
2573 -for dir in . $(SUBDIRS) ; \
2574 do \
9a517e7b 2575 if [ -d stage2/$$dir ] ; then true ; else mkdir stage2/$$dir ; fi ; \
013a2ee0 2576 done
79d8453e 2577 -mv $(STAGESTUFF) stage2
338023d4
DE
2578# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
2579# dir will work properly.
b4d63183
RK
2580 -if [ -f as$(exeext) ] ; then ln -s ../as$(exeext) stage2 || cp as$(exeext) stage2 ; else true ; fi
2581 -if [ -f ld$(exeext) ] ; then ln -s ../ld$(exeext) stage2 || cp ld$(exeext) stage2 ; else true ; fi
2582 -if [ -f collect-ld ] ; then ln -s ../collect-ld$(exeext) stage2 || cp collect-ld$(exeext) stage2 ; else true ; fi
79d8453e
RS
2583 -rm -f stage2/libgcc.a
2584 -cp libgcc.a stage2
2585 -if $(RANLIB_TEST) ; then $(RANLIB) stage2/libgcc.a; else true; fi
04e95620
JM
2586 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
2587 cp stage2/$${f} . ; \
2588 fi; done
013a2ee0 2589stage2: force stage2-start lang.stage2
79d8453e 2590
013a2ee0 2591stage3-start:
935e11b0 2592 -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
013a2ee0
DE
2593 -for dir in . $(SUBDIRS) ; \
2594 do \
9a517e7b 2595 if [ -d stage3/$$dir ] ; then true ; else mkdir stage3/$$dir ; fi ; \
013a2ee0 2596 done
79d8453e 2597 -mv $(STAGESTUFF) stage3
338023d4
DE
2598# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
2599# dir will work properly.
b4d63183
RK
2600 -if [ -f as$(exeext) ] ; then ln -s ../as$(exeext) stage3 || cp as$(exeext) stage3 ; else true ; fi
2601 -if [ -f ld$(exeext) ] ; then ln -s ../ld$(exeext) stage3 || cp ld$(exeext) stage3 ; else true ; fi
2602 -if [ -f collect-ld$(exeext) ] ; then ln -s ../collect-ld$(exeext) stage3 || cp collect-ld$(exeext) stage3 ; else true ; fi
79d8453e
RS
2603 -rm -f stage3/libgcc.a
2604 -cp libgcc.a stage3
2605 -if $(RANLIB_TEST) ; then $(RANLIB) stage3/libgcc.a; else true; fi
04e95620
JM
2606 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
2607 cp stage3/$${f} . ; \
2608 fi; done
013a2ee0 2609stage3: force stage3-start lang.stage3
79d8453e 2610
013a2ee0 2611stage4-start:
935e11b0 2612 -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
013a2ee0
DE
2613 -for dir in . $(SUBDIRS) ; \
2614 do \
9a517e7b 2615 if [ -d stage4/$$dir ] ; then true ; else mkdir stage4/$$dir ; fi ; \
013a2ee0 2616 done
79d8453e 2617 -mv $(STAGESTUFF) stage4
338023d4
DE
2618# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
2619# dir will work properly.
b4d63183
RK
2620 -if [ -f as$(exeext) ] ; then ln -s ../as$(exeext) stage4 || cp as$(exeext) stage4 ; else true ; fi
2621 -if [ -f ld$(exeext) ] ; then ln -s ../ld$(exeext) stage4 || cp ld$(exeext) stage4 ; else true ; fi
2622 -if [ -f collect-ld$(exeext) ] ; then ln -s ../collect-ld$(exeext) stage4 || cp collect-ld$(exeext) stage4 ; else true ; fi
79d8453e
RS
2623 -rm -f stage4/libgcc.a
2624 -cp libgcc.a stage4
2625 -if $(RANLIB_TEST) ; then $(RANLIB) stage4/libgcc.a; else true; fi
04e95620
JM
2626 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
2627 cp stage4/$${f} . ; \
2628 fi; done
013a2ee0 2629stage4: force stage4-start lang.stage4
79d8453e
RS
2630
2631# Copy just the executable files from a particular stage into a subdirectory,
2632# and delete the object files. Use this if you're just verifying a version
2633# that is pretty sure to work, and you are short of disk space.
aab26e16
RK
2634risky-stage1: stage1
2635 - make clean
79d8453e 2636
aab26e16 2637risky-stage2: stage2
79d8453e
RS
2638 -make clean
2639
aab26e16 2640risky-stage3: stage3
79d8453e
RS
2641 -make clean
2642
aab26e16 2643risky-stage4: stage4
79d8453e
RS
2644 -make clean
2645
2646#In GNU Make, ignore whether `stage*' exists.
f1908d70 2647.PHONY: stage1 stage2 stage3 stage4 clean maintainer-clean TAGS bootstrap
79d8453e
RS
2648.PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
2649
2650force:
This page took 0.781981 seconds and 5 git commands to generate.