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