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