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