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