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