]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/Makefile.in
2000-11-21 scott snyder <snyder@fnal.gov>
[thirdparty/gcc.git] / gcc / Makefile.in
CommitLineData
32e6d418 1# Makefile for GNU C compiler.
0b387d23 2# Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1995
3# 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
32e6d418 4
5#This file is part of GNU CC.
6
7#GNU CC is free software; you can redistribute it and/or modify
8#it under the terms of the GNU General Public License as published by
9#the Free Software Foundation; either version 2, or (at your option)
10#any later version.
11
12#GNU CC is distributed in the hope that it will be useful,
13#but WITHOUT ANY WARRANTY; without even the implied warranty of
14#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15#GNU General Public License for more details.
16
17#You should have received a copy of the GNU General Public License
18#along with GNU CC; see the file COPYING. If not, write to
8d62a21c 19#the Free Software Foundation, 59 Temple Place - Suite 330,
20#Boston MA 02111-1307, USA.
32e6d418 21
22# The targets for external use include:
23# all, doc, proto, install, install-cross, install-cross-rest,
a8514488 24# uninstall, TAGS, mostlyclean, clean, distclean, maintainer-clean,
32e6d418 25# stage1, stage2, stage3, stage4.
26
f5da66df 27# This is the default target.
28all:
29
c6396a0b 30# Suppress smart makes who think they know how to automake Yacc files
31.y.c:
32
87c0ad1b 33# Directory where sources are, from where we are.
34srcdir = @srcdir@
35VPATH = @srcdir@
36
d73e991a 37# Pointer to the GCC Project website
38website=http://gcc.gnu.org
39
32e6d418 40# Variables that exist for you to override.
41# See below for how to change them for certain systems.
42
73027c94 43# List of language subdirectories.
44# This is overridden by configure.
87c0ad1b 45SUBDIRS =@subdirs@
73027c94 46
32e6d418 47# Selection of languages to be made.
73027c94 48# This is overridden by configure.
76103b2c 49CONFIG_LANGUAGES = @all_languages@
844c30fe 50LANGUAGES = c gcov$(exeext) $(CONFIG_LANGUAGES)
32e6d418 51
5728fc9b 52# Languages should create dependencies of $(INTL_TARGETS) on generated
53# sources in Make-lang.in. Example:
54# $(INTL_TARGETS): $(srcdir)/cp/parse.c
98fb2ff8 55INTL_TARGETS = intl.all intl.install
5728fc9b 56
e754efc9 57# Selection of languages to be made during stage1 build.
58# This is overridden by configure.
87c0ad1b 59BOOT_LANGUAGES = c @all_boot_languages@
e754efc9 60
32e6d418 61ALLOCA =
1ab99fde 62ALLOCA_FLAGS =
94c53b91 63ALLOCA_FINISH = true
32e6d418 64
c6221df9 65# Various ways of specifying flags for compilations:
32e6d418 66# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
b3ff31d3 67# BOOT_CFLAGS is the value of CFLAGS to pass to the stage2 and stage3
68# compilations.
f357ac87 69# XCFLAGS is used for most compilations but not when using the GCC just built.
70# TCFLAGS is used for compilations with the GCC just built.
71# STAGE1_CFLAGS is set by configure on some targets.
72XCFLAGS =
73TCFLAGS =
74BOOT_CFLAGS = -g -O2
75STAGE1_CFLAGS = -g @stage1_cflags@
76CFLAGS = $(STAGE1_CFLAGS)
77
b3ff31d3 78# The warning flags are separate from BOOT_CFLAGS because people tend to
79# override optimization flags and we'd like them to still have warnings
80# turned on. These flags are also used to pass other stage dependent
81# flags from configure. The user is free to explicitly turn these flags
82# off if they wish.
f357ac87 83# LOOSE_WARN are the warning flags to use when compiling something
84# which is only compiled with gcc, such as libgcc and the frontends
85# other than C.
86# STRICT_WARN and STRICT2_WARN are the additional warning flags to
87# apply to the back end and the C front end, which may be compiled
88# with other compilers. This is partially controlled by configure in
89# stage1, as not all versions of gcc understand -Wno-long-long.
90LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
91STRICT_WARN = -Wtraditional @strict1_warn@
92STRICT2_WARN = -Wtraditional -pedantic -Wno-long-long
93
94# This is how we control whether or not the additional warnings are applied.
95.-warn = $(STRICT_WARN)
96GCC_WARN_CFLAGS = $(LOOSE_WARN) $($(@D)-warn)
97
98# All warnings have to be shut off in stage1 if the compiler used then
99# isn't gcc; configure determines that. WARN_CFLAGS will be either
100# $(GCC_WARN_CFLAGS), or nothing.
101WARN_CFLAGS = @warn_cflags@
102
32e6d418 103# These exists to be overridden by the x-* and t-* files, respectively.
104X_CFLAGS =
105T_CFLAGS =
106
107X_CPPFLAGS =
108T_CPPFLAGS =
109
be2828ce 110AWK = @AWK@
38bce124 111CC = @CC@
345a1501 112BISON = @BISON@
3f1608f3 113BISONFLAGS =
345a1501 114FLEX = @FLEX@
115FLEXFLAGS =
32e6d418 116AR = ar
32e6d418 117AR_FLAGS = rc
4664c5d5 118DLLTOOL = dlltool
32e6d418 119SHELL = /bin/sh
120# on sysV, define this as cp.
87c0ad1b 121INSTALL = @INSTALL@
ea4a6c81 122# Some systems may be missing symbolic links, regular links, or both.
123# Allow configure to check this and use "ln -s", "ln", or "cp" as appropriate.
124LN=@LN@
125LN_S=@LN_S@
32e6d418 126# These permit overriding just for certain files.
74086405 127INSTALL_PROGRAM = @INSTALL_PROGRAM@
128INSTALL_DATA = @INSTALL_DATA@
049ccec1 129MAKEINFO = @MAKEINFO@
64cda823 130MAKEINFOFLAGS =
f345940f 131TEXI2DVI = texi2dvi
73027c94 132# For GNUmake: let us decide what gets passed to recursive makes.
133MAKEOVERRIDES =
87c0ad1b 134@SET_MAKE@
f357ac87 135# Some compilers can't handle cc -c blah.c -o foo/blah.o.
136# In stage2 and beyond, we force this to "-o $@" since we know we're using gcc.
137OUTPUT_OPTION = @OUTPUT_OPTION@
32e6d418 138
f357ac87 139# This is where we get zlib from. zlibdir is -L../zlib and zlibinc is
140# -I../zlib, unless we were configured with --with-system-zlib, in which
141# case both are empty.
142ZLIB = @zlibdir@ -lz
143ZLIBINC = @zlibinc@
32e6d418 144
145# How to invoke ranlib.
146RANLIB = ranlib
147# Test to use to see whether ranlib exists on the system.
396c97db 148RANLIB_TEST = \
149 [ -f $(RANLIB) ] \
363fd278 150 || [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
73b4c875 151
2382c341 152# Substitution type for target's getgroups 2nd arg.
153TARGET_GETGROUPS_T = @TARGET_GETGROUPS_T@
154
32e6d418 155# Compiler to use for compiling libgcc1.a.
156# OLDCC should not be the GNU C compiler,
157# since that would compile typical libgcc1.a functions such as mulsi3
158# into infinite recursions.
159OLDCC = cc
160
161# CFLAGS for use with OLDCC, for compiling libgcc1.a.
162# NOTE: -O does not work on some Unix systems!
163CCLIBFLAGS = -O
164
c6396a0b 165# Version of ar to use when compiling libgcc1.a.
32e6d418 166OLDAR = ar
38bce124 167OLDAR_FLAGS = qc
32e6d418 168
2cfd79fe 169# Target to use when installing include directory. Either
170# install-headers-tar or install-headers-cpio.
87c0ad1b 171INSTALL_HEADERS_DIR = @build_install_headers_dir@
2cfd79fe 172
c8763215 173# Header files that are made available under the same name
174# to programs compiled with GCC.
175USER_H = $(srcdir)/ginclude/stdarg.h $(srcdir)/ginclude/stddef.h \
b9a1fcb3 176 $(srcdir)/ginclude/varargs.h $(srcdir)/ginclude/proto.h \
c6221df9 177 $(srcdir)/ginclude/stdbool.h $(srcdir)/ginclude/iso646.h \
178 $(EXTRA_HEADERS) $(LANG_EXTRA_HEADERS)
c8763215 179
180# Target to use whe installing assert.h. Some systems may
181# want to set this empty.
182INSTALL_ASSERT_H = install-assert-h
183
483f5cc4 184# The GCC to use for compiling libgcc.a, enquire, and libgcc1-test.
b3781cc4 185# Usually the one we just built.
32e6d418 186# Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
dd0af08f 187GCC_FOR_TARGET = ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include
32e6d418 188
189# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
190# It omits XCFLAGS, and specifies -B./.
d23f832c 191# It also specifies -isystem ./include to find, e.g., stddef.h.
f357ac87 192GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(LOOSE_WARN) -isystem ./include $(TCFLAGS)
32e6d418 193
2828fac4 194# Specify the abi to use when building the c++ runtime
195GXX_ABI_FLAG=@GXX_ABI_FLAG@
196
b541ad9d 197# Sed command to transform gcc to installed name. Overwritten by configure.
3271658e 198program_transform_name = @program_transform_name@
ccb6700d 199program_transform_cross_name = s,^,$(target_alias)-,
b541ad9d 200
11d80b02 201build_canonical = @build_canonical@
202host_canonical = @host_canonical@
203
32e6d418 204# Tools to use when building a cross-compiler.
205# These are used because `configure' appends `cross-make'
206# to the makefile when making a cross-compiler.
207
fbc57885 208# Use the tools from the build tree, if they are available.
209
210# objdir is set by configure.
211objdir = @objdir@
212
213AR_FOR_TARGET = ` \
214 if [ -f $(objdir)/../binutils/ar ] ; then \
215 echo $(objdir)/../binutils/ar ; \
216 else \
217 if [ "$(host_canonical)" = "$(target)" ] ; then \
218 echo ar; \
219 else \
e440364b 220 t='$(program_transform_cross_name)'; echo ar | sed -e $$t ; \
fbc57885 221 fi; \
222 fi`
aa787722 223AR_FLAGS_FOR_TARGET =
224AR_CREATE_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) rc
225AR_EXTRACT_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) x
fbc57885 226RANLIB_FOR_TARGET = ` \
227 if [ -f $(objdir)/../binutils/ranlib ] ; then \
228 echo $(objdir)/../binutils/ranlib ; \
229 else \
230 if [ "$(host_canonical)" = "$(target)" ] ; then \
231 echo ranlib; \
232 else \
e440364b 233 t='$(program_transform_cross_name)'; echo ranlib | sed -e $$t ; \
fbc57885 234 fi; \
235 fi`
236RANLIB_TEST_FOR_TARGET = \
237 [ -f $(RANLIB_FOR_TARGET) ] \
238 || ( [ "$(host_canonical)" = "$(target)" ] \
239 && [ -f /usr/bin/ranlib -o -f /bin/ranlib ] )
111349c7 240NM_FOR_TARGET = ` \
241 if [ -f $(objdir)/../binutils/nm ] ; then \
242 echo $(objdir)/../binutils/nm ; \
243 else \
244 if [ "$(host_canonical)" = "$(target)" ] ; then \
245 echo nm; \
246 else \
247 t='$(program_transform_cross_name)'; echo nm | sed -e $$t ; \
248 fi; \
249 fi`
fbc57885 250
3f69fed5 251# Dir to search for system headers. Overridden by cross-make.
252SYSTEM_HEADER_DIR = /usr/include
253
8a5b87ad 254# Where to find some libiberty headers.
255HASHTAB_H = $(srcdir)/../include/hashtab.h
256OBSTACK_H = $(srcdir)/../include/obstack.h
bb96e316 257SPLAY_TREE_H= $(srcdir)/../include/splay-tree.h
8a5b87ad 258
397f1574 259# Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
260CROSS_SYSTEM_HEADER_DIR = $(tooldir)/sys-include
261
58113712 262# Control whether to run fixproto and fixincludes.
61fad423 263STMP_FIXPROTO = stmp-fixproto
58113712 264STMP_FIXINC = stmp-fixinc
a5889b74 265
0848b369 266# Test to see whether <limits.h> exists in the system header files.
267LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
268
87c0ad1b 269target=@target@
71d9c015 270target_alias=@target_alias@
87c0ad1b 271xmake_file=@dep_host_xmake_file@
272tmake_file=@dep_tmake_file@
273out_file=$(srcdir)/config/@out_file@
274out_object_file=@out_object_file@
275md_file=$(srcdir)/config/@md_file@
276tm_file=@tm_file_list@
277build_xm_file=@build_xm_file_list@
278host_xm_file=@host_xm_file_list@
279lang_specs_files=@lang_specs_files@
280lang_options_files=@lang_options_files@
c3cc26e1 281lang_tree_files=@lang_tree_files@
714fe809 282GCC_THREAD_FILE=@thread_file@
5c872430 283OBJC_BOEHM_GC=@objc_boehm_gc@
58febf9e 284GTHREAD_FLAGS=@gthread_flags@
7955e3d2 285# Be prepared for gcc2 merges.
286gcc_version=@gcc_version@
287gcc_version_trigger=@gcc_version_trigger@
288version=$(gcc_version)
4f5e65d7 289mainversion=`grep version_string $(srcdir)/version.c | sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/'`
32e6d418 290
32e6d418 291# Common prefix for installation directories.
292# NOTE: This directory must exist when you start installation.
87c0ad1b 293prefix = @prefix@
2ffdcadf 294# Directory in which to put localized header files. On the systems with
295# gcc as the native cc, `local_prefix' may not be `prefix' which is
296# `/usr'.
a2aa0fc1 297# NOTE: local_prefix *should not* default from prefix.
87c0ad1b 298local_prefix = @local_prefix@
c6396a0b 299# Directory in which to put host dependent programs and libraries
87c0ad1b 300exec_prefix = @exec_prefix@
32e6d418 301# Directory in which to put the executable for the command `gcc'
87c0ad1b 302bindir = @bindir@
32e6d418 303# Directory in which to put the directories used by the compiler.
87c0ad1b 304libdir = @libdir@
32e6d418 305# Directory in which the compiler finds executables, libraries, etc.
67cb4bc1 306libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(version)
40cb25f2 307# Used to produce a relative $(gcc_tooldir) in gcc.o
8099945b 308unlibsubdir = ../../..
f22b529a 309# Directory in which to find other cross-compilation tools and headers.
066520ea 310dollar = @dollar@
f22b529a 311# Used in install-cross.
312gcc_tooldir = @gcc_tooldir@
313# Since tooldir does not exist at build-time, use -B$(build_tooldir)/bin/
314build_tooldir = $(exec_prefix)/$(target_alias)
3bf5d4dc 315# Directory in which the compiler finds g++ includes.
8ffadb5b 316gcc_gxx_include_dir= @gcc_gxx_include_dir@
35df828f 317# Directory to search for site-specific includes.
9671ce48 318includedir = $(local_prefix)/include
db9a0b19 319# assertdir is overridden in cross-make.
9d8314a9 320# (But this currently agrees with what is in cross-make.)
40cb25f2 321assertdir = $(gcc_tooldir)/include
a2aa0fc1 322# where the info files go
87c0ad1b 323infodir = @infodir@
3e2f90b9 324# Where cpp should go besides $prefix/bin if necessary
325cpp_install_dir = @cpp_install_dir@
be2828ce 326# where the locale files go
327datadir = $(prefix)/@DATADIRNAME@
328localedir = $(datadir)/locale
32e6d418 329# Extension (if any) to put in installed man-page filename.
330manext = .1
f403cbcb 331objext = .o
2aa3e87b 332exeext = @host_exeext@
333build_exeext = @build_exeext@
f403cbcb 334
32e6d418 335# Directory in which to put man pages.
3cf6a465 336mandir = @mandir@
337man1dir = $(mandir)/man1
f32abccb 338# Dir for temp files.
339tmpdir = /tmp
32e6d418 340
be2828ce 341# Top build directory, relative to here.
342top_builddir = .
343
344# Whether we were configured with NLS.
345USE_NLS = @USE_NLS@
346
347# Internationalization library.
348INTLLIBS = @INTLLIBS@
349
350# List of internationalization subdirectories.
351POSUB = @POSUB@
352INTL_SUBDIRS = intl $(POSUB)
353
32e6d418 354# Additional system libraries to link with.
355CLIB=
356
357# Change this to a null string if obstacks are installed in the
358# system library.
359OBSTACK=obstack.o
360
05513b45 361# The GC method to be used on this system.
772580ce 362GGC=@GGC@.o
05513b45 363
364# If a supplementary library is being used for the GC.
365GGC_LIB=
366
b8a373b2 367# Configure will set these if you need vfprintf and possibly _doprnt support.
368VFPRINTF=@vfprintf@
369DOPRINT=@doprint@
370
2289acd7 371# Specify the rule for actually making libgcc.a,
372LIBGCC = libgcc.a
373# and the rule for installing it.
374INSTALL_LIBGCC = install-libgcc
375
32e6d418 376# Specify the rule for actually making libgcc1.a.
c6396a0b 377# The value may be empty; that means to do absolutely nothing
378# with or for libgcc1.a.
32e6d418 379LIBGCC1 = libgcc1.a
380
b0d230b7 381# Specify the rule for making libgcc1.a for a cross-compiler.
382# The default rule assumes that libgcc1.a is supplied by the user.
383CROSS_LIBGCC1 = libgcc1.cross
384
32e6d418 385# Options to use when compiling libgcc2.a.
386# -g1 causes output of debug info only for file-scope entities.
387# we use this here because that should be enough, and also
388# so that -g1 will be tested.
cce804d3 389#
b1e0e993 390LIBGCC2_DEBUG_CFLAGS = -g1
c6221df9 391LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED @inhibit_libc@
690a93ea 392
393# Additional options to use when compiling libgcc2.a.
d23f832c 394# Some targets override this to -isystem include
690a93ea 395LIBGCC2_INCLUDES =
396
b5dba0c7 397# Additional target-dependent options for compiling libgcc2.a.
c6221df9 398TARGET_LIBGCC2_CFLAGS =
b5dba0c7 399
a5c6ce69 400# Additional sources to handle exceptions; overridden by some targets.
fbba5463 401LIB2ADDEH = $(srcdir)/frame-dwarf2.c
402
3b9b6fde 403# libgcc1-test target (must also be overridable for a target)
404LIBGCC1_TEST = libgcc1-test
17886975 405
a5c6ce69 406# nm flags to list global symbols in libgcc object files.
407SHLIB_NM_FLAGS = -pg
408
32e6d418 409# List of extra executables that should be compiled for this target machine
410# that are used for compiling from source code to object code.
411# The rules for compiling them should be in the t-* file for the machine.
87c0ad1b 412EXTRA_PASSES =@extra_passes@
32e6d418 413
c6396a0b 414# Like EXTRA_PASSES, but these are used when linking.
87c0ad1b 415EXTRA_PROGRAMS = @extra_programs@
c6396a0b 416
417# List of extra object files that should be compiled for this target machine.
32e6d418 418# The rules for compiling them should be in the t-* file for the machine.
87c0ad1b 419EXTRA_PARTS = @extra_parts@
32e6d418 420
c6396a0b 421# List of extra object files that should be compiled and linked with
422# compiler proper (cc1, cc1obj, cc1plus).
87c0ad1b 423EXTRA_OBJS = @extra_objs@
c6396a0b 424
17108b2b 425# List of extra object files that should be compiled and linked with
426# the gcc driver.
87c0ad1b 427EXTRA_GCC_OBJS =@host_extra_gcc_objs@
17108b2b 428
630c76ba 429# List of additional header files to install.
430# Often this is edited directly by `configure'.
87c0ad1b 431EXTRA_HEADERS =@extra_headers_list@
630c76ba 432
0c787992 433# Set this to `collect2' to enable use of collect2.
87c0ad1b 434USE_COLLECT2 = @will_use_collect2@
98ae6ed6 435# If we might be using collect2, then this variable will be set to
436# -DUSE_COLLECT2. toplev.c, collect2.c and libgcc2.c all need to
437# if we may be using collect2.
23029fe8 438MAYBE_USE_COLLECT2 = @maybe_use_collect2@
79f818d0 439# It is convenient for configure to add the assignment at the beginning,
440# so don't override it here.
0c787992 441USE_COLLECT2 = collect2$(exeext)
79f818d0 442
f357ac87 443# configure sets this to 'libcpp.a' if cpplib is being merged into
444# C-family front ends.
445MAYBE_CPPLIB = @maybe_cpplib@
446
32e6d418 447# List of extra C and assembler files to add to libgcc1.a.
448# Assembler files should have names ending in `.asm'.
c6221df9 449LIB1FUNCS_EXTRA =
32e6d418 450
451# List of extra C and assembler files to add to libgcc2.a.
452# Assembler files should have names ending in `.asm'.
c6221df9 453LIB2FUNCS_EXTRA =
32e6d418 454
3e2f90b9 455# Handle cpp installation.
456INSTALL_CPP=
457UNINSTALL_CPP=
458
d54b81e0 459# We do not try to build float.h anymore. Let configure select the
460# appropriate pre-built float.h file for the target.
19c49761 461FLOAT_H=@float_h_file@
d54b81e0 462
32e6d418 463# Program to convert libraries.
c6221df9 464LIBCONVERT =
32e6d418 465
466# Control whether header files are installed.
32e6d418 467INSTALL_HEADERS=install-headers
468
049ccec1 469# Control whether Info documentation is built and installed.
470BUILD_INFO = @BUILD_INFO@
471INSTALL_INFO = @INSTALL_INFO@
472
106a27e5 473# Additional directories of header files to run fixincludes on.
af731fc2 474# These should be directories searched automatically by default
475# just as /usr/include is.
c6221df9 476# *Do not* use this for directories that happen to contain
af731fc2 477# header files, but are not searched automatically by default.
106a27e5 478# On most systems, this is empty.
479OTHER_FIXINCLUDES_DIRS=
480
fc0b8ef8 481# A list of all the language-specific executables.
482# This is overridden by configure.
8757933b 483COMPILERS = cc1$(exeext) @all_compilers@
fc0b8ef8 484
77a164d8 485# List of things which should already be built whenever we try to use xgcc
32e6d418 486# to compile anything (without linking).
fa90e150 487GCC_PASSES=xgcc$(exeext) cc1$(exeext) cpp0$(exeext) specs $(EXTRA_PASSES)
32e6d418 488
77a164d8 489# List of things which should already be built whenever we try to use xgcc
32e6d418 490# to link anything.
2289acd7 491GCC_PARTS=$(GCC_PASSES) $(LIBGCC) $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS)
32e6d418 492
32e6d418 493# Directory to link to, when using the target `maketest'.
494DIR = ../gcc
495
89e36a04 496# Guaranteed to not exist when not passing md through cpp.
2c352995 497# This value is overridden directly by configure.
89e36a04 498MD_FILE = md-cpp-not-used
499
32e6d418 500# Flags to use when cross-building GCC.
501# Prefix to apply to names of object files when using them
502# to run on the machine we are compiling on.
503HOST_PREFIX=
504# Prefix to apply to names of object files when compiling them
505# to run on the machine we are compiling on.
c6221df9 506# The default for this variable is chosen to keep these rules
32e6d418 507# out of the way of the other rules for compiling the same source files.
508HOST_PREFIX_1=loser-
509HOST_CC=$(CC)
510HOST_CFLAGS=$(ALL_CFLAGS)
c6396a0b 511HOST_CLIB=$(CLIB)
32e6d418 512HOST_LDFLAGS=$(LDFLAGS)
513HOST_CPPFLAGS=$(ALL_CPPFLAGS)
c6396a0b 514HOST_ALLOCA=$(ALLOCA)
515HOST_MALLOC=$(MALLOC)
516HOST_OBSTACK=$(OBSTACK)
b8a373b2 517HOST_VFPRINTF=$(VFPRINTF)
518HOST_DOPRINT=$(DOPRINT)
32e6d418 519
b541ad9d 520# Actual name to use when installing a native compiler.
ccb6700d 521GCC_INSTALL_NAME = `t='$(program_transform_name)'; echo gcc | sed -e $$t`
28c11b39 522CPP_INSTALL_NAME = `t='$(program_transform_name)'; echo cpp | sed -e $$t`
fc56a674 523PROTOIZE_INSTALL_NAME = `t='$(program_transform_name)'; echo protoize | sed -e $$t`
524UNPROTOIZE_INSTALL_NAME = `t='$(program_transform_name)'; echo unprotoize | sed -e $$t`
5ef852e5 525GCOV_INSTALL_NAME = `t='$(program_transform_name)'; echo gcov | sed -e $$t`
86220f45 526GCCBUG_INSTALL_NAME = `t='$(program_transform_name)'; echo gccbug | sed -e $$t`
b541ad9d 527
528# Actual name to use when installing a cross-compiler.
ccb6700d 529GCC_CROSS_NAME = `t='$(program_transform_cross_name)'; echo gcc | sed -e $$t`
2ff5d8bd 530CPP_CROSS_NAME = `t='$(program_transform_cross_name)'; echo cpp | sed -e $$t`
fc56a674 531PROTOIZE_CROSS_NAME = `t='$(program_transform_cross_name)'; echo protoize | sed -e $$t`
532UNPROTOIZE_CROSS_NAME = `t='$(program_transform_cross_name)'; echo unprotoize | sed -e $$t`
b541ad9d 533
32e6d418 534# Choose the real default target.
535ALL=all.internal
536
537# Choose the real install target.
2cfd79fe 538INSTALL_TARGET=install-normal
539
6c08487b 540# Setup the testing framework, if you have one
541EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
542 echo $${rootme}/../expect/expect ; \
543 else echo expect ; fi`
544
545RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
546 echo $${srcdir}/../dejagnu/runtest ; \
547 else echo runtest; fi`
548RUNTESTFLAGS =
549
b33b80ed 550# Extra symbols for fixproto to define when parsing headers.
c6221df9 551FIXPROTO_DEFINES =
b33b80ed 552
b7c87ff2 553# Extra flags to use when compiling crt{begin,end}.o.
c6221df9 554CRTSTUFF_T_CFLAGS =
b7c87ff2 555
4d3c962c 556# Extra flags to use when compiling [m]crt0.o.
c6221df9 557CRT0STUFF_T_CFLAGS =
4d3c962c 558
0dbd1c74 559# "t" or nothing, for building multilibbed versions of, say, crtbegin.o.
560T =
561
f5da66df 562# Should T contain a `=', libgcc.mk will make T_TARGET, setting
563# $(T_TARGET) to the name of the actual target filename.
564T_TARGET =
565T_TARGET : $(T_TARGET)
566
32e6d418 567# End of variables for you to override.
568
569# Definition of `all' is here so that new rules inserted by sed
570# do not specify the default target.
571# The real definition is under `all.internal' (for native compilers)
572# or `all.cross' (for cross compilers).
c6396a0b 573all: all.indirect
32e6d418 574
131b361e 575# This tells GNU Make version 3 not to put all variables in the environment.
576.NOEXPORT:
577
32e6d418 578# sed inserts variable overrides after the following line.
a0a99f10 579####target overrides
87c0ad1b 580@target_overrides@
581
a0a99f10 582####host overrides
87c0ad1b 583@host_overrides@
584
a0a99f10 585####cross overrides
87c0ad1b 586@cross_defines@
587@cross_overrides@
588
e77fd588 589####build overrides
87c0ad1b 590@build_overrides@
2e9d8ccf 591#\f
32e6d418 592# Now figure out from those variables how to compile and link.
593
c6396a0b 594all.indirect: $(ALL)
595
7b6bbd12 596# IN_GCC tells various files that system.h, toplev.c, etc are available.
5701cb15 597INTERNAL_CFLAGS = $(CROSS) -DIN_GCC @extra_c_flags@
32e6d418 598
599# This is the variable actually used when we compile.
792e272d 600# If you change this line, you probably also need to change the definition
601# of HOST_CFLAGS in build-make to match.
f357ac87 602ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) \
603 $(CFLAGS) $(WARN_CFLAGS) $(XCFLAGS) @DEFS@
32e6d418 604
605# Likewise.
606ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
607
608# Even if ALLOCA is set, don't use it if compiling with GCC.
c1f5b841 609USE_ALLOCA= ${ALLOCA}
610USE_HOST_ALLOCA= ` case "${HOST_ALLOCA}" in ?*) echo ${HOST_PREFIX}${HOST_ALLOCA} ;; esac `
c6396a0b 611USE_HOST_MALLOC= ` case "${HOST_MALLOC}" in ?*) echo ${HOST_PREFIX}${HOST_MALLOC} ;; esac `
612USE_HOST_OBSTACK= ` case "${HOST_OBSTACK}" in ?*) echo ${HOST_PREFIX}${HOST_OBSTACK} ;; esac `
b8a373b2 613USE_HOST_VFPRINTF= ` case "${HOST_VFPRINTF}" in ?*) echo ${HOST_PREFIX}${HOST_VFPRINTF} ;; esac `
614USE_HOST_DOPRINT= ` case "${HOST_DOPRINT}" in ?*) echo ${HOST_PREFIX}${HOST_DOPRINT} ;; esac `
32e6d418 615
616# Dependency on obstack, alloca, malloc or whatever library facilities
617# are not installed in the system libraries.
618# We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
be2828ce 619LIBDEPS= $(INTLLIBS) $(OBSTACK) $(ALLOCA) $(MALLOC) $(VFPRINTF) $(DOPRINT)
32e6d418 620
621# Likewise, for use in the tools that must run on this machine
622# even if we are cross-building GCC.
623# We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
ac2ea426 624HOST_LIBDEPS= $(HOST_PREFIX)$(HOST_OBSTACK) $(HOST_PREFIX)$(HOST_ALLOCA) $(HOST_PREFIX)$(HOST_MALLOC) $(HOST_PREFIX)$(HOST_VFPRINTF) $(HOST_PREFIX)$(HOST_DOPRINT)
32e6d418 625
626# How to link with both our special library facilities
627# and the system's installed libraries.
be2828ce 628LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(INTLLIBS) @LIBS@ $(VFPRINTF) $(DOPRINT) $(CLIB) ../libiberty/libiberty.a
32e6d418 629
630# Likewise, for use in the tools that must run on this machine
631# even if we are cross-building GCC.
c6396a0b 632HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC) \
ac2ea426 633 $(USE_HOST_VFPRINTF) $(USE_HOST_DOPRINT) $(HOST_CLIB)
32e6d418 634
c5ddd6b5 635HOST_RTL = $(HOST_PREFIX)rtl.o $(HOST_PREFIX)bitmap.o \
4333d921 636 $(HOST_PREFIX)ggc-none.o gensupport.o hashtab.o
c5ddd6b5 637
262d46de 638HOST_PRINT = $(HOST_PREFIX)print-rtl.o
04b58880 639HOST_ERRORS = $(HOST_PREFIX)errors.o
32e6d418 640
641# Specify the directories to be searched for header files.
642# Both . and srcdir are used, in that order,
643# so that tm.h and config.h will be found in the compilation
644# subdirectory rather than in the source directory.
f357ac87 645# -I$(@D) and -I$(srcdir)/$(@D) cause the subdirectory of the file
646# currently being compiled, in both source trees, to be examined as well.
647INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
648 -I$(srcdir)/config -I$(srcdir)/../include
32e6d418 649
650# Always use -I$(srcdir)/config when compiling.
651.c.o:
f357ac87 652 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
32e6d418 653
654# This tells GNU make version 3 not to export all the variables
655# defined in this file into the environment.
656.NOEXPORT:
2e9d8ccf 657#\f
73027c94 658# Support for additional languages (other than c and objc).
659# ??? objc can be supported this way too (leave for later).
660
661# These next lines are overridden by configure.
87c0ad1b 662LANG_MAKEFILES = @all_lang_makefiles@
663LANG_STAGESTUFF = @all_stagestuff@
664LANG_DIFF_EXCLUDES = @all_diff_excludes@
87c0ad1b 665LANG_EXTRA_HEADERS = @all_headers@
73027c94 666
667# Flags to pass to recursive makes.
668# CC is set by configure. Hosts without symlinks need special handling
669# because we need CC="stage1/xgcc -Bstage1/" to work in the language
670# subdirectories.
671# ??? The choices here will need some experimenting with.
71094bab 672ORDINARY_FLAGS_TO_PASS = \
396c97db 673 "AR_FLAGS_FOR_TARGET=$(AR_FLAGS_FOR_TARGET)" \
aa787722 674 "AR_CREATE_FOR_TARGET=$(AR_CREATE_FOR_TARGET)" \
675 "AR_EXTRACT_FOR_TARGET=$(AR_EXTRACT_FOR_TARGET)" \
73027c94 676 "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
677 "BISON=$(BISON)" \
678 "BISONFLAGS=$(BISONFLAGS)" \
b3ff31d3 679 "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
2feda28e 680 "CLIB=$(CLIB)" \
c1a2e040 681 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
73027c94 682 "LDFLAGS=$(LDFLAGS)" \
345a1501 683 "FLEX=$(FLEX)" \
684 "FLEXFLAGS=$(FLEXFLAGS)" \
ea4a6c81 685 "LN=$(LN)" \
686 "LN_S=$(LN_S)" \
73027c94 687 "MAKEINFO=$(MAKEINFO)" \
688 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
73027c94 689 "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
690 "RANLIB_TEST_FOR_TARGET=$(RANLIB_TEST_FOR_TARGET)" \
691 "SHELL=$(SHELL)" \
87c0ad1b 692 "STAGE_PREFIX=@stage_prefix_set_by_configure@" \
62268150 693 "exeext=$(exeext)" \
2aa3e87b 694 "build_exeext=$(build_exeext)" \
62268150 695 "objext=$(objext)" \
73027c94 696 "exec_prefix=$(exec_prefix)" \
697 "prefix=$(prefix)" \
933b38ee 698 "local_prefix=$(local_prefix)" \
8ffadb5b 699 "gxx_include_dir=$(gcc_gxx_include_dir)" \
73027c94 700 "tooldir=$(tooldir)" \
40cb25f2 701 "gcc_tooldir=$(gcc_tooldir)" \
73027c94 702 "bindir=$(bindir)" \
be2828ce 703 "libsubdir=$(libsubdir)" \
704 "datadir=$(datadir)" \
be2828ce 705 "localedir=$(localedir)"
71094bab 706FLAGS_TO_PASS = $(ORDINARY_FLAGS_TO_PASS) "CC=@cc_set_by_configure@"
be2828ce 707PREPEND_DOTDOT_TO_RELATIVE_PATHS = sed \
708 -e 's|^ *[^ /][^ /]*/|%&|' \
709 -e 's| -B| -B%|g' \
710 -e 's|% *[^- /]|%&|g' \
711 -e 's|%% *|../|g' \
712 -e 's|%||g'
713SUBDIR_FLAGS_TO_PASS = $(ORDINARY_FLAGS_TO_PASS) \
df4883a6 714 "CC=`echo @quoted_cc_set_by_configure@ | $(PREPEND_DOTDOT_TO_RELATIVE_PATHS)`"
2e9d8ccf 715#\f
32e6d418 716# Lists of files for various purposes.
717
ee8f5350 718# Language-specific object files for C and Objective C.
e8785647 719C_AND_OBJC_OBJS = c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o \
c25509f2 720 c-convert.o c-aux-info.o c-common.o c-semantics.o c-dump.o $(MAYBE_CPPLIB)
ee8f5350 721
32e6d418 722# Language-specific object files for C.
ee8f5350 723C_OBJS = c-parse.o c-lang.o $(C_AND_OBJC_OBJS)
6cba4ca3 724
32e6d418 725# Language-independent object files.
0f221fb7 726
727OBJS = diagnostic.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
8e3bc808 728 function.o stmt.o except.o expr.o calls.o expmed.o explow.o optabs.o real.o \
729 builtins.o intl.o varasm.o rtl.o print-rtl.o rtlanal.o emit-rtl.o genrtl.o \
730 dbxout.o sdbout.o dwarfout.o dwarf2out.o xcoffout.o bitmap.o alias.o gcse.o \
9641f63c 731 integrate.o jump.o cse.o loop.o doloop.o unroll.o flow.o combine.o varray.o \
be2828ce 732 regclass.o regmove.o local-alloc.o global.o reload.o reload1.o caller-save.o \
8e3bc808 733 insn-peep.o reorg.o haifa-sched.o final.o recog.o reg-stack.o regrename.o \
734 insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o lcm.o \
735 profile.o insn-attrtab.o $(out_object_file) $(EXTRA_OBJS) convert.o \
736 mbchar.o splay-tree.o graph.o sbitmap.o resource.o hash.o predict.o \
44acf429 737 lists.o ggc-common.o $(GGC) stringpool.o simplify-rtx.o ssa.o bb-reorder.o \
4333d921 738 sibcall.o conflict.o timevar.o ifcvt.o dominance.o dependence.o dce.o \
739 hashtab.o
32e6d418 740
0f221fb7 741BACKEND = toplev.o libbackend.a
742
32e6d418 743# GEN files are listed separately, so they can be built before doing parallel
744# makes for cc1 or cc1plus. Otherwise sequent parallel make attempts to load
745# them before rtl.o is compiled.
3ad7bb1c 746GEN= genemit genoutput genrecog genextract genflags gencodes genconfig \
1a237d7e 747 genpeep gengenrtl gencheck
32e6d418 748
749# Files to be copied away after each stage in building.
62268150 750STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
32e6d418 751 insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
be2828ce 752 insn-attr.h insn-attrtab.c insn-opinit.c tree-check.h \
02eea913 753 s-flags s-config s-codes s-mlib s-under s-genrtl \
9e042f31 754 s-output s-recog s-emit s-extract s-peep s-check \
9e52652d 755 s-attr s-attrtab s-opinit s-crt0 \
2aa3e87b 756 genemit$(build_exeext) genoutput$(build_exeext) genrecog$(build_exeext) \
757 genextract$(build_exeext) genflags$(build_exeext) gencodes$(build_exeext) \
758 genconfig$(build_exeext) genpeep$(build_exeext) genattrtab$(build_exeext) \
7369c81f 759 genattr$(build_exeext) genopinit$(build_exeext) gengenrtl$(build_exeext) \
aa694eff 760 gencheck$(build_exeext) genrtl.c genrtl.h \
dd6a91ba 761 xgcc$(exeext) cpp$(exeext) cc1$(exeext) cpp0$(exeext) $(EXTRA_PASSES) \
0b30807c 762 $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) cc1obj$(exeext) \
763 enquire$(exeext) protoize$(exeext) unprotoize$(exeext) \
dd6a91ba 764 specs collect2$(exeext) $(USE_COLLECT2) underscore.c tradcpp0$(exeext) \
e9182849 765 gcov$(exeext) *.[0-9][0-9].* *.[si] libcpp.a libbackend.a libgcc.mk \
73027c94 766 $(LANG_STAGESTUFF)
32e6d418 767
768# Members of libgcc1.a.
769LIB1FUNCS = _mulsi3 _udivsi3 _divsi3 _umodsi3 _modsi3 \
799330a9 770 _lshrsi3 _ashrsi3 _ashlsi3 \
32e6d418 771 _divdf3 _muldf3 _negdf2 _adddf3 _subdf3 \
772 _fixdfsi _fixsfsi _floatsidf _floatsisf _truncdfsf2 _extendsfdf2 \
773 _addsf3 _negsf2 _subsf3 _mulsf3 _divsf3 \
774 _eqdf2 _nedf2 _gtdf2 _gedf2 _ltdf2 _ledf2 \
775 _eqsf2 _nesf2 _gtsf2 _gesf2 _ltsf2 _lesf2
776
777# Library members defined in libgcc2.c.
778LIB2FUNCS = _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 \
9ce1b52b 779 _lshrdi3 _ashldi3 _ashrdi3 _ffsdi2 _clz \
4b8f50a8 780 _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \
32e6d418 781 _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \
619c3e71 782 _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi \
d055d75f 783 _fixtfdi _fixunstfdi _floatditf \
4b7a79e2 784 __gcc_bcmp _varargs __dummy _eprintf \
3e5cdb33 785 _bb _clear_cache _trampoline __main _exit \
bec2d490 786 _absvsi2 _absvdi2 _addvsi3 _addvdi3 _subvsi3 _subvdi3 \
787 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 \
89bf85ce 788 _ctors
a69e7f5f 789
790LIB2FUNCS_EH = _eh
32e6d418 791
04ddb594 792FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \
793 _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
a4110d9a 794 _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf _make_sf \
320f29dc 795 _sf_to_df _thenan_sf _sf_to_usi _usi_to_sf
04ddb594 796
797DPBIT_FUNCS = _pack_df _unpack_df _addsub_df _mul_df _div_df \
798 _fpcmp_parts_df _compare_df _eq_df _ne_df _gt_df _ge_df \
a4110d9a 799 _lt_df _le_df _unord_df _si_to_df _df_to_si _negate_df _make_df \
320f29dc 800 _df_to_sf _thenan_df _df_to_usi _usi_to_df
04ddb594 801
32e6d418 802# The files that "belong" in CONFIG_H are deliberately omitted
803# because having them there would not be useful in actual practice.
804# All they would do is cause complete recompilation every time
805# one of the machine description files is edited.
806# That may or may not be what one wants to do.
807# If it is, rm *.o is an easy way to do it.
c20b28d5 808# CONFIG_H = $(host_xm_file) $(tm_file)
32e6d418 809CONFIG_H =
cfbfd5e6 810MACHMODE_H = machmode.h machmode.def
811RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H)
3ad7bb1c 812RTL_H = $(RTL_BASE_H) genrtl.h
4e9d90c7 813TREE_H = tree.h real.h tree.def $(MACHMODE_H) tree-check.h version.h builtins.def
395adca1 814BASIC_BLOCK_H = basic-block.h bitmap.h sbitmap.h varray.h
f6afeec9 815DEMANGLE_H = $(srcdir)/../include/demangle.h
4a7d7a8b 816RECOG_H = recog.h
ae262a47 817EXPR_H = expr.h insn-codes.h
cfbfd5e6 818REGS_H = regs.h varray.h $(MACHMODE_H)
15aa1c64 819INTEGRATE_H = integrate.h varray.h
d6cb6164 820LOOP_H = loop.h varray.h bitmap.h
4f5e65d7 821GCC_H = gcc.h version.h
769177ac 822GGC_H = ggc.h varray.h
553e1559 823TIMEVAR_H = timevar.h timevar.def
47fc0706 824INSN_ATTR_H = insn-attr.h $(srcdir)/insn-addr.h $(srcdir)/varray.h
e41f0d80 825C_COMMON_H = c-common.h $(SPLAY_TREE_H)
826C_TREE_H = c-tree.h $(C_COMMON_H)
827
2e9d8ccf 828#\f
73027c94 829# Language makefile fragments.
830
831# The following targets define the interface between us and the languages.
832#
833# all.build, all.cross, start.encap, rest.encap,
834# info, dvi,
835# install-normal, install-common, install-info, install-man,
98fb2ff8 836# uninstall,
a8514488 837# mostlyclean, clean, distclean, extraclean, maintainer-clean,
73027c94 838# stage1, stage2, stage3, stage4
839#
840# Each language is linked in with a series of hooks (since we can't use `::'
841# targets). The name of each hooked is "lang.${target_name}" (eg: lang.info).
842# Configure computes and adds these here.
843
844####language hooks
87c0ad1b 845@language_hooks@
73027c94 846
847# sed inserts language fragments after the following line.
848####language fragments
87c0ad1b 849@language_fragments@
73027c94 850
851# End of language makefile fragments.
2e9d8ccf 852#\f
8d12f02c 853# The only suffixes we want for implicit rules are .c and .o, so clear
854# the list and add them. This speeds up GNU Make, and allows -r to work.
855.SUFFIXES:
856.SUFFIXES: .c .o
32e6d418 857
d44645af 858Makefile: $(srcdir)/Makefile.in config.status $(srcdir)/version.c \
160b6fa9 859 $(xmake_file) $(tmake_file) $(LANG_MAKEFILES)
860 $(SHELL) $(srcdir)/configure.frag $(srcdir) "$(SUBDIRS)" \
861 "$(xmake_file)" "$(tmake_file)"
f403cbcb 862 cp config.status config.run
76103b2c 863 LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.run
5484bc67 864 rm -f config.run
32e6d418 865
82470d2e 866$(srcdir)/configure: $(srcdir)/configure.in
f357ac87 867 (cd $(srcdir) && autoconf)
87c0ad1b 868
4a3c7228 869gccbug: $(srcdir)/gccbug.in
870 CONFIG_FILES=gccbug CONFIG_HEADERS= ./config.status
871
3f9b9702 872mklibgcc: $(srcdir)/mklibgcc.in
873 CONFIG_FILES=mklibgcc CONFIG_HEADERS= ./config.status
874
0d9d9ae4 875# cstamp-h.in controls rebuilding of config.in.
d44645af 876# It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't
877# delete it. A stamp file is needed as autoheader won't update the file if
878# nothing has changed.
0d9d9ae4 879# It remains in the source directory and is part of the distribution.
880# This follows what is done in shellutils, fileutils, etc.
c3b8daa3 881# "echo timestamp" is used instead of touch to be consistent with other
882# packages that use autoconf (??? perhaps also to avoid problems with patch?).
0d9d9ae4 883# ??? Newer versions have a maintainer mode that may be useful here.
884$(srcdir)/config.in: $(srcdir)/cstamp-h.in
885$(srcdir)/cstamp-h.in: $(srcdir)/configure.in $(srcdir)/acconfig.h
f357ac87 886 (cd $(srcdir) && autoheader)
ba679b21 887 @rm -f $(srcdir)/cstamp-h.in
c3b8daa3 888 echo timestamp > $(srcdir)/cstamp-h.in
764fc592 889auto-host.h: cstamp-h ; @true
0d9d9ae4 890cstamp-h: config.in config.status
76103b2c 891 CONFIG_HEADERS=auto-host.h:config.in LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status
5539b206 892
d44645af 893# Really, really stupid make features, such as SUN's KEEP_STATE, may force
894# a target to build even if it is up-to-date. So we must verify that
895# config.status does not exist before failing.
bb607926 896config.status: $(srcdir)/configure $(srcdir)/config.gcc version.c
d44645af 897 @if [ ! -f config.status ] ; then \
98fb2ff8 898 echo You must configure gcc. Look at http://gcc.gnu.org/install/ for details.; \
d44645af 899 false; \
900 else \
76103b2c 901 LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status --recheck; \
d44645af 902 fi
903
bfcba12d 904all.internal: start.encap rest.encap doc
32e6d418 905# This is what to compile if making a cross-compiler.
73027c94 906# Note that we can compile enquire using the cross-compiler just built,
87540b0a 907# although we can't run it on this machine.
dd6a91ba 908all.cross: native gcc-cross cpp$(exeext) specs \
f4bd6786 909 $(LIBGCC) $(LIBGCC1_TEST) $(EXTRA_PARTS) lang.all.cross doc
e77fd588 910# This is what to compile if making gcc with a cross-compiler.
dd6a91ba 911all.build: native xgcc$(exeext) cpp$(exeext) $(EXTRA_PARTS) lang.all.build
32e6d418 912# This is what must be made before installing GCC and converting libraries.
dd6a91ba 913start.encap: native xgcc$(exeext) cpp$(exeext) specs \
28c11b39 914 xlimits.h lang.start.encap
335ebf8f 915# These can't be made until after GCC can run.
58113712 916rest.encap: $(STMP_FIXPROTO) $(LIBGCC) $(EXTRA_PARTS) lang.rest.encap
32e6d418 917# This is what is made with the host's compiler
918# whether making a cross compiler or not.
dd6a91ba 919native: config.status auto-host.h intl.all $(LANGUAGES) \
3ded972d 920 $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2)
32e6d418 921
922# Define the names for selecting languages in LANGUAGES.
dd6a91ba 923C c: cc1$(exeext) tradcpp0$(exeext)
32e6d418 924PROTO: proto
925
ee4720a9 926# Tell GNU make these are phony targets.
8757933b 927.PHONY: C c PROTO proto
ee4720a9 928
840a6e8d 929# On the target machine, finish building a cross compiler.
930# This does the things that can't be done on the host machine.
19c49761 931rest.cross: $(LIBGCC) specs
840a6e8d 932
3b9b6fde 933# Verify that it works to compile and link libgcc1-test.
d7330690 934# If it does, then there are sufficient replacements for libgcc1.a.
3b9b6fde 935libgcc1-test: libgcc1-test.o native $(GCC_PARTS)
55e40402 936 @echo "Testing libgcc1. Ignore linker warning messages."
3b9b6fde 937 $(GCC_FOR_TARGET) $(GCC_CFLAGS) libgcc1-test.o -o libgcc1-test \
b6f6ec68 938 -nostartfiles -nostdlib `$(GCC_FOR_TARGET) --print-libgcc-file-name`
7f6a6499 939libgcc1-test.o: libgcc1-test.c native xgcc$(exeext)
3b9b6fde 940 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -c $(srcdir)/libgcc1-test.c
d7330690 941
840a6e8d 942# Recompile all the language-independent object files.
943# This is used only if the user explicitly asks for it.
0f221fb7 944compilations: $(BACKEND)
32e6d418 945
0f221fb7 946# Like libcpp.a, this archive is strictly for the host.
947libbackend.a: $(OBJS)
948 -rm -rf libbackend.a
949 $(AR) $(AR_FLAGS) libbackend.a $(OBJS)
950 if $(RANLIB_TEST) ; then $(RANLIB) libbackend.a ; else true ; fi
03f51dea 951
77a164d8 952# We call this executable `xgcc' rather than `gcc'
953# to avoid confusion if the current directory is in the path
954# and CC is `gcc'. It is renamed to `gcc' when it is installed.
cdf76fe2 955xgcc$(exeext): gcc.o gccspec.o version.o intl.o prefix.o \
a91671eb 956 version.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
cdf76fe2 957 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o gccspec.o intl.o \
958 prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
840a6e8d 959
dd6a91ba 960# cpp is to cpp0 as gcc is to cc1.
28c11b39 961# The only difference from xgcc is that it's linked with cppspec.o
962# instead of gccspec.o.
dd6a91ba 963cpp$(exeext): gcc.o cppspec.o version.o intl.o prefix.o \
28c11b39 964 version.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
965 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o cppspec.o intl.o \
966 prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
967
840a6e8d 968# Dump a specs file to make -B./ read these specs over installed ones.
7f6a6499 969specs: xgcc$(exeext)
c92e16d4 970 $(GCC_FOR_TARGET) -dumpspecs > tmp-specs
971 mv tmp-specs specs
32e6d418 972
77a164d8 973# We do want to create an executable named `xgcc', so we can use it to
32e6d418 974# compile libgcc2.a.
975# Also create gcc-cross, so that install-common will install properly.
7f6a6499 976gcc-cross: xgcc$(exeext)
62268150 977 cp xgcc$(exeext) gcc-cross$(exeext)
32e6d418 978
f357ac87 979cc1$(exeext): $(C_OBJS) $(BACKEND) $(LIBDEPS)
0f221fb7 980 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1$(exeext) \
981 $(C_OBJS) $(BACKEND) $(LIBS)
32e6d418 982
3f69fed5 983# Build the version of limits.h that we will install.
984xlimits.h: glimits.h limitx.h limity.h
0848b369 985 if $(LIMITS_H_TEST) ; then \
c92e16d4 986 cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > tmp-xlimits.h; \
3f69fed5 987 else \
c92e16d4 988 cat $(srcdir)/glimits.h > tmp-xlimits.h; \
3f69fed5 989 fi
c92e16d4 990 mv tmp-xlimits.h xlimits.h
2e9d8ccf 991#\f
32e6d418 992# Build libgcc.a.
a20b21eb 993
89bf85ce 994LIB2ADD = $(LIB2ADDEH) $(LIB2FUNCS_EXTRA)
3f9b9702 995
07bb2c21 996libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) xgcc$(exeext)
3f9b9702 997 objext='$(objext)' \
998 OLDCC='$(OLDCC)' \
999 LIBGCC1='$(LIBGCC1)' \
1000 LIB1FUNCS='$(LIB1FUNCS)' \
1001 LIB1ASMFUNCS='$(LIB1ASMFUNCS)' \
1002 LIB1FUNCS_EXTRA='$(LIB1FUNCS_EXTRA)' \
1003 LIB2FUNCS='$(LIB2FUNCS)' \
1004 LIB2FUNCS_EH='$(LIB2FUNCS_EH)' \
1005 LIB2ADD='$(LIB2ADD)' \
1006 FPBIT='$(FPBIT)' \
1007 FPBIT_FUNCS='$(FPBIT_FUNCS)' \
1008 DPBIT='$(DPBIT)' \
1009 DPBIT_FUNCS='$(DPBIT_FUNCS)' \
1010 MULTILIBS=`$(GCC_FOR_TARGET) --print-multi-lib` \
1011 EXTRA_MULTILIB_PARTS='$(EXTRA_MULTILIB_PARTS)' \
a1415e6d 1012 SHLIB_LINK='$(SHLIB_LINK)' \
95126477 1013 SHLIB_EXT='$(SHLIB_EXT)' \
a1415e6d 1014 SHLIB_MULTILIB='$(SHLIB_MULTILIB)' \
111349c7 1015 SHLIB_MKMAP='$(SHLIB_MKMAP)' \
1016 SHLIB_MAPFILES='$(SHLIB_MAPFILES)' \
a5c6ce69 1017 SHLIB_NM_FLAGS='$(SHLIB_NM_FLAGS)' \
3f9b9702 1018 $(SHELL) mklibgcc > tmp-libgcc.mk
2bd9055c 1019 mv tmp-libgcc.mk libgcc.mk
1020
1021# All the things that might cause us to want to recompile bits of libgcc.
1022LIBGCC_DEPS = $(GCC_PASSES) $(LANGUAGES) stmp-int-hdrs $(STMP_FIXPROTO) \
1023 libgcc.mk $(srcdir)/libgcc1.c $(srcdir)/libgcc2.c $(CONFIG_H) \
1024 $(MACHMODE_H) longlong.h frame.h gbl-ctors.h config.status \
a1415e6d 1025 stmp-int-hdrs tsystem.h $(FPBIT) $(DPBIT) $(LIB2ADD) $(EXTRA_PARTS)
3f9b9702 1026
2bd9055c 1027libgcc.a: $(LIBGCC_DEPS)
3f9b9702 1028 $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
1029 HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
1030 AR_FOR_TARGET="$(AR_FOR_TARGET)" \
1031 AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
1032 AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
b3ff31d3 1033 OLDCC="$(OLDCC)" CCLIBFLAGS="$(CCLIBFLAGS)" \
1034 CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \
3f9b9702 1035 RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)" \
1036 RANLIB_TEST_FOR_TARGET="$(RANLIB_TEST_FOR_TARGET)" \
111349c7 1037 NM_FOR_TARGET="$(NM_FOR_TARGET)" AWK="$(AWK)" \
3f9b9702 1038 LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" \
1039 INCLUDES="$(INCLUDES)" MAYBE_USE_COLLECT2="$(MAYBE_USE_COLLECT2)" \
1040 CONFIG_H="$(CONFIG_H)" MACHMODE_H="$(MACHMODE_H)" \
ab956f4b 1041 LIB1ASMSRC='$(LIB1ASMSRC)' \
3f9b9702 1042 -f libgcc.mk all
32e6d418 1043
f1ad3130 1044# Use the genmultilib shell script to generate the information the gcc
1045# driver program needs to select the library directory based on the
1046# switches.
997d68fe 1047multilib.h: s-mlib; @true
1048s-mlib: $(srcdir)/genmultilib Makefile
3d97d965 1049 $(SHELL) $(srcdir)/genmultilib \
1050 "$(MULTILIB_OPTIONS)" \
1051 "$(MULTILIB_DIRNAMES)" \
1052 "$(MULTILIB_MATCHES)" \
1053 "$(MULTILIB_EXCEPTIONS)" \
54518c3b 1054 "$(MULTILIB_EXTRA_OPTS)" \
1055 "$(MULTILIB_EXCLUSIONS)" > tmp-mlib.h
bbb1c53a 1056 $(SHELL) $(srcdir)/move-if-change tmp-mlib.h multilib.h
997d68fe 1057 touch s-mlib
f1ad3130 1058
1059# Build multiple copies of libgcc.a, one for each target switch.
2bd9055c 1060stmp-multilib: $(LIBGCC_DEPS)
00075505 1061 $(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
3f9b9702 1062 HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
396c97db 1063 AR_FOR_TARGET="$(AR_FOR_TARGET)" \
aa787722 1064 AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
396c97db 1065 AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
b3ff31d3 1066 OLDCC="$(OLDCC)" CCLIBFLAGS="$(CCLIBFLAGS)" \
1067 CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \
3f9b9702 1068 RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)" \
1069 RANLIB_TEST_FOR_TARGET="$(RANLIB_TEST_FOR_TARGET)" \
111349c7 1070 NM_FOR_TARGET="$(NM_FOR_TARGET)" AWK="$(AWK)" \
3f9b9702 1071 LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)" \
1072 INCLUDES="$(INCLUDES)" MAYBE_USE_COLLECT2="$(MAYBE_USE_COLLECT2)" \
1073 CONFIG_H="$(CONFIG_H)" MACHMODE_H="$(MACHMODE_H)" \
d4b91428 1074 LIB1ASMSRC='$(LIB1ASMSRC)' \
3f9b9702 1075 -f libgcc.mk all
1076 touch stmp-multilib
00075505 1077
32e6d418 1078# Compile two additional files that are linked with every program
6bcd7097 1079# linked using GCC on systems using COFF or ELF, for the sake of C++
1080# constructors.
ad87de1e 1081$(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
069631e1 1082 defaults.h frame.h gbl-ctors.h stmp-int-hdrs tsystem.h
6efd403b 1083 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
fe0c5877 1084 -finhibit-size-directive -fno-inline-functions \
1085 -fno-exceptions $(CRTSTUFF_T_CFLAGS) @inhibit_libc@ \
6efd403b 1086 -c $(srcdir)/crtstuff.c -DCRT_BEGIN -o $(T)crtbegin$(objext)
cdc96909 1087
ad87de1e 1088$(T)crtend.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
069631e1 1089 defaults.h frame.h gbl-ctors.h stmp-int-hdrs tsystem.h
6efd403b 1090 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
fe0c5877 1091 -finhibit-size-directive -fno-inline-functions \
1092 -fno-exceptions $(CRTSTUFF_T_CFLAGS) @inhibit_libc@ \
6efd403b 1093 -c $(srcdir)/crtstuff.c -DCRT_END -o $(T)crtend$(objext)
6bcd7097 1094
9e52652d 1095# These are versions of crtbegin and crtend for shared libraries.
1096$(T)crtbeginS.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
1097 defaults.h frame.h gbl-ctors.h stmp-int-hdrs tsystem.h
1098 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
1099 -finhibit-size-directive -fno-inline-functions \
1100 -fno-exceptions $(CRTSTUFF_T_CFLAGS_S) @inhibit_libc@ \
1101 -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFS_O \
1102 -o $(T)crtbeginS$(objext)
6bcd7097 1103
9e52652d 1104$(T)crtendS.o: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
069631e1 1105 defaults.h frame.h gbl-ctors.h stmp-int-hdrs tsystem.h
9e52652d 1106 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
1107 -finhibit-size-directive -fno-inline-functions \
1108 -fno-exceptions $(CRTSTUFF_T_CFLAGS_S) @inhibit_libc@ \
1109 -c $(srcdir)/crtstuff.c -DCRT_END -DCRTSTUFFS_O \
1110 -o $(T)crtendS$(objext)
4d3c962c 1111
3f9b9702 1112# Compile the start modules crt0.o and mcrt0.o that are linked with
1113# every program
997d68fe 1114crt0.o: s-crt0 ; @true
1115mcrt0.o: s-crt0; @true
4d3c962c 1116
997d68fe 1117s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
4d3c962c 1118 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
1119 -o crt0.o -c $(CRT0_S)
1120 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
1121 -o mcrt0.o -c $(MCRT0_S)
997d68fe 1122 touch s-crt0
2e9d8ccf 1123#\f
32e6d418 1124# Compiling object files from source files.
1125
1126# Note that dependencies on obstack.h are not written
1127# because that file is not part of GCC.
32e6d418 1128
1129# C language specific files.
1130
e41f0d80 1131c-errors.o: c-errors.c $(CONFIG_H) system.h $(TREE_H) $(C_TREE_H) flags.h \
b02cf41a 1132 diagnostic.h
518796ad 1133c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h $(GGC_H) intl.h \
e41f0d80 1134 $(C_TREE_H) input.h flags.h system.h toplev.h output.h cpplib.h
32e6d418 1135 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
518796ad 1136
3135f5e2 1137$(srcdir)/c-parse.c: $(srcdir)/c-parse.y
f357ac87 1138 (cd $(srcdir) && $(BISON) $(BISONFLAGS) -o c-p$$$$.c c-parse.y && \
1139 mv -f c-p$$$$.c c-parse.c)
3135f5e2 1140$(srcdir)/c-parse.y: c-parse.in
04e167f4 1141 echo '/*WARNING: This file is automatically generated!*/' >tmp-c-parse.y
d7c691fa 1142 sed -e "/^ifobjc$$/,/^end ifobjc$$/d" \
1143 -e "/^ifc$$/d" -e "/^end ifc$$/d" \
04e167f4 1144 $(srcdir)/c-parse.in >>tmp-c-parse.y
bbb1c53a 1145 $(SHELL) $(srcdir)/move-if-change tmp-c-parse.y $(srcdir)/c-parse.y
d7c691fa 1146
e41f0d80 1147c-decl.o : c-decl.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) $(C_TREE_H) \
1148 $(GGC_H) c-lex.h flags.h function.h output.h $(EXPR_H) \
6e6e5faa 1149 toplev.h defaults.h intl.h
e41f0d80 1150c-typeck.o : c-typeck.c $(CONFIG_H) system.h $(TREE_H) $(C_TREE_H) \
72040e7e 1151 flags.h intl.h output.h $(EXPR_H) $(RTL_H) toplev.h
e41f0d80 1152c-lang.o : c-lang.c $(CONFIG_H) system.h $(TREE_H) $(C_TREE_H) \
1153 $(GGC_H) c-lex.h toplev.h diagnostic.h output.h function.h \
1154 $(RTL_H) $(EXPR_H)
1155c-lex.o : c-lex.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) c-lex.h $(C_TREE_H) \
1156 c-pragma.h input.h intl.h flags.h toplev.h output.h \
ec6cb94a 1157 mbchar.h cpplib.h $(EXPR_H)
e41f0d80 1158c-aux-info.o : c-aux-info.c $(CONFIG_H) system.h $(TREE_H) $(C_TREE_H) \
1159 flags.h toplev.h
c3ab7bd5 1160c-convert.o : c-convert.c $(CONFIG_H) system.h $(TREE_H) flags.h toplev.h
304c5bf1 1161c-pragma.o: c-pragma.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) function.h \
769177ac 1162 defaults.h c-pragma.h toplev.h $(GGC_H)
4a7d7a8b 1163mbchar.o: mbchar.c $(CONFIG_H) system.h mbchar.h
27f5edd1 1164graph.o: graph.c $(CONFIG_H) system.h toplev.h flags.h output.h $(RTL_H) \
e5bd1365 1165 function.h hard-reg-set.h $(BASIC_BLOCK_H) graph.h
d6cb6164 1166sbitmap.o: sbitmap.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h \
1167 $(BASIC_BLOCK_H)
32e6d418 1168
c6221df9 1169COLLECT2_OBJS = collect2.o tlink.o hash.o intl.o underscore.o version.o
67ce0331 1170collect2$(exeext): $(COLLECT2_OBJS) $(LIBDEPS)
e77fd588 1171# Don't try modifying collect2 (aka ld) in place--it might be linking this.
62268150 1172 -rm -f collect2$(exeext)
be2828ce 1173 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(COLLECT2_OBJS) $(LIBS)
32e6d418 1174
be2828ce 1175collect2.o : collect2.c $(CONFIG_H) system.h gstab.h intl.h \
8a5b87ad 1176 $(OBSTACK_H) $(DEMANGLE_H) collect2.h version.h
5e03c63d 1177 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
67cb4bc1 1178 -DTARGET_MACHINE=\"$(target_alias)\" $(MAYBE_USE_COLLECT2) \
345a1501 1179 -c $(srcdir)/collect2.c
32e6d418 1180
6e6e5faa 1181tlink.o: tlink.c $(DEMANGLE_H) hash.h $(CONFIG_H) system.h collect2.h intl.h
c3ab7bd5 1182hash.o: hash.c hash.h system.h toplev.h
cc895f11 1183
4a7d7a8b 1184vfprintf.o: $(srcdir)/../libiberty/vfprintf.c $(CONFIG_H) system.h
099377d8 1185 rm -f vfprintf.c
1186 $(LN_S) $(srcdir)/../libiberty/vfprintf.c vfprintf.c
f357ac87 1187 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1188 vfprintf.c $(OUTPUT_OPTION)
099377d8 1189
a5b1863e 1190splay-tree.o: $(srcdir)/../libiberty/splay-tree.c \
4a7d7a8b 1191 $(srcdir)/../include/splay-tree.h $(srcdir)/../include/libiberty.h
a5b1863e 1192 rm -f splay-tree.c
1193 $(LN_S) $(srcdir)/../libiberty/splay-tree.c splay-tree.c
f357ac87 1194 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1195 splay-tree.c $(OUTPUT_OPTION)
a5b1863e 1196
997d68fe 1197underscore.c: s-under ; @true
7306ddcf 1198
997d68fe 1199s-under: $(GCC_PASSES)
c20b28d5 1200 echo "int xxy_us_dummy;" >tmp-dum.c
1201 $(GCC_FOR_TARGET) -S tmp-dum.c
1202 echo '/*WARNING: This file is automatically generated!*/' >tmp-under.c
1203 if grep _xxy_us_dummy tmp-dum.s > /dev/null ; then \
1204 echo "int prepends_underscore = 1;" >>tmp-under.c; \
d2f0b724 1205 else \
c20b28d5 1206 echo "int prepends_underscore = 0;" >>tmp-under.c; \
d2f0b724 1207 fi
bbb1c53a 1208 $(SHELL) $(srcdir)/move-if-change tmp-under.c underscore.c
c20b28d5 1209 -rm -f tmp-dum.c tmp-dum.s
997d68fe 1210 touch s-under
d2f0b724 1211
32e6d418 1212# A file used by all variants of C.
1213
988fc1d1 1214c-common.o : c-common.c $(CONFIG_H) system.h $(TREE_H) \
e41f0d80 1215 $(C_COMMON_H) flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
e0bc5413 1216 $(EXPR_H) diagnostic.h
32e6d418 1217
e41f0d80 1218c-semantics.o : c-semantics.c $(CONFIG_H) system.h $(TREE_H) $(C_TREE_H) \
1219 c-lex.h flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
5c3247a9 1220 $(EXPR_H)
1221
c25509f2 1222c-dump.o: c-dump.c $(CONFIG_H) system.h $(TREE_H) $(C_TREE_H) \
1223 c-lex.h flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
1224 $(EXPR_H) $(SPLAY_TREE_H) c-dump.h
1225
32e6d418 1226# Language-independent files.
1227
4813bdd4 1228DRIVER_DEFINES = \
b155ba2f 1229 -DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \
c6396a0b 1230 -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
7df9e578 1231 -DDEFAULT_TARGET_VERSION=\"$(version)\" \
67cb4bc1 1232 -DDEFAULT_TARGET_MACHINE=\"$(target_alias)\" \
b155ba2f 1233 -DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \
1234 -DTOOLDIR_BASE_PREFIX=\"$(unlibsubdir)/../\"
be2828ce 1235gcc.o: gcc.c $(CONFIG_H) system.h intl.h multilib.h \
4f5e65d7 1236 Makefile $(lang_specs_files) prefix.h $(GCC_H)
4813bdd4 1237 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1238 $(DRIVER_DEFINES) \
345a1501 1239 -c $(srcdir)/gcc.c
32e6d418 1240
4f5e65d7 1241gccspec.o: gccspec.c $(CONFIG_H) system.h $(GCC_H)
1242cppspec.o: cppspec.c $(CONFIG_H) system.h $(GCC_H)
cdf76fe2 1243
3e207e38 1244tree-check.h: s-check ; @true
1051d196 1245s-check : gencheck $(srcdir)/move-if-change
3e207e38 1246 ./gencheck > tmp-check.h
bbb1c53a 1247 $(SHELL) $(srcdir)/move-if-change tmp-check.h tree-check.h
3e207e38 1248 touch s-check
1249
60239181 1250gencheck : gencheck.o $(HOST_LIBDEPS)
3e207e38 1251 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1252 gencheck.o $(HOST_LIBS)
1253
60239181 1254gencheck.o : gencheck.c gencheck.h tree.def $(CONFIG_H) hconfig.h system.h \
1255 $(lang_tree_files)
be2828ce 1256 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) \
1257 $(srcdir)/gencheck.c
580b113f 1258
32e6d418 1259dumpvers: dumpvers.c
1260
4f5e65d7 1261version.o: version.c version.h
05513b45 1262
6374999a 1263ggc-common.o: ggc-common.c $(CONFIG_H) $(RTL_H) $(TREE_H) \
769177ac 1264 flags.h $(GGC_H) varray.h hash.h
bebb7b68 1265
6374999a 1266ggc-simple.o: ggc-simple.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h \
553e1559 1267 $(GGC_H) varray.h $(TIMEVAR_H)
05513b45 1268
90856340 1269ggc-page.o: ggc-page.c $(CONFIG_H) $(RTL_H) $(TREE_H) flags.h toplev.h \
553e1559 1270 $(GGC_H) varray.h $(TIMEVAR_H)
911ab6b9 1271
44acf429 1272stringpool.o: stringpool.c $(CONFIG_H) system.h $(TREE_H) $(OBSTACK_H) \
1273 flags.h toplev.h
1274
769177ac 1275ggc-none.o: ggc-none.c $(CONFIG_H) $(RTL_H) $(GGC_H)
05513b45 1276
7b6bbd12 1277obstack.o: $(srcdir)/../libiberty/obstack.c $(CONFIG_H)
1278 rm -f obstack.c
1279 $(LN_S) $(srcdir)/../libiberty/obstack.c obstack.c
f357ac87 1280 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1281 obstack.c $(OUTPUT_OPTION)
7b6bbd12 1282
7bcdc3c7 1283prefix.o: prefix.c $(CONFIG_H) system.h Makefile prefix.h
0dbd1c74 1284 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1285 -DPREFIX=\"$(prefix)\" \
345a1501 1286 -c $(srcdir)/prefix.c
32e6d418 1287
7014838c 1288convert.o: convert.c $(CONFIG_H) system.h $(TREE_H) flags.h convert.h toplev.h
beb68ac1 1289
a7b0c170 1290tree.o : tree.c $(CONFIG_H) system.h $(TREE_H) flags.h function.h toplev.h \
0e66aa75 1291 $(GGC_H) $(HASHTAB_H) output.h defaults.h
769177ac 1292print-tree.o : print-tree.c $(CONFIG_H) system.h $(TREE_H) $(GGC_H)
c091e5a4 1293stor-layout.o : stor-layout.c $(CONFIG_H) system.h $(TREE_H) flags.h \
769177ac 1294 function.h $(EXPR_H) $(RTL_H) toplev.h $(GGC_H)
0f9685e4 1295fold-const.o : fold-const.c $(CONFIG_H) system.h $(TREE_H) flags.h toplev.h \
aed0bd19 1296 $(EXPR_H) $(RTL_H) $(GGC_H)
993ca5a5 1297diagnostic.o : diagnostic.c diagnostic.h \
1298 $(CONFIG_H) system.h $(TREE_H) $(RTL_H) tm_p.h flags.h \
47fc0706 1299 $(GGC_H) input.h $(INSN_ATTR_H) insn-codes.h insn-config.h toplev.h intl.h
0a893c29 1300toplev.o : toplev.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) function.h \
47fc0706 1301 flags.h input.h $(INSN_ATTR_H) xcoffout.h defaults.h output.h diagnostic.h \
be2828ce 1302 insn-codes.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h dwarfout.h \
d6cb6164 1303 dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \
715548fa 1304 graph.h $(LOOP_H) except.h $(REGS_H) $(TIMEVAR_H) $(lang_options_files) ssa.h
b600804e 1305 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(MAYBE_USE_COLLECT2) \
67cb4bc1 1306 -DTARGET_NAME=\"$(target_alias)\" \
345a1501 1307 -c $(srcdir)/toplev.c
32e6d418 1308
769177ac 1309rtl.o : rtl.c $(CONFIG_H) system.h $(RTL_H) bitmap.h $(GGC_H) toplev.h
32e6d418 1310
d6cb6164 1311print-rtl.o : print-rtl.c $(CONFIG_H) system.h $(RTL_H) hard-reg-set.h \
1312 $(BASIC_BLOCK_H)
90e1e7af 1313rtlanal.o : rtlanal.c $(CONFIG_H) system.h toplev.h $(RTL_H)
04b58880 1314errors.o : errors.c $(CONFIG_H) system.h errors.h
32e6d418 1315
405711de 1316varasm.o : varasm.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h \
d6ff8d83 1317 function.h defaults.h $(EXPR_H) hard-reg-set.h $(REGS_H) \
769177ac 1318 xcoffout.h output.h c-pragma.h toplev.h dbxout.h sdbout.h $(GGC_H)
405711de 1319function.o : function.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
d6ff8d83 1320 function.h insn-flags.h insn-codes.h $(EXPR_H) $(REGS_H) hard-reg-set.h \
769177ac 1321 insn-config.h $(RECOG_H) output.h toplev.h except.h hash.h $(GGC_H)
405711de 1322stmt.o : stmt.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h function.h \
ae262a47 1323 insn-flags.h insn-config.h insn-codes.h hard-reg-set.h $(EXPR_H) except.h \
769177ac 1324 $(LOOP_H) $(RECOG_H) toplev.h output.h varray.h $(GGC_H)
405711de 1325except.o : except.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
d6ff8d83 1326 function.h insn-flags.h $(EXPR_H) $(REGS_H) hard-reg-set.h \
769177ac 1327 insn-config.h $(RECOG_H) output.h except.h toplev.h intl.h $(GGC_H)
405711de 1328expr.o : expr.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h function.h \
d3b64f2d 1329 $(REGS_H) insn-flags.h insn-codes.h $(EXPR_H) insn-config.h $(RECOG_H) \
521dd524 1330 output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h except.h \
6702c250 1331 reload.h $(GGC_H) intl.h
53800dbe 1332builtins.o : builtins.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
1333 function.h $(REGS_H) insn-flags.h insn-codes.h $(EXPR_H) insn-config.h \
1334 $(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
1335 except.h
ae262a47 1336calls.o : calls.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h $(EXPR_H) \
0b8eccec 1337 insn-flags.h $(REGS_H) toplev.h output.h function.h $(TIMEVAR_H)
405711de 1338expmed.o : expmed.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
d3b64f2d 1339 insn-flags.h insn-config.h insn-codes.h $(EXPR_H) $(RECOG_H) real.h toplev.h
405711de 1340explow.o : explow.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
d3b64f2d 1341 hard-reg-set.h insn-config.h $(EXPR_H) $(RECOG_H) insn-flags.h \
a5fb14bd 1342 insn-codes.h toplev.h function.h
405711de 1343optabs.o : optabs.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
d3b64f2d 1344 insn-flags.h insn-config.h insn-codes.h $(EXPR_H) $(RECOG_H) reload.h \
0e66aa75 1345 toplev.h $(GGC_H) real.h defaults.h
d6ff8d83 1346dbxout.o : dbxout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h $(REGS_H) \
0e93a6ac 1347 insn-config.h reload.h gstab.h xcoffout.h defaults.h output.h dbxout.h \
4f5e65d7 1348 toplev.h
405711de 1349sdbout.o : sdbout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) flags.h except.h \
d6ff8d83 1350 function.h $(EXPR_H) output.h hard-reg-set.h $(REGS_H) defaults.h real.h \
8a5b87ad 1351 insn-config.h $(OBSTACK_H) xcoffout.h c-pragma.h \
7b6bbd12 1352 sdbout.h toplev.h
405711de 1353dwarfout.o : dwarfout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) dwarf.h \
de2f3039 1354 flags.h insn-config.h reload.h output.h defaults.h toplev.h dwarfout.h
405711de 1355dwarf2out.o : dwarf2out.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) dwarf2.h \
ae262a47 1356 flags.h insn-config.h reload.h output.h defaults.h \
eacbfaac 1357 hard-reg-set.h $(REGS_H) $(EXPR_H) toplev.h dwarf2out.h varray.h \
769177ac 1358 $(GGC_H) except.h
405711de 1359xcoffout.o : xcoffout.c $(CONFIG_H) system.h $(TREE_H) $(RTL_H) xcoffout.h \
769177ac 1360 flags.h toplev.h output.h dbxout.h $(GGC_H)
405711de 1361emit-rtl.o : emit-rtl.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
769177ac 1362 function.h $(REGS_H) insn-config.h $(RECOG_H) real.h $(GGC_H) \
73f5c1e3 1363 $(EXPR_H) $(srcdir)/../include/obstack.h hard-reg-set.h bitmap.h toplev.h \
0e66aa75 1364 $(HASHTAB_H) defaults.h
c3ab7bd5 1365real.o : real.c $(CONFIG_H) system.h $(TREE_H) toplev.h
405711de 1366integrate.o : integrate.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
395adca1 1367 $(INTEGRATE_H) insn-flags.h insn-config.h $(EXPR_H) real.h $(REGS_H) \
a4d05baf 1368 intl.h function.h output.h $(RECOG_H) except.h toplev.h $(LOOP_H)
d6ff8d83 1369jump.o : jump.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h $(REGS_H) \
0a893c29 1370 insn-config.h insn-flags.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \
47fc0706 1371 toplev.h $(INSN_ATTR_H)
32e6d418 1372
af21a202 1373simplify-rtx.o : simplify-rtx.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) \
1374 hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
715548fa 1375 output.h function.h cselib.h $(GGC_H) $(OBSTACK_H)
d6ff8d83 1376cse.o : cse.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h flags.h \
d27eb4b1 1377 real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h output.h function.h \
1378 $(BASIC_BLOCK_H) $(GGC_H)
d3b64f2d 1379gcse.o : gcse.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h \
1380 flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) \
0a893c29 1381 function.h output.h toplev.h
60ecc450 1382sibcall.o : sibcall.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) function.h \
1383 hard-reg-set.h flags.h insn-config.h $(RECOG_H) $(BASIC_BLOCK_H)
fb11422a 1384resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h system.h \
d8c9779c 1385 $(BASIC_BLOCK_H) $(REGS_H) flags.h output.h resource.h function.h toplev.h \
47fc0706 1386 $(INSN_ATTR_H) except.h
e48ba7af 1387lcm.o : lcm.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h flags.h \
47fc0706 1388 real.h insn-config.h $(INSN_ATTR_H) $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H)
1deb248e 1389ssa.o : ssa.c $(CONFIG_H) system.h $(REGS_H) varray.h \
1390 hard-reg-set.h flags.h function.h real.h insn-config.h $(RECOG_H) \
1391 $(BASIC_BLOCK_H) output.h ssa.h
1392dce.o : dce.c $(CONFIG_H) system.h $(RTL_H) hard-reg-set.h $(BASIC_BLOCK_H) \
1393 ssa.h insn-config.h $(RECOG_H) output.h
54932b4d 1394conflict.o : conflict.c $(CONFIG_H) system.h $(OBSTACK_H) $(HASHTAB_H) \
d6cb6164 1395 $(RTL_H) hard-reg-set.h $(BASIC_BLOCK_H)
1396profile.o : profile.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
1397 insn-flags.h insn-config.h output.h $(REGS_H) $(EXPR_H) function.h \
0e66aa75 1398 gcov-io.h toplev.h $(GGC_H) hard-reg-set.h $(BASIC_BLOCK_H) defaults.h
a4d05baf 1399loop.o : loop.c $(CONFIG_H) system.h $(RTL_H) flags.h $(LOOP_H) insn-config.h \
d6ff8d83 1400 insn-flags.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) real.h \
1617c276 1401 $(BASIC_BLOCK_H) function.h toplev.h varray.h except.h cselib.h
9641f63c 1402doloop.o : doloop.c $(CONFIG_H) system.h $(RTL_H) flags.h $(LOOP_H) \
1403 insn-flags.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H)
0a893c29 1404unroll.o : unroll.c $(CONFIG_H) system.h $(RTL_H) insn-config.h function.h \
395adca1 1405 $(INTEGRATE_H) $(REGS_H) $(RECOG_H) flags.h $(EXPR_H) $(LOOP_H) toplev.h \
d6cb6164 1406 hard-reg-set.h varray.h $(BASIC_BLOCK_H)
2d9b9dfe 1407flow.o : flow.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h insn-config.h \
952b0f82 1408 $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
d7c47c0e 1409 insn-flags.h function.h except.h $(EXPR_H) ssa.h $(GGC_H)
4794f989 1410dominance.o : dominance.c $(CONFIG_H) system.h $(RTL_H) hard-reg-set.h \
1411 $(BASIC_BLOCK_H)
0a893c29 1412combine.o : combine.c $(CONFIG_H) system.h $(RTL_H) flags.h function.h \
47fc0706 1413 insn-config.h insn-flags.h insn-codes.h $(INSN_ATTR_H) $(REGS_H) $(EXPR_H) \
ce1fd7fc 1414 $(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h
405711de 1415regclass.o : regclass.c $(CONFIG_H) system.h $(RTL_H) hard-reg-set.h flags.h \
0a893c29 1416 $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(RECOG_H) reload.h real.h \
769177ac 1417 toplev.h function.h output.h $(GGC_H)
405711de 1418local-alloc.o : local-alloc.c $(CONFIG_H) system.h $(RTL_H) flags.h \
0a893c29 1419 $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
47fc0706 1420 output.h function.h $(INSN_ATTR_H) toplev.h
405711de 1421bitmap.o : bitmap.c $(CONFIG_H) system.h $(RTL_H) flags.h $(BASIC_BLOCK_H) \
d6ff8d83 1422 $(REGS_H)
0a893c29 1423global.o : global.c $(CONFIG_H) system.h $(RTL_H) flags.h reload.h function.h \
d6ff8d83 1424 $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h output.h toplev.h
1425varray.o : varray.c $(CONFIG_H) system.h varray.h $(RTL_H) $(TREE_H) bitmap.h
ae262a47 1426reload.o : reload.c $(CONFIG_H) system.h $(RTL_H) flags.h output.h $(EXPR_H) \
d6ff8d83 1427 reload.h $(RECOG_H) hard-reg-set.h insn-config.h insn-codes.h $(REGS_H) \
0a893c29 1428 function.h real.h toplev.h
ae262a47 1429reload1.o : reload1.c $(CONFIG_H) system.h $(RTL_H) real.h flags.h $(EXPR_H) \
d6ff8d83 1430 reload.h $(REGS_H) hard-reg-set.h insn-config.h insn-flags.h insn-codes.h \
1617c276 1431 $(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h cselib.h
405711de 1432caller-save.o : caller-save.c $(CONFIG_H) system.h $(RTL_H) flags.h \
0a893c29 1433 $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) function.h \
ae262a47 1434 $(RECOG_H) reload.h $(EXPR_H) toplev.h
405711de 1435reorg.o : reorg.c $(CONFIG_H) system.h $(RTL_H) conditions.h hard-reg-set.h \
47fc0706 1436 $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(INSN_ATTR_H) insn-flags.h \
0a893c29 1437 $(RECOG_H) function.h flags.h output.h $(EXPR_H) toplev.h
308704fb 1438alias.o : alias.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h \
080f162d 1439 $(BASIC_BLOCK_H) $(REGS_H) toplev.h output.h $(EXPR_H) insn-flags.h \
1440 $(GGC_H) function.h cselib.h $(TREE_H)
405711de 1441regmove.o : regmove.c $(CONFIG_H) system.h $(RTL_H) insn-config.h \
40988080 1442 $(RECOG_H) output.h $(REGS_H) hard-reg-set.h flags.h function.h \
ae262a47 1443 $(EXPR_H) insn-flags.h $(BASIC_BLOCK_H) toplev.h
5701cb15 1444haifa-sched.o : haifa-sched.c $(CONFIG_H) system.h $(RTL_H) \
0a893c29 1445 $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
47fc0706 1446 $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h
be2828ce 1447final.o : final.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h intl.h \
47fc0706 1448 $(REGS_H) $(RECOG_H) conditions.h insn-config.h $(INSN_ATTR_H) function.h \
0a893c29 1449 real.h output.h hard-reg-set.h insn-flags.h insn-codes.h gstab.h except.h \
1450 xcoffout.h defaults.h toplev.h reload.h dwarfout.h dwarf2out.h sdbout.h \
74b0991d 1451 dbxout.h $(BASIC_BLOCK_H)
f6b12c3a 1452recog.o : recog.c $(CONFIG_H) system.h $(RTL_H) function.h $(BASIC_BLOCK_H) \
47fc0706 1453 $(REGS_H) $(RECOG_H) hard-reg-set.h flags.h insn-config.h $(INSN_ATTR_H) \
aed0bd19 1454 insn-flags.h insn-codes.h real.h toplev.h output.h reload.h
952b0f82 1455reg-stack.o : reg-stack.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) $(RECOG_H) \
0a893c29 1456 $(REGS_H) hard-reg-set.h flags.h insn-config.h insn-flags.h toplev.h \
82575fa7 1457 varray.h function.h
59423b59 1458predict.o: predict.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
1459 insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \
1e53290d 1460 $(RECOG_H) insn-flags.h function.h except.h $(EXPR_H)
769177ac 1461lists.o: lists.c $(CONFIG_H) system.h toplev.h $(RTL_H) $(GGC_H)
a6540cbf 1462bb-reorder.o : bb-reorder.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
1463 insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \
1464 $(RECOG_H) insn-flags.h function.h except.h $(EXPR_H)
6e6e5faa 1465timevar.o : timevar.c $(CONFIG_H) system.h $(TIMEVAR_H) flags.h intl.h
1140e77e 1466regrename.o : regrename.c $(CONFIG_H) system.h $(RTL_H) insn-config.h \
1467 $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h $(RECOG_H) function.h \
1468 resource.h $(OBSTACK_H) flags.h
0bb604ca 1469ifcvt.o : ifcvt.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) \
1470 flags.h insn-config.h function.h $(RECOG_H) $(BASIC_BLOCK_H) $(EXPR_H) \
1471 output.h
e41f0d80 1472dependence.o : dependence.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) \
1473 $(C_COMMON_H) flags.h varray.h $(EXPR_H)
8df93c68 1474
769177ac 1475$(out_object_file): $(out_file) $(CONFIG_H) $(TREE_H) $(GGC_H) \
d6ff8d83 1476 $(RTL_H) $(REGS_H) hard-reg-set.h real.h insn-config.h conditions.h \
47fc0706 1477 insn-flags.h output.h $(INSN_ATTR_H) insn-codes.h system.h toplev.h function.h
f357ac87 1478 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1479 $(out_file) $(OUTPUT_OPTION)
32e6d418 1480
f213fcf9 1481# Build auxiliary files that support ecoff format.
1482mips-tfile: mips-tfile.o version.o $(LIBDEPS)
62268150 1483 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS)
f213fcf9 1484
56fc5f02 1485mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) system.h version.h
f213fcf9 1486
1487mips-tdump: mips-tdump.o version.o $(LIBDEPS)
62268150 1488 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tdump.o version.o $(LIBS)
f213fcf9 1489
47003e2a 1490mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) system.h
f213fcf9 1491
636b182c 1492# Build file to support OSF/rose half-pic format.
1486870d 1493halfpic.o: halfpic.c $(CONFIG_H) $(RTL_H) $(TREE_H) system.h
636b182c 1494
32e6d418 1495# Normally this target is not used; but it is used if you
1496# define ALLOCA=alloca.o. In that case, you must get a suitable alloca.c
1497# from the GNU Emacs distribution.
099377d8 1498alloca.o: $(srcdir)/../libiberty/alloca.c
1499 rm -f alloca.c
1500 $(LN_S) $(srcdir)/../libiberty/alloca.c alloca.c
32e6d418 1501 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ALLOCA_FLAGS) \
345a1501 1502 -c alloca.c
32e6d418 1503 $(ALLOCA_FINISH)
2e9d8ccf 1504#\f
c6221df9 1505# Generate header and source files from the machine description,
32e6d418 1506# and compile them.
1507
1508.PRECIOUS: insn-config.h insn-flags.h insn-codes.h \
1509 insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \
1510 insn-attr.h insn-attrtab.c
1511
1512# The following pair of rules has this effect:
1513# genconfig is run only if the md has changed since genconfig was last run;
1514# but the file insn-config.h is touched only when its contents actually change.
1515
1516# Each of the other insn-* files is handled by a similar pair of rules.
1517
3f69fed5 1518# This causes an anomaly in the results of make -n
997d68fe 1519# because insn-* is older than s-*
3f69fed5 1520# and thus make -n thinks that insn-* will be updated
1521# and force recompilation of things that depend on it.
9ac790c5 1522# We use move-if-change precisely to avoid such recompilation.
3f69fed5 1523# But there is no way to teach make -n that it will be avoided.
1524
32e6d418 1525# Each of the insn-*.[ch] rules has a semicolon at the end,
1526# for otherwise the system Make on SunOS 4.1 never tries
876dc5b0 1527# to recompile insn-*.o. To avoid problems and extra noise from
1528# versions of make which don't like empty commands (nothing after the
1529# trailing `;'), we call true for each.
32e6d418 1530
997d68fe 1531insn-config.h: s-config ; @true
1532s-config : $(md_file) genconfig $(srcdir)/move-if-change
c20b28d5 1533 ./genconfig $(md_file) > tmp-config.h
bbb1c53a 1534 $(SHELL) $(srcdir)/move-if-change tmp-config.h insn-config.h
997d68fe 1535 touch s-config
32e6d418 1536
997d68fe 1537insn-flags.h: s-flags ; @true
1538s-flags : $(md_file) genflags $(srcdir)/move-if-change
c20b28d5 1539 ./genflags $(md_file) > tmp-flags.h
bbb1c53a 1540 $(SHELL) $(srcdir)/move-if-change tmp-flags.h insn-flags.h
997d68fe 1541 touch s-flags
32e6d418 1542
997d68fe 1543insn-codes.h: s-codes ; @true
1544s-codes : $(md_file) gencodes $(srcdir)/move-if-change
c20b28d5 1545 ./gencodes $(md_file) > tmp-codes.h
bbb1c53a 1546 $(SHELL) $(srcdir)/move-if-change tmp-codes.h insn-codes.h
997d68fe 1547 touch s-codes
32e6d418 1548
ae262a47 1549insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) $(EXPR_H) real.h output.h \
952b0f82 1550 insn-config.h insn-flags.h insn-codes.h system.h reload.h $(RECOG_H) \
1551 function.h flags.h hard-reg-set.h resource.h
32e6d418 1552 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c
1553
997d68fe 1554insn-emit.c: s-emit ; @true
1555s-emit : $(md_file) genemit $(srcdir)/move-if-change
c20b28d5 1556 ./genemit $(md_file) > tmp-emit.c
bbb1c53a 1557 $(SHELL) $(srcdir)/move-if-change tmp-emit.c insn-emit.c
997d68fe 1558 touch s-emit
32e6d418 1559
ad87de1e 1560insn-recog.o : insn-recog.c $(CONFIG_H) $(RTL_H) insn-config.h $(RECOG_H) \
5bcc7f1f 1561 real.h output.h flags.h system.h function.h hard-reg-set.h resource.h
32e6d418 1562 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c
1563
997d68fe 1564insn-recog.c: s-recog ; @true
1565s-recog : $(md_file) genrecog $(srcdir)/move-if-change
c20b28d5 1566 ./genrecog $(md_file) > tmp-recog.c
bbb1c53a 1567 $(SHELL) $(srcdir)/move-if-change tmp-recog.c insn-recog.c
997d68fe 1568 touch s-recog
32e6d418 1569
bdb66cef 1570insn-opinit.o : insn-opinit.c $(CONFIG_H) $(RTL_H) insn-codes.h insn-flags.h \
ae262a47 1571 insn-config.h flags.h $(RECOG_H) $(EXPR_H) reload.h system.h
bdb66cef 1572 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-opinit.c
1573
997d68fe 1574insn-opinit.c: s-opinit ; @true
1575s-opinit : $(md_file) genopinit $(srcdir)/move-if-change
c20b28d5 1576 ./genopinit $(md_file) > tmp-opinit.c
bbb1c53a 1577 $(SHELL) $(srcdir)/move-if-change tmp-opinit.c insn-opinit.c
997d68fe 1578 touch s-opinit
bdb66cef 1579
5d07813e 1580insn-extract.o : insn-extract.c $(CONFIG_H) $(RTL_H) system.h toplev.h \
952b0f82 1581 insn-config.h $(RECOG_H)
32e6d418 1582 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-extract.c
1583
997d68fe 1584insn-extract.c: s-extract ; @true
1585s-extract : $(md_file) genextract $(srcdir)/move-if-change
c20b28d5 1586 ./genextract $(md_file) > tmp-extract.c
bbb1c53a 1587 $(SHELL) $(srcdir)/move-if-change tmp-extract.c insn-extract.c
997d68fe 1588 touch s-extract
32e6d418 1589
4063e82c 1590insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) $(REGS_H) output.h real.h \
952b0f82 1591 system.h insn-config.h $(RECOG_H) except.h function.h
32e6d418 1592 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c
1593
997d68fe 1594insn-peep.c: s-peep ; @true
1595s-peep : $(md_file) genpeep $(srcdir)/move-if-change
c20b28d5 1596 ./genpeep $(md_file) > tmp-peep.c
bbb1c53a 1597 $(SHELL) $(srcdir)/move-if-change tmp-peep.c insn-peep.c
997d68fe 1598 touch s-peep
32e6d418 1599
74273693 1600insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(RTL_H) $(REGS_H) real.h \
47fc0706 1601 output.h $(INSN_ATTR_H) insn-config.h system.h toplev.h $(RECOG_H)
32e6d418 1602 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c
1603
997d68fe 1604insn-attr.h: s-attr ; @true
1605s-attr : $(md_file) genattr $(srcdir)/move-if-change
c20b28d5 1606 ./genattr $(md_file) > tmp-attr.h
bbb1c53a 1607 $(SHELL) $(srcdir)/move-if-change tmp-attr.h insn-attr.h
997d68fe 1608 touch s-attr
32e6d418 1609
997d68fe 1610insn-attrtab.c: s-attrtab ; @true
1611s-attrtab : $(md_file) genattrtab $(srcdir)/move-if-change
44981bc7 1612 ./genattrtab $(md_file) > tmp-attrtab.c
bbb1c53a 1613 $(SHELL) $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
997d68fe 1614 touch s-attrtab
32e6d418 1615
769177ac 1616insn-output.o : insn-output.c $(CONFIG_H) $(RTL_H) $(GGC_H) $(REGS_H) real.h \
47fc0706 1617 conditions.h hard-reg-set.h insn-config.h insn-flags.h $(INSN_ATTR_H) \
bde3a957 1618 output.h $(RECOG_H) function.h insn-codes.h system.h toplev.h flags.h
32e6d418 1619 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c
1620
997d68fe 1621insn-output.c: s-output ; @true
1622s-output : $(md_file) genoutput $(srcdir)/move-if-change
c20b28d5 1623 ./genoutput $(md_file) > tmp-output.c
bbb1c53a 1624 $(SHELL) $(srcdir)/move-if-change tmp-output.c insn-output.c
997d68fe 1625 touch s-output
3ad7bb1c 1626
769177ac 1627genrtl.o : genrtl.c $(CONFIG_H) $(RTL_H) system.h $(GGC_H)
997d68fe 1628genrtl.c genrtl.h : s-genrtl
7cc452c1 1629 @true # force gnu make to recheck modification times.
1630
997d68fe 1631s-genrtl: gengenrtl $(srcdir)/move-if-change $(RTL_BASE_H)
7014838c 1632 ./gengenrtl -h >tmp-genrtl.h
bbb1c53a 1633 $(SHELL) $(srcdir)/move-if-change tmp-genrtl.h genrtl.h
7014838c 1634 ./gengenrtl >tmp-genrtl.c
bbb1c53a 1635 $(SHELL) $(srcdir)/move-if-change tmp-genrtl.c genrtl.c
997d68fe 1636 touch s-genrtl
2e9d8ccf 1637#\f
32e6d418 1638# Compile the programs that generate insn-* from the machine description.
1639# They are compiled with $(HOST_CC), and associated libraries,
1640# since they need to run on this machine
1641# even if GCC is being compiled to run on some other machine.
1642
1643# $(CONFIG_H) is omitted from the deps of the gen*.o
c6221df9 1644# because these programs don't really depend on anything
32e6d418 1645# about the target machine. They do depend on config.h itself,
1646# since that describes the host machine.
1647
89e36a04 1648# Pass the md file through cpp if the target requests it.
2c352995 1649$(MD_FILE): $(MD_DEPS)
1650 rm -f $@
c20b28d5 1651 $(MD_CPP) $(MD_CPPFLAGS) $(md_file) | sed 's/^# /; /g' > tmp-$@
c92e16d4 1652 mv tmp-$@ $@
89e36a04 1653
96d905e5 1654gensupport.o: gensupport.c $(RTL_H) $(OBSTACK_H) system.h errors.h gensupport.h
85c33ee1 1655 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gensupport.c
96d905e5 1656
4333d921 1657hashtab.o: $(srcdir)/../libiberty/hashtab.c $(CONFIG_H)
1658 rm -f hashtab.c
1659 $(LN_S) $(srcdir)/../libiberty/hashtab.c hashtab.c
1660 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) hashtab.c
1661
04b58880 1662genconfig : genconfig.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
62268150 1663 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
04b58880 1664 genconfig.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
32e6d418 1665
96d905e5 1666genconfig.o : genconfig.c $(RTL_H) $(build_xm_file) \
1667 system.h errors.h gensupport.h
32e6d418 1668 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genconfig.c
1669
04b58880 1670genflags : genflags.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
62268150 1671 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
04b58880 1672 genflags.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
32e6d418 1673
96d905e5 1674genflags.o : genflags.c $(RTL_H) $(OBSTACK_H) $(build_xm_file) \
1675 system.h errors.h gensupport.h
32e6d418 1676 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genflags.c
1677
04b58880 1678gencodes : gencodes.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
62268150 1679 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
04b58880 1680 gencodes.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
32e6d418 1681
96d905e5 1682gencodes.o : gencodes.c $(RTL_H) $(build_xm_file) \
1683 system.h errors.h gensupport.h
32e6d418 1684 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gencodes.c
1685
04b58880 1686genemit : genemit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
62268150 1687 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
04b58880 1688 genemit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
32e6d418 1689
96d905e5 1690genemit.o : genemit.c $(RTL_H) $(build_xm_file) system.h errors.h gensupport.h
32e6d418 1691 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genemit.c
1692
04b58880 1693genopinit : genopinit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
62268150 1694 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
04b58880 1695 genopinit.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
bdb66cef 1696
96d905e5 1697genopinit.o : genopinit.c $(RTL_H) $(build_xm_file) \
1698 system.h errors.h gensupport.h
bdb66cef 1699 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genopinit.c
1700
04b58880 1701genrecog : genrecog.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
62268150 1702 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
04b58880 1703 genrecog.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
32e6d418 1704
96d905e5 1705genrecog.o : genrecog.c $(RTL_H) $(build_xm_file) \
1706 system.h errors.h gensupport.h
1707 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genrecog.c
04b58880 1708genextract : genextract.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
62268150 1709 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
04b58880 1710 genextract.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
32e6d418 1711
96d905e5 1712genextract.o : genextract.c $(RTL_H) $(build_xm_file) \
1713 system.h insn-config.h errors.h gensupport.h
32e6d418 1714 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genextract.c
1715
04b58880 1716genpeep : genpeep.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
62268150 1717 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
04b58880 1718 genpeep.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
32e6d418 1719
96d905e5 1720genpeep.o : genpeep.c $(RTL_H) $(build_xm_file) system.h errors.h gensupport.h
32e6d418 1721 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genpeep.c
1722
04b58880 1723genattr : genattr.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
62268150 1724 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
04b58880 1725 genattr.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
32e6d418 1726
96d905e5 1727genattr.o : genattr.c $(RTL_H) $(build_xm_file) system.h errors.h gensupport.h
32e6d418 1728 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c
1729
140cb7e4 1730genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
62268150 1731 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
140cb7e4 1732 genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
32e6d418 1733
96d905e5 1734genattrtab.o : genattrtab.c $(RTL_H) $(OBSTACK_H) $(build_xm_file) \
1735 system.h errors.h $(GGC_H) gensupport.h
32e6d418 1736 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c
1737
04b58880 1738genoutput : genoutput.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
62268150 1739 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
04b58880 1740 genoutput.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
32e6d418 1741
96d905e5 1742genoutput.o : genoutput.c $(RTL_H) $(build_xm_file) \
1743 system.h errors.h gensupport.h
32e6d418 1744 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genoutput.c
3ad7bb1c 1745
1746gengenrtl : gengenrtl.o $(HOST_LIBDEPS)
1747 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
1748 gengenrtl.o $(HOST_LIBS)
1749
952b0f82 1750gengenrtl.o : gengenrtl.c $(RTL_BASE_H) system.h real.h
3ad7bb1c 1751 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gengenrtl.c
2e9d8ccf 1752#\f
32e6d418 1753# Compile the libraries to be used by gen*.
1754# If we are not cross-building, gen* use the same .o's that cc1 will use,
1755# and HOST_PREFIX_1 is `foobar', just to ensure these rules don't conflict
1756# with the rules for rtl.o, alloca.o, etc.
b38d33a3 1757$(HOST_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(CONFIG_H) system.h $(RTL_H) \
4333d921 1758 bitmap.h $(GGC_H) toplev.h $(HASHTAB_H)
32e6d418 1759 rm -f $(HOST_PREFIX)rtl.c
e77fd588 1760 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtl.c > $(HOST_PREFIX)rtl.c
32e6d418 1761 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtl.c
1762
f6b12c3a 1763$(HOST_PREFIX_1)print-rtl.o: $(srcdir)/print-rtl.c $(CONFIG_H) \
1764 $(RTL_H) $(BASIC_BLOCK_H) system.h
262d46de 1765 rm -f $(HOST_PREFIX)print-rtl.c
e77fd588 1766 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/print-rtl.c > $(HOST_PREFIX)print-rtl.c
262d46de 1767 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)print-rtl.c
1768
a3426c4c 1769$(HOST_PREFIX_1)bitmap.o: $(srcdir)/bitmap.c $(CONFIG_H) system.h $(RTL_H) \
d6cb6164 1770 flags.h bitmap.h
a3426c4c 1771 rm -f $(HOST_PREFIX)bitmap.c
1772 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/bitmap.c > $(HOST_PREFIX)bitmap.c
1773 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)bitmap.c
1774
b38d33a3 1775$(HOST_PREFIX_1)rtlanal.o: $(srcdir)/rtlanal.c $(CONFIG_H) system.h $(RTL_H)
32e6d418 1776 rm -f $(HOST_PREFIX)rtlanal.c
e77fd588 1777 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/rtlanal.c > $(HOST_PREFIX)rtlanal.c
32e6d418 1778 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)rtlanal.c
1779
099377d8 1780$(HOST_PREFIX_1)alloca.o: $(srcdir)/../libiberty/alloca.c
32e6d418 1781 rm -f $(HOST_PREFIX)alloca.c
099377d8 1782 $(LN_S) $(srcdir)/../libiberty/alloca.c $(HOST_PREFIX)alloca.c
32e6d418 1783 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)alloca.c
1784
b38d33a3 1785$(HOST_PREFIX_1)obstack.o: $(srcdir)/../libiberty/obstack.c $(CONFIG_H)
32e6d418 1786 rm -f $(HOST_PREFIX)obstack.c
7b6bbd12 1787 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/../libiberty/obstack.c > $(HOST_PREFIX)obstack.c
32e6d418 1788 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)obstack.c
1789
44a8856e 1790$(HOST_PREFIX_1)vfprintf.o: $(srcdir)/../libiberty/vfprintf.c
b8a373b2 1791 rm -f $(HOST_PREFIX)vfprintf.c
099377d8 1792 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/../libiberty/vfprintf.c > $(HOST_PREFIX)vfprintf.c
b8a373b2 1793 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)vfprintf.c
1794
1795$(HOST_PREFIX_1)doprint.o: doprint.c
1796 rm -f $(HOST_PREFIX)doprint.c
1797 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/doprint.c > $(HOST_PREFIX)doprint.c
1798 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)doprint.c
1799
32e6d418 1800$(HOST_PREFIX_1)malloc.o: malloc.c
1801 rm -f $(HOST_PREFIX)malloc.c
e77fd588 1802 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/malloc.c > $(HOST_PREFIX)malloc.c
32e6d418 1803 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)malloc.c
1804
04b58880 1805$(HOST_PREFIX_1)errors.o: errors.c
1806 rm -f $(HOST_PREFIX)errors.c
1807 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/errors.c > $(HOST_PREFIX)errors.c
1808 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)errors.c
1809
1810
32e6d418 1811# This satisfies the dependency that we get if you cross-compile a compiler
1812# that does not need to compile alloca, malloc or whatever.
c6221df9 1813$(HOST_PREFIX_1):
32e6d418 1814 touch $(HOST_PREFIX_1)
649d8da6 1815
92d28b1c 1816$(HOST_PREFIX_1)ggc-none.o: ggc-none.c
297db6d7 1817 rm -f $(HOST_PREFIX)ggc-none.c
1818 sed -e 's/config[.]h/hconfig.h/' $(srcdir)/ggc-none.c > $(HOST_PREFIX)ggc-none.c
1819 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(HOST_PREFIX)ggc-none.c
92d28b1c 1820
be2828ce 1821#\f
1822# Remake internationalization support.
1823
1824intl.o: intl.c intl.h gansidecl.h Makefile
1825 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1826 -DLOCALEDIR=\"$(localedir)\" \
345a1501 1827 -c $(srcdir)/intl.c
be2828ce 1828
e7a67646 1829$(top_builddir)/intl/libintl.a: intl.all
be2828ce 1830
1831# Make sure all the headers are there for xgettext to scan.
518796ad 1832$(INTL_TARGETS): $(srcdir)/c-parse.c
be2828ce 1833
98fb2ff8 1834intl.all intl.install intl.uninstall \
be2828ce 1835 intl.mostlyclean intl.clean intl.distclean intl.maintainer-clean:
1836 @for d in $(INTL_SUBDIRS); do \
1837 target=`expr $@ : 'intl.\(.*\)'` && \
1838 echo "(cd $$d && $(MAKE) $$target)" && \
1839 (cd $$d && AWK='$(AWK)' $(MAKE) $(SUBDIR_FLAGS_TO_PASS) $$target); \
6a46fa59 1840 if [ $$? -eq 0 ] ; then true ; else exit 1 ; fi ; \
be2828ce 1841 done
1842
2e9d8ccf 1843#\f
32e6d418 1844# Remake cpp and protoize.
1845
e2d3326d 1846PREPROCESSOR_DEFINES = \
1847 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
1848 -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
1849 -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
1850 -DCROSS_INCLUDE_DIR=\"$(gcc_tooldir)/sys-include\" \
1851 -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\"
32e6d418 1852
69461e0d 1853LIBCPP_OBJS = cpplib.o cpplex.o cppmacro.o cppexp.o cppfiles.o \
79bd622b 1854 cpphash.o cpperror.o cppinit.o cppdefault.o \
f357ac87 1855 mkdeps.o prefix.o version.o mbchar.o
95c4b02a 1856
0b30807c 1857LIBCPP_DEPS = cpplib.h cpphash.h intl.h system.h
a7ccf951 1858
0f221fb7 1859# Most of the other archives built/used by this makefile are for
1860# targets. This one is strictly for the host.
95c4b02a 1861libcpp.a: $(LIBCPP_OBJS)
6d250c05 1862 -rm -rf libcpp.a
396c97db 1863 $(AR) $(AR_FLAGS) libcpp.a $(LIBCPP_OBJS)
1864 if $(RANLIB_TEST) ; then $(RANLIB) libcpp.a ; else true ; fi
95c4b02a 1865
dd6a91ba 1866cpp0$(exeext): cppmain.o intl.o libcpp.a $(LIBDEPS)
1867 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cpp0$(exeext) cppmain.o \
20ed13da 1868 intl.o libcpp.a $(LIBS)
3e4227af 1869
5ecec5da 1870cppmain.o: cppmain.c $(CONFIG_H) cpplib.h intl.h system.h
f03d7bcd 1871
a7ccf951 1872cpperror.o: cpperror.c $(CONFIG_H) $(LIBCPP_DEPS)
0e66aa75 1873cppexp.o: cppexp.c $(CONFIG_H) $(LIBCPP_DEPS) defaults.h
0578f103 1874cpplex.o: cpplex.c $(CONFIG_H) $(LIBCPP_DEPS)
69461e0d 1875cppmacro.o: cppmacro.c $(CONFIG_H) $(LIBCPP_DEPS)
f51c2148 1876cpplib.o: cpplib.c $(CONFIG_H) $(LIBCPP_DEPS) $(OBSTACK_H)
69461e0d 1877cpphash.o: cpphash.c $(CONFIG_H) $(LIBCPP_DEPS) $(OBSTACK_H)
bb96e316 1878cppfiles.o: cppfiles.c $(CONFIG_H) $(LIBCPP_DEPS) $(SPLAY_TREE_H) mkdeps.h
472679ed 1879cppinit.o: cppinit.c $(CONFIG_H) $(LIBCPP_DEPS) cppdefault.h \
1880 mkdeps.h prefix.h output.h version.h
164e0f66 1881
472679ed 1882cppdefault.o: cppdefault.c $(CONFIG_H) system.h cppdefault.h Makefile
3e4227af 1883 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
e2d3326d 1884 $(PREPROCESSOR_DEFINES) \
345a1501 1885 -c $(srcdir)/cppdefault.c
a852e3b1 1886
62adb1fe 1887mkdeps.o: mkdeps.c $(CONFIG_H) system.h mkdeps.h
1888
cdc562c3 1889# The traditional mode preprocessor, a separate program for ease of
1890# maintenance. Some code is shared with the ISO-C cpp.
dd6a91ba 1891tradcpp0$(exeext): tradcpp.o tradcif.o cppdefault.o version.o intl.o $(LIBDEPS)
1892 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o tradcpp0$(exeext) \
cdc562c3 1893 tradcpp.o tradcif.o cppdefault.o version.o intl.o $(LIBS)
1894
abe76378 1895tradcpp.o: tradcpp.c $(CONFIG_H) system.h version.h cppdefault.h tradcpp.h
1896tradcif.o: $(srcdir)/tradcif.c $(CONFIG_H) system.h defaults.h tradcpp.h
cdc562c3 1897
1898$(srcdir)/tradcif.c: $(srcdir)/tradcif.y
f357ac87 1899 (cd $(srcdir) && $(BISON) $(BISONFLAGS) -o tr$$$$.c tradcif.y && \
1900 mv -f tr$$$$.c tradcif.c)
cdc562c3 1901
876dc5b0 1902# Note for the stamp targets, we run the program `true' instead of
1903# having an empty command (nothing following the semicolon).
1904
7f6a6499 1905proto: config.status protoize$(exeext) unprotoize$(exeext) SYSCALLS.c.X
32e6d418 1906
c6221df9 1907PROTO_OBJS = intl.o version.o
be2828ce 1908
1909protoize$(exeext): protoize.o $(PROTO_OBJS) $(LIBDEPS)
1910 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ protoize.o $(PROTO_OBJS) $(LIBS)
ab866dde 1911
be2828ce 1912unprotoize$(exeext): unprotoize.o $(PROTO_OBJS) $(LIBDEPS)
1913 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ unprotoize.o $(PROTO_OBJS) $(LIBS)
ab866dde 1914
eeadfa9d 1915protoize.o: protoize.c $(srcdir)/../include/getopt.h $(CONFIG_H) system.h \
56fc5f02 1916 Makefile version.h
32e6d418 1917 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
e2d3326d 1918 $(DRIVER_DEFINES) $(PREPROCESSOR_DEFINES) \
f357ac87 1919 $(srcdir)/protoize.c $(OUTPUT_OPTION)
122c82ed 1920
eeadfa9d 1921unprotoize.o: unprotoize.c protoize.c $(srcdir)/../include/getopt.h \
56fc5f02 1922 $(CONFIG_H) system.h Makefile version.h
32e6d418 1923 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
e2d3326d 1924 $(DRIVER_DEFINES) $(PREPROCESSOR_DEFINES) \
f357ac87 1925 $(srcdir)/unprotoize.c $(OUTPUT_OPTION)
32e6d418 1926
32e6d418 1927# This info describes the target machine, so compile with GCC just built.
62268150 1928SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES) \
1929 stmp-int-hdrs
f678532a 1930 -rm -f SYSCALLS.c tmp-SYSCALLS.s
2382c341 1931 sed -e s/TARGET_GETGROUPS_T/$(TARGET_GETGROUPS_T)/ \
1932 $(srcdir)/sys-types.h $(srcdir)/sys-protos.h > SYSCALLS.c
32e6d418 1933 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
f678532a 1934 -aux-info $@ -S -o tmp-SYSCALLS.s SYSCALLS.c
1935 -rm -f SYSCALLS.c tmp-SYSCALLS.s
0b20f012 1936
a5889b74 1937
0b20f012 1938test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES)
c548e550 1939 -rm -f tmp-proto.[cso]
262d46de 1940 cp $(srcdir)/protoize.c tmp-proto.c
1941 chmod u+w tmp-proto.c
c548e550 1942 ./protoize -N -B ./ -x getopt.h -c "-B./ -Wall -Wwrite-strings \
e2d3326d 1943 $(GCC_CFLAGS) $(INCLUDES) \
0b20f012 1944 -DGCC_INCLUDE_DIR=0 \
1945 -DGPLUSPLUS_INCLUDE_DIR=0 \
1946 -DCROSS_INCLUDE_DIR=0 \
46073b39 1947 -DTOOL_INCLUDE_DIR=0 \
e2d3326d 1948 -DSTANDARD_EXEC_PREFIX=0 \
1949 -DDEFAULT_TARGET_MACHINE=0 \
1950 -DDEFAULT_TARGET_VERSION=0" tmp-proto.c
1a754c64 1951 @echo '**********' Expect 400 lines of differences.
c548e550 1952 -diff $(srcdir)/protoize.c tmp-proto.c > tmp-proto.diff
1953 -wc -l tmp-proto.diff
1954 ./unprotoize -N -x getopt.h -c "-B./ -Wall -Wwrite-strings \
e2d3326d 1955 $(GCC_CFLAGS) $(INCLUDES) \
0b20f012 1956 -DGCC_INCLUDE_DIR=0 \
1957 -DGPLUSPLUS_INCLUDE_DIR=0 \
1958 -DCROSS_INCLUDE_DIR=0 \
46073b39 1959 -DTOOL_INCLUDE_DIR=0 \
e2d3326d 1960 -DSTANDARD_EXEC_PREFIX=0 \
1961 -DDEFAULT_TARGET_MACHINE=0 \
1962 -DDEFAULT_TARGET_VERSION=0" tmp-proto.c
0b20f012 1963 @echo Expect zero differences.
262d46de 1964 diff $(srcdir)/protoize.c tmp-proto.c | cat
62268150 1965 -rm -f tmp-proto.[cs] tmp-proto$(objext)
2b55270a 1966
be2828ce 1967gcov.o: gcov.c gcov-io.h intl.h system.h
2b55270a 1968
0f11bb5d 1969# Only one of 'gcov' or 'gcov.exe' is actually built, depending
1970# upon whether $(exeext) is empty or not.
be2828ce 1971GCOV_OBJS = gcov.o intl.o
1972gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
1973 $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
2e9d8ccf 1974#\f
2cfd79fe 1975# Build the include directory. The stamp files are stmp-* rather than
997d68fe 1976# s-* so that mostlyclean does not force the include directory to
2cfd79fe 1977# be rebuilt.
1978
d54b81e0 1979# Build the include directory including float.h (which no longer depends upon
690a93ea 1980# enquire).
58113712 1981stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) xlimits.h
2cfd79fe 1982# Copy in the headers provided with gcc.
1983# The sed command gets just the last file name component;
1984# this is necessary because VPATH could add a dirname.
1985# Using basename would be simpler, but some systems don't have it.
220345e0 1986# The touch command is here to workaround an AIX/Linux NFS bug.
dc901594 1987 -if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi
c8763215 1988 for file in .. $(USER_H); do \
1989 if [ X$$file != X.. ]; then \
1990 realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
220345e0 1991 touch include/$$realfile; \
1941d7da 1992 rm -f include/$$realfile; \
1993 cp $$file include; \
1994 chmod a+r include/$$realfile; \
c8763215 1995 fi; \
2cfd79fe 1996 done
b5850e21 1997 rm -f include/limits.h
2cfd79fe 1998 cp xlimits.h include/limits.h
1999 chmod a+r include/limits.h
690a93ea 2000 rm -f include/float.h
19c49761 2001 if [ x$(FLOAT_H) != xMakefile.in ]; then \
2002 cp $(srcdir)/config/$(FLOAT_H) include/float.h && \
0dbd1c74 2003 chmod a+r include/float.h; \
2004 else :; fi
d54b81e0 2005# Install the README
2006 rm -f include/README
2007 cp $(srcdir)/README-fixinc include/README
2008 chmod a+r include/README
2009 touch $@
2010
584727c9 2011# fixinc.sh depends on this, not on specs directly.
2012# The idea is to make sure specs gets built, but not rerun fixinc.sh
2013# after each stage just because specs' mtime has changed.
2014specs.ready: specs
2015 -if [ -f specs.ready ] ; then \
2016 true; \
2017 else \
2018 touch specs.ready; \
2019 fi
2020
2dc7f475 2021FIXINCSRCDIR=$(srcdir)/fixinc
2022fixinc.sh: $(FIXINCSRCDIR)/mkfixinc.sh $(FIXINCSRCDIR)/fixincl.c \
ed8eb9b3 2023 $(FIXINCSRCDIR)/procopen.c $(FIXINCSRCDIR)/gnu-regex.c \
2024 $(FIXINCSRCDIR)/server.c $(FIXINCSRCDIR)/gnu-regex.h \
584727c9 2025 $(FIXINCSRCDIR)/server.h $(FIXINCSRCDIR)/inclhack.def specs.ready
f357ac87 2026 (MAKE="$(MAKE)"; srcdir=`cd $(srcdir)/fixinc && pwd` ; \
3dbb5bd1 2027 CC="$(CC)"; CFLAGS="$(CFLAGS)"; LDFLAGS="$(LDFLAGS)"; \
2028 export MAKE srcdir CC CFLAGS LDFLAGS; \
f357ac87 2029 cd ./fixinc && $(SHELL) $${srcdir}/mkfixinc.sh $(target))
434bb88d 2030
2cfd79fe 2031# Build fixed copies of system files.
434bb88d 2032stmp-fixinc: fixinc.sh gsyslimits.h
2033 rm -rf include; mkdir include
7014838c 2034 -chmod a+rx include
f357ac87 2035 (TARGET_MACHINE=$(target); srcdir=`cd $(srcdir); pwd`; \
f26c984d 2036 INSTALL_ASSERT_H=$(INSTALL_ASSERT_H); SHELL=$(SHELL) ;\
2037 export TARGET_MACHINE srcdir INSTALL_ASSERT_H SHELL ; \
f357ac87 2038 $(SHELL) ./fixinc.sh `pwd`/include $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS); \
2039 rm -f include/syslimits.h; \
b7d4d520 2040 if [ -f include/limits.h ]; then \
2041 mv include/limits.h include/syslimits.h; \
2042 else \
2043 cp $(srcdir)/gsyslimits.h include/syslimits.h; \
f357ac87 2044 fi; \
2045 chmod a+r include/syslimits.h)
d989b259 2046# If $(SYSTEM_HEADER_DIR) is $(tooldir)/sys-include, and
8099945b 2047# that directory exists, then make sure that $(libsubdir) exists.
d989b259 2048# This is because cpp is compiled to find $(tooldir)/include via
8099945b 2049# $(libsubdir)/$(unlibsubdir), which will only work if $(libsubdir)
2050# exists.
d989b259 2051# We deliberately use tooldir instead of gcc_tooldir here. gcc_tooldir
2052# won't work because libsubdir doesn't exist yet.
2053 if [ "$(SYSTEM_HEADER_DIR)" = "$(tooldir)/sys-include" ] \
2054 && [ -d $(tooldir)/sys-include ]; then \
8099945b 2055 if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; fi; \
2056 if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib; fi; \
2057 if [ -d $(libdir)/gcc-lib/$(target_alias) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias) ; fi; \
2058 if [ -d $(libdir)/gcc-lib/$(target_alias)/$(version) ] ; then true ; else mkdir $(libdir)/gcc-lib/$(target_alias)/$(version) ; fi; \
2059 else true; fi
9e74f24f 2060 touch stmp-fixinc
7c4f0e88 2061
a5889b74 2062# Files related to the fixproto script.
58113712 2063# gen-protos and fix-header are compiled with HOST_CC, but they are only
2064# used in native and host-x-target builds, so it's safe to link them with
2065# libiberty.a.
a5889b74 2066
047c2b8b 2067deduced.h: $(GCC_PASSES) $(srcdir)/scan-types.sh stmp-int-hdrs
6ce07cb7 2068 if [ -d $(SYSTEM_HEADER_DIR) ]; \
2069 then \
d23f832c 2070 CC="$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -I. -I$(srcdir) -isystem include -isystem ${SYSTEM_HEADER_DIR}"; \
a5889b74 2071 export CC; \
6ce07cb7 2072 $(SHELL) $(srcdir)/scan-types.sh "$(srcdir)" >tmp-deduced.h; \
2073 mv tmp-deduced.h deduced.h; \
2074 else \
2075 touch deduced.h; \
2076 fi
a5889b74 2077
745272db 2078GEN_PROTOS_OBJS = gen-protos.o scan.o
e65966c3 2079gen-protos: $(GEN_PROTOS_OBJS)
8ac08729 2080 ${HOST_CC} $(HOST_CFLAGS) $(HOST_LDFLAGS) -o gen-protos \
58113712 2081 $(GEN_PROTOS_OBJS) ../libiberty/libiberty.a
a5889b74 2082
745272db 2083gen-protos.o: gen-protos.c scan.h $(build_xm_file) system.h
c68462d9 2084 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/gen-protos.c
2085
1486870d 2086scan.o: scan.c scan.h $(build_xm_file) system.h
c68462d9 2087 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan.c
9541a717 2088
047c2b8b 2089xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos Makefile
2382c341 2090 sed -e s/TARGET_GETGROUPS_T/$(TARGET_GETGROUPS_T)/ \
2091 deduced.h $(srcdir)/sys-protos.h > tmp-fixtmp.c
c92e16d4 2092 mv tmp-fixtmp.c fixtmp.c
2f9d2927 2093 $(GCC_FOR_TARGET) fixtmp.c -w -U__SIZE_TYPE__ -U__PTRDIFF_TYPE__ -U__WCHAR_TYPE__ -E \
6fc3eafd 2094 | sed -e 's/ / /g' -e 's/ *(/ (/g' -e 's/ [ ]*/ /g' -e 's/( )/()/' \
c92e16d4 2095 | ./gen-protos >xsys-protos.hT
2096 mv xsys-protos.hT xsys-protos.h
d7c4552e 2097 rm -rf fixtmp.c
a5889b74 2098
89246c93 2099# This is nominally a 'build' program, but it's run only when host==build,
2100# so we can (indeed, must) use $(LIBDEPS) and $(LIBS).
2101fix-header: fix-header.o scan-decls.o scan.o xsys-protos.h $(LIBDEPS) \
95c4b02a 2102 libcpp.a
62268150 2103 $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ fix-header.o \
89246c93 2104 scan-decls.o scan.o libcpp.a $(LIBS)
a5889b74 2105
8a5b87ad 2106fix-header.o: fix-header.c $(OBSTACK_H) scan.h \
745272db 2107 xsys-protos.h $(build_xm_file) system.h cpplib.h
c68462d9 2108 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/fix-header.c
2109
164e0f66 2110scan-decls.o: scan-decls.c scan.h cpplib.h $(build_xm_file) system.h
c68462d9 2111 $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/scan-decls.c
a5889b74 2112
047c2b8b 2113# stmp-fixproto depends on this, not on fix-header directly.
2114# The idea is to make sure fix-header gets built,
2115# but not rerun fixproto after each stage
2116# just because fix-header's mtime has changed.
2117fixhdr.ready: fix-header
2118 -if [ -f fixhdr.ready ] ; then \
2119 true; \
2120 else \
2121 touch fixhdr.ready; \
2122 fi
2123
58113712 2124# stmp-int-headers is to make sure fixincludes has already finished.
276709eb 2125# The if statement is so that we don't run fixproto a second time
2126# if it has already been run on the files in `include'.
58113712 2127stmp-fixproto: fixhdr.ready fixproto stmp-int-hdrs
6cb9024d 2128 if [ -f include/fixed ] ; then true; \
276709eb 2129 else \
6f1f992e 2130 : This line works around a 'make' bug in BSDI 1.1.; \
ff8281e4 2131 FIXPROTO_DEFINES="$(FIXPROTO_DEFINES)"; export FIXPROTO_DEFINES; \
e555525a 2132 mkinstalldirs="$(SHELL) $(srcdir)/mkinstalldirs"; \
2133 export mkinstalldirs; \
bcc35674 2134 if [ -d $(SYSTEM_HEADER_DIR) ] ; then \
2135 $(SHELL) ${srcdir}/fixproto include include $(SYSTEM_HEADER_DIR); \
6cb9024d 2136 if [ $$? -eq 0 ] ; then true ; else exit 1 ; fi ; \
bcc35674 2137 else true; fi; \
276709eb 2138 touch include/fixed; \
2139 fi
a5889b74 2140 touch stmp-fixproto
2e9d8ccf 2141#\f
32e6d418 2142# Remake the info files.
2143
049ccec1 2144doc: $(BUILD_INFO) gccbug
eb28f243 2145info: cpp.info gcc.info lang.info c-tree.info
32e6d418 2146
17b258fe 2147cpp.info: $(srcdir)/cpp.texi
069f16fd 2148 $(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o cpp.info $(srcdir)/cpp.texi
32e6d418 2149
17b258fe 2150gcc.info: $(srcdir)/gcc.texi $(srcdir)/extend.texi $(srcdir)/install.texi \
2151 $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi \
2152 $(srcdir)/tm.texi $(srcdir)/gcov.texi
069f16fd 2153 $(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o gcc.info $(srcdir)/gcc.texi
630c76ba 2154
eb28f243 2155c-tree.info: $(srcdir)/c-tree.texi
2156 $(MAKEINFO) $(MAKEINFOFLAGS) -I$(srcdir) -o c-tree.info \
2157 $(srcdir)/c-tree.texi
2158
17b258fe 2159dvi: gcc.dvi cpp.dvi lang.dvi
627defc4 2160
64616031 2161# This works with GNU Make's default rule.
17b258fe 2162gcc.dvi: $(srcdir)/gcc.texi $(srcdir)/extend.texi $(srcdir)/install.texi \
2163 $(srcdir)/invoke.texi $(srcdir)/md.texi $(srcdir)/rtl.texi \
2164 $(srcdir)/tm.texi $(srcdir)/gcov.texi
2165 TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex gcc.texi
2166 texindex gcc.??
2167 TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex gcc.texi
2168
2169cpp.dvi: $(srcdir)/cpp.texi
2170 TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex cpp.texi
2171 texindex cpp.??
2172 TEXINPUTS=${texidir}:$(srcdir):$$TEXINPUTS tex cpp.texi
2173
2e9d8ccf 2174#\f
32e6d418 2175# Deletion of files made during compilation.
2176# There are four levels of this:
a8514488 2177# `mostlyclean', `clean', `distclean' and `maintainer-clean'.
32e6d418 2178# `mostlyclean' is useful while working on a particular type of machine.
c6396a0b 2179# It deletes most, but not all, of the files made by compilation.
32e6d418 2180# It does not delete libgcc.a or its parts, so it won't have to be recompiled.
c6396a0b 2181# `clean' deletes everything made by running `make all'.
79f818d0 2182# `distclean' also deletes the files made by config.
a8514488 2183# `maintainer-clean' also deletes everything that could be regenerated
1f42ecdc 2184# automatically, except for `configure'.
2185# We remove as much from the language subdirectories as we can
73027c94 2186# (less duplicated code).
32e6d418 2187
c50e5930 2188INTL_MOSTLYCLEAN = intl.mostlyclean
2189mostlyclean: $(INTL_MOSTLYCLEAN) lang.mostlyclean
32e6d418 2190 -rm -f $(STAGESTUFF)
e9182849 2191 -rm -rf libgcc
32e6d418 2192# Delete the temporary source copies for cross compilation.
2193 -rm -f $(HOST_PREFIX_1)rtl.c $(HOST_PREFIX_1)rtlanal.c
2194 -rm -f $(HOST_PREFIX_1)alloca.c $(HOST_PREFIX_1)malloc.c
c6221df9 2195 -rm -f $(HOST_PREFIX_1)obstack.c
32e6d418 2196# Delete the temp files made in the course of building libgcc.a.
3f9b9702 2197 -rm -f xlimits.h libgcc1-test
32e6d418 2198 for name in $(LIB1FUNCS); do rm -f $${name}.c; done
997d68fe 2199# Delete other built files.
3f9b9702 2200 -rm -f t-float.h-cross xsys-protos.hT
997d68fe 2201# Delete the stamp and temporary files.
2202 -rm -f s-* tmp-* stamp-* stmp-*
73027c94 2203 -rm -f */stamp-* */tmp-*
c6396a0b 2204# Delete debugging dump files.
713a4057 2205 -rm -f *.[0-9][0-9].* */*.[0-9][0-9].*
c6396a0b 2206# Delete some files made during installation.
19c49761 2207 -rm -f specs float.h-* enquire SYSCALLS.c.X SYSCALLS.c
e98401fc 2208 -rm -f collect collect2 mips-tfile mips-tdump alloca.s
a5889b74 2209# Delete files generated for fixproto
15dece2a 2210 -rm -rf fix-header xsys-protos.h deduced.h tmp-deduced.h \
c9c7b9d8 2211 gen-protos fixproto.list fixtmp.* fixhdr.ready
aa694eff 2212# Delete files generated for fixincl
2213 -rm -rf fixincl fixinc.sh specs.ready
d28b3c79 2214 (cd fixinc && $(MAKE) clean)
c6396a0b 2215# Delete unwanted output files from TeX.
2216 -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
73027c94 2217 -rm -f */*.toc */*.log */*.vr */*.fn */*.cp */*.tp */*.ky */*.pg
79f818d0 2218# Delete sorted indices we don't actually use.
2219 -rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns
c6396a0b 2220# Delete core dumps.
73027c94 2221 -rm -f core */core
32e6d418 2222
79f818d0 2223# Delete all files made by compilation
2224# that don't exist in the distribution.
c50e5930 2225INTL_CLEAN = intl.clean
2226clean: mostlyclean $(INTL_CLEAN) lang.clean
f357ac87 2227 -rm -f libgcc.a libgcc_s$(SHLIB_EXT)
25092e2a 2228 -rm -rf libgcc
131b361e 2229 -rm -f *.dvi
73027c94 2230 -rm -f */*.dvi
89e36a04 2231 -if [ -f md.pre-cpp ]; then \
2232 rm -f md ; \
2233 fi
2cfd79fe 2234# Delete the include directory.
997d68fe 2235 -rm -rf include
d73a48cc 2236# Delete files used by the "multilib" facility (including libgcc subdirs).
f1ad3130 2237 -rm -f multilib.h tmpmultilib*
d73a48cc 2238 -if [ "x$(MULTILIB_DIRNAMES)" != x ] ; then \
2239 rm -rf $(MULTILIB_DIRNAMES); \
2240 else if [ "x$(MULTILIB_OPTIONS)" != x ] ; then \
2241 rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \
2242 fi ; fi
119f80e4 2243 -rm -fr stage1 stage2 stage3 stage4
8f8091cf 2244# Delete stamps of bootstrap stages
2245 -rm -f stage_*
2246 -rm -f clean_*
32e6d418 2247
79f818d0 2248# Delete all files that users would normally create
2249# while building and installing GCC.
be2828ce 2250INTL_DISTCLEAN = intl.distclean
2251distclean: clean $(INTL_DISTCLEAN) lang.distclean
7953c610 2252 -rm -f tm.h tm_p.h config.h auto-host.h auto-build.h tconfig.h hconfig.h
764fc592 2253 -rm -f md cstamp-h
1f42ecdc 2254 -rm -f config.status config.run config.cache config.bak
160b6fa9 2255 -rm -f Make-lang Make-hooks Make-host Make-target
c3cc26e1 2256 -rm -f Makefile specs.h options.h gencheck.h *.oaux
58febf9e 2257 -rm -f gthr-default.h
c4ed51d6 2258 -rm -f */stage1 */stage2 */stage3 */stage4 */include
08d7a103 2259 -rm -f c-parse.output
b541ad9d 2260 -rm -f *.asm
ae115421 2261 -rm -f float.h
45e01ea1 2262 -rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak
2263 -rm -f testsuite/{gcc,g++}.{log,sum}
be2828ce 2264 -rm -f intl/libintl.h libintl.h
22ed6b17 2265 -rm -f cxxmain.c splay-tree.c obstack.c
2266 -rm -f mklibgcc libgcc.map gccbug .gdbinit configargs.h
2267 -rm -f c-tree.info c-tree.info-1 c-tree.info-2 c-tree.info-3
2268 -rm -f fixinc/Makefile
2269 -rmdir cp f java objc fixinc intl po 2>/dev/null
c6396a0b 2270
2271# Delete anything likely to be found in the source directory
2272# that shouldn't be in the distribution.
73027c94 2273extraclean: distclean lang.extraclean
bbbdbddd 2274 -rm -rf =* ./"#"* *~* config/=* config/"#"* config/*~*
131b361e 2275 -rm -f patch* *.orig *.rej config/patch* config/*.orig config/*.rej
08d7a103 2276 -rm -f config/*/=* config/*/"#"* config/*/*~*
2277 -rm -f config/*/*.orig config/*/*.rej
300d5cb3 2278 -rm -f *.dvi *.ps *.oaux *.d *.[zZ] *.gz
13da1009 2279 -rm -f *.tar *.xtar *diff *.diff.* *.tar.* *.xtar.* *diffs
08d7a103 2280 -rm -f *lose config/*lose config/*/*lose
997d68fe 2281 -rm -f *.s *.s[0-9] *.i config/ChangeLog
be2828ce 2282 -rm -f y.tab.c yacc.*
73027c94 2283 -rm -f */=* */"#"* */*~*
2284 -rm -f */patch* */*.orig */*.rej
2285 -rm -f */*.dvi */*.oaux */*.d */*.[zZ] */*.gz
2286 -rm -f */*.tar */*.xtar */*diff */*.diff.* */*.tar.* */*.xtar.* */*diffs
2287 -rm -f */*lose */*.s */*.s[0-9] */*.i
32e6d418 2288
1f42ecdc 2289# Get rid of every file that's generated from some other file, except for `configure'.
32e6d418 2290# Most of these files ARE PRESENT in the GCC distribution.
c50e5930 2291# We define INTL_DISTCLEAN, INTL_CLEAN & INTL_MOSTLYCLEAN to be empty in the
2292# submake, so that we don't descend into intl after its makefile has been
2293# removed.
1f42ecdc 2294maintainer-clean:
2295 @echo 'This command is intended for maintainers to use; it'
2296 @echo 'deletes files that may need special tools to rebuild.'
c50e5930 2297 $(MAKE) INTL_DISTCLEAN= INTL_CLEAN= INTL_MOSTLYCLEAN= \
2298 intl.maintainer-clean lang.maintainer-clean distclean
518796ad 2299 -rm -f c-parse.y c-parse.c c-parse.output TAGS
c6396a0b 2300 -rm -f cpp.info* cpp.??s cpp.*aux
2301 -rm -f gcc.info* gcc.??s gcc.*aux
2e9d8ccf 2302#\f
32e6d418 2303# Entry points `install' and `uninstall'.
c6396a0b 2304# Also use `install-collect2' to install collect2 when the config files don't.
32e6d418 2305
3f69fed5 2306# The semicolon is to prevent the install.sh -> install default rule
876dc5b0 2307# from doing anything. Having it run true helps avoid problems and
2308# noise from versions of make which don't like to have null commands.
c2a18965 2309install: $(INSTALL_TARGET) ; @true
32e6d418 2310
2cfd79fe 2311# Copy the compiler files into directories where they will be run.
62268150 2312# Install the driver last so that the window when things are
2313# broken is small.
2289acd7 2314install-normal: install-common $(INSTALL_HEADERS) $(INSTALL_LIBGCC) \
049ccec1 2315 $(INSTALL_CPP) install-man $(INSTALL_INFO) intl.install \
2316 lang.install-normal install-driver
32e6d418 2317
e77fd588 2318# Do nothing while making gcc with a cross-compiler. The person who
2319# makes gcc for the target machine has to know how to put a complete
2320# gcc together by hand.
2321install-build: force
2322 @echo You have to install gcc on your target machine by hand.
2323
32e6d418 2324# Run this on the target machine
2325# to finish installation of cross compiler.
19c49761 2326# This is not used anymore now that float.h does not depend on enquire.
32e6d418 2327install-cross-rest: install-float-h-cross
2328
3e2f90b9 2329# Handle cpp installation.
dd6a91ba 2330install-cpp: cpp$(exeext)
2ff5d8bd 2331 -if [ -f gcc-cross$(exeext) ] ; then \
2332 rm -f $(bindir)/$(CPP_CROSS_NAME)$(exeext); \
dd6a91ba 2333 $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(bindir)/$(CPP_CROSS_NAME)$(exeext); \
2ff5d8bd 2334 if [ x$(cpp_install_dir) != x ]; then \
2335 rm -f $(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \
dd6a91ba 2336 $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \
2ff5d8bd 2337 else true; fi; \
2338 else \
2339 rm -f $(bindir)/$(CPP_INSTALL_NAME)$(exeext); \
dd6a91ba 2340 $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(bindir)/$(CPP_INSTALL_NAME)$(exeext); \
2ff5d8bd 2341 if [ x$(cpp_install_dir) != x ]; then \
2342 rm -f $(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
dd6a91ba 2343 $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
2ff5d8bd 2344 else true; fi; \
2345 fi
3e2f90b9 2346
2347uninstall-cpp:
2ff5d8bd 2348 -rm -f $(bindir)/$(CPP_INSTALL_NAME)$(exeext)
2349 -rm -f $(bindir)/$(CPP_CROSS_NAME)$(exeext)
3e2f90b9 2350 -if [ x$(cpp_install_dir) != x ]; then \
2ff5d8bd 2351 rm -f $(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
2352 rm -f $(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \
3e2f90b9 2353 else true; fi
2354
32e6d418 2355# Install float.h for cross compiler.
2356# Run this on the target machine!
19c49761 2357# This is not used anymore now that float.h does not depend on enquire.
0d5bce1b 2358install-float-h-cross: installdirs
9f10de4b 2359# if [ -f enquire ] ; then true; else false; fi
2360# Note: don't use -. We should fail right away if enquire was not made.
2361 ./enquire -f > $(tmpdir)/float.h
32e6d418 2362 -rm -f $(libsubdir)/include/float.h
f32abccb 2363 $(INSTALL_DATA) $(tmpdir)/float.h $(libsubdir)/include/float.h
2364 -rm -f $(tmpdir)/float.h
32e6d418 2365 chmod a-x $(libsubdir)/include/float.h
2366
0d5bce1b 2367# Create the installation directories.
2368installdirs:
2369 -if [ -d $(prefix) ] ; then true ; else mkdir $(prefix) ; chmod a+rx $(prefix) ; fi
2370 -if [ -d $(exec_prefix) ] ; then true ; else mkdir $(exec_prefix) ; chmod a+rx $(exec_prefix) ; fi
47db7968 2371 -if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; chmod a+rx $(libdir) ; fi
2372 -if [ -d $(libdir)/gcc-lib ] ; then true ; else mkdir $(libdir)/gcc-lib ; chmod a+rx $(libdir)/gcc-lib ; fi
444c3fb0 2373# This dir isn't currently searched by cpp.
47db7968 2374# -if [ -d $(libdir)/gcc-lib/include ] ; then true ; else mkdir $(libdir)/gcc-lib/include ; chmod a+rx $(libdir)/gcc-lib/include ; fi
c6367e90 2375 -fdir= ; for dir in `echo $(libsubdir) | tr '/' ' '`; do \
2376 fdir=$${fdir}/$${dir}; \
2377 if [ -d $${fdir} ] ; then true ; else mkdir $${fdir}; chmod a+rx $${fdir}; fi ; \
2378 done
47db7968 2379 -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; chmod a+rx $(bindir) ; fi
2380 -if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; chmod a+rx $(includedir) ; fi
40cb25f2 2381 -if [ -d $(gcc_tooldir) ] ; then true ; else mkdir $(gcc_tooldir) ; chmod a+rx $(gcc_tooldir) ; fi
47db7968 2382 -if [ -d $(assertdir) ] ; then true ; else mkdir $(assertdir) ; chmod a+rx $(assertdir) ; fi
2383 -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; chmod a+rx $(infodir) ; fi
3cf6a465 2384# We don't use mkdir -p to create the parents of man1dir,
32e6d418 2385# because some systems don't support it.
3cf6a465 2386# Instead, we use this technique to create the immediate parent of man1dir.
2387 -parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
47db7968 2388 if [ -d $$parent ] ; then true ; else mkdir $$parent ; chmod a+rx $$parent ; fi
3cf6a465 2389 -if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; chmod a+rx $(man1dir) ; fi
32e6d418 2390
2391# Install the compiler executables built during cross compilation.
0d5bce1b 2392install-common: native installdirs $(EXTRA_PARTS) lang.install-common
32e6d418 2393 for file in $(COMPILERS); do \
2394 if [ -f $$file ] ; then \
2395 rm -f $(libsubdir)/$$file; \
2396 $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
2397 else true; \
2398 fi; \
2399 done
1a1e7b42 2400 for file in $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2) ..; do \
32e6d418 2401 if [ x"$$file" != x.. ]; then \
2402 rm -f $(libsubdir)/$$file; \
2403 $(INSTALL_PROGRAM) $$file $(libsubdir)/$$file; \
2404 else true; fi; \
2405 done
1a1e7b42 2406 for file in $(EXTRA_PARTS) ..; do \
2407 if [ x"$$file" != x.. ]; then \
2408 rm -f $(libsubdir)/$$file; \
2409 $(INSTALL_DATA) $$file $(libsubdir)/$$file; \
0dbd1c74 2410 chmod a-x $(libsubdir)/$$file; \
1a1e7b42 2411 else true; fi; \
2412 done
8a4b1e01 2413# Don't mess with specs if it doesn't exist yet.
94c53b91 2414 -if [ -f specs ] ; then \
2415 rm -f $(libsubdir)/specs; \
8a4b1e01 2416 $(INSTALL_DATA) specs $(libsubdir)/specs; \
0dbd1c74 2417 chmod a-x $(libsubdir)/specs; \
8a4b1e01 2418 fi
62268150 2419# Install protoize if it was compiled.
2420 -if [ -f protoize$(exeext) ]; \
2421 then \
fc56a674 2422 if [ -f gcc-cross$(exeext) ] ; then \
2423 rm -f $(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext); \
2424 $(INSTALL_PROGRAM) protoize$(exeext) $(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext); \
2425 rm -f $(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext); \
2426 $(INSTALL_PROGRAM) unprotoize$(exeext) $(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext); \
2427 else \
2428 rm -f $(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \
2429 $(INSTALL_PROGRAM) protoize$(exeext) $(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \
2430 rm -f $(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \
2431 $(INSTALL_PROGRAM) unprotoize$(exeext) $(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \
2432 fi ; \
62268150 2433 rm -f $(libsubdir)/SYSCALLS.c.X; \
2434 $(INSTALL_DATA) SYSCALLS.c.X $(libsubdir)/SYSCALLS.c.X; \
2435 chmod a-x $(libsubdir)/SYSCALLS.c.X; \
2436 fi
dd6a91ba 2437 -rm -f $(libsubdir)/cpp0$(exeext)
2438 $(INSTALL_PROGRAM) cpp0$(exeext) $(libsubdir)/cpp0$(exeext)
2439 -rm -f $(libsubdir)/tradcpp0$(exeext)
2440 $(INSTALL_PROGRAM) tradcpp0$(exeext) $(libsubdir)/tradcpp0$(exeext)
e2a2be99 2441# Install gcov if it was compiled.
2b55270a 2442 -if [ -f gcov$(exeext) ]; \
2443 then \
2444 rm -f $(bindir)/gcov$(exeext); \
5ef852e5 2445 $(INSTALL_PROGRAM) gcov$(exeext) $(bindir)/$(GCOV_INSTALL_NAME)$(exeext); \
2b55270a 2446 fi
86220f45 2447 $(INSTALL_PROGRAM) gccbug $(bindir)/$(GCCBUG_INSTALL_NAME)
62268150 2448
67cb4bc1 2449# Install the driver program as $(target_alias)-gcc
40cb25f2 2450# and also as either gcc (if native) or $(gcc_tooldir)/bin/gcc.
7f6a6499 2451install-driver: xgcc$(exeext)
f403cbcb 2452 -if [ -f gcc-cross$(exeext) ] ; then \
2453 rm -f $(bindir)/$(GCC_CROSS_NAME)$(exeext); \
12d8e722 2454 $(INSTALL_PROGRAM) gcc-cross$(exeext) $(bindir)/$(GCC_CROSS_NAME)$(exeext); \
40cb25f2 2455 if [ -d $(gcc_tooldir)/bin/. ] ; then \
2456 rm -f $(gcc_tooldir)/bin/gcc$(exeext); \
2457 $(INSTALL_PROGRAM) gcc-cross$(exeext) $(gcc_tooldir)/bin/gcc$(exeext); \
32e6d418 2458 else true; fi; \
2459 else \
f403cbcb 2460 rm -f $(bindir)/$(GCC_INSTALL_NAME)$(exeext); \
2461 $(INSTALL_PROGRAM) xgcc$(exeext) $(bindir)/$(GCC_INSTALL_NAME)$(exeext); \
67cb4bc1 2462 rm -f $(bindir)/$(target_alias)-gcc-1$(exeext); \
ea4a6c81 2463 $(LN) $(bindir)/$(GCC_INSTALL_NAME)$(exeext) $(bindir)/$(target_alias)-gcc-1$(exeext); \
67cb4bc1 2464 mv $(bindir)/$(target_alias)-gcc-1$(exeext) $(bindir)/$(target_alias)-gcc$(exeext); \
32e6d418 2465 fi
32e6d418 2466
a2aa0fc1 2467# Install the info files.
dff6b323 2468# $(INSTALL_DATA) might be a relative pathname, so we can't cd into srcdir
509d95a7 2469# to do the install.
0d5bce1b 2470install-info: doc installdirs lang.install-info
a2aa0fc1 2471 -rm -f $(infodir)/cpp.info* $(infodir)/gcc.info*
17b258fe 2472 for f in cpp.info* gcc.info*; do \
509d95a7 2473 $(INSTALL_DATA) $$f $(infodir)/$$f; \
dff6b323 2474 done
509d95a7 2475 -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
530e88cf 2476 if [ -f $(infodir)/dir ] ; then \
89980492 2477 for f in cpp.info gcc.info; do \
509d95a7 2478 install-info --dir-file=$(infodir)/dir $(infodir)/$$f; \
89980492 2479 done; \
530e88cf 2480 else true; fi; \
89980492 2481 else true; fi;
a2aa0fc1 2482 -chmod a-x $(infodir)/cpp.info* $(infodir)/gcc.info*
2483
32e6d418 2484# Install the man pages.
0b30807c 2485install-man: installdirs $(srcdir)/gcc.1 $(srcdir)/cpp.1 lang.install-man
0dbd1c74 2486 -if [ -f gcc-cross$(exeext) ] ; then \
3cf6a465 2487 rm -f $(man1dir)/$(GCC_CROSS_NAME)$(manext); \
2488 $(INSTALL_DATA) $(srcdir)/gcc.1 $(man1dir)/$(GCC_CROSS_NAME)$(manext); \
2489 chmod a-x $(man1dir)/$(GCC_CROSS_NAME)$(manext); \
b541ad9d 2490 else \
3cf6a465 2491 rm -f $(man1dir)/$(GCC_INSTALL_NAME)$(manext); \
2492 $(INSTALL_DATA) $(srcdir)/gcc.1 $(man1dir)/$(GCC_INSTALL_NAME)$(manext); \
2493 chmod a-x $(man1dir)/$(GCC_INSTALL_NAME)$(manext); \
b541ad9d 2494 fi
0b30807c 2495 -rm -f $(man1dir)/cpp$(manext)
2496 -$(INSTALL_DATA) $(srcdir)/cpp.1 $(man1dir)/cpp$(manext)
2497 -chmod a-x $(man1dir)/cpp$(manext)
32e6d418 2498
2499# Install the library.
0d5bce1b 2500install-libgcc: libgcc.a installdirs
32e6d418 2501 -if [ -f libgcc.a ] ; then \
2502 rm -f $(libsubdir)/libgcc.a; \
2503 $(INSTALL_DATA) libgcc.a $(libsubdir)/libgcc.a; \
396c97db 2504 if $(RANLIB_TEST_FOR_TARGET) ; then \
2505 (cd $(libsubdir); $(RANLIB_FOR_TARGET) libgcc.a); else true; fi; \
32e6d418 2506 chmod a-x $(libsubdir)/libgcc.a; \
2507 else true; fi
2508
f1ad3130 2509# Install multiple versions of libgcc.a.
0d5bce1b 2510install-multilib: stmp-multilib installdirs
f1ad3130 2511 for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
2512 dir=`echo $$i | sed -e 's/;.*$$//'`; \
7014838c 2513 if [ -d $(libsubdir)/$${dir} ]; then true; else mkdir $(libsubdir)/$${dir}; chmod a+rx $(libsubdir)/$${dir}; fi; \
cdc96909 2514 for f in libgcc.a $(EXTRA_MULTILIB_PARTS); do \
2515 rm -f $(libsubdir)/$${dir}/$${f}; \
2516 $(INSTALL_DATA) $${dir}/$${f} $(libsubdir)/$${dir}/$${f}; \
2517 done; \
396c97db 2518 if $(RANLIB_TEST_FOR_TARGET); then \
2519 (cd $(libsubdir)/$${dir}; $(RANLIB_FOR_TARGET) libgcc.a); \
2520 else true; fi; \
f1ad3130 2521 chmod a-x $(libsubdir)/$${dir}/libgcc.a; \
2522 done
2523
2cfd79fe 2524# Install all the header files built in the include subdirectory.
c8763215 2525install-headers: install-include-dir $(INSTALL_HEADERS_DIR) $(INSTALL_ASSERT_H)
2cfd79fe 2526# Fix symlinks to absolute paths in the installed include directory to
2527# point to the installed directory, not the build directory.
ea4a6c81 2528# Don't need to use LN_S here since we really do need ln -s and no substitutes.
2cfd79fe 2529 -files=`cd $(libsubdir)/include; find . -type l -print 2>/dev/null`; \
2530 if [ $$? -eq 0 ]; then \
2531 dir=`cd include; pwd`; \
2532 for i in $$files; do \
2533 dest=`ls -ld $(libsubdir)/include/$$i | sed -n 's/.*-> //p'`; \
2534 if expr "$$dest" : "$$dir.*" > /dev/null; then \
2535 rm -f $(libsubdir)/include/$$i; \
5822e312 2536 ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(libsubdir)/include/$$i; \
2cfd79fe 2537 fi; \
2538 done; \
2539 fi
32e6d418 2540
2cfd79fe 2541# Create or recreate the gcc private include file directory.
0d5bce1b 2542install-include-dir: installdirs
2cfd79fe 2543 -rm -rf $(libsubdir)/include
2544 mkdir $(libsubdir)/include
2545 -chmod a+rx $(libsubdir)/include
2546
2547# Install the include directory using tar.
58113712 2548install-headers-tar: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir
aa2760ef 2549# We use `pwd`/include instead of just include to problems with CDPATH
2550# Unless a full pathname is provided, some shells would print the new CWD,
2551# found in CDPATH, corrupting the output. We could just redirect the
2552# output of `cd', but some shells lose on redirection within `()'s
2553 (cd `pwd`/include ; \
39fd4ce1 2554 tar -cf - .; exit 0) | (cd $(libsubdir)/include; tar xpf - )
16db1e2d 2555# /bin/sh on some systems returns the status of the first tar,
2556# and that can lose with GNU tar which always writes a full block.
2557# So use `exit 0' to ignore its exit status.
2cfd79fe 2558
2559# Install the include directory using cpio.
58113712 2560install-headers-cpio: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir
aa2760ef 2561# See discussion about the use of `pwd` above
2562 cd `pwd`/include ; \
2563 find . -print | cpio -pdum $(libsubdir)/include
32e6d418 2564
35df828f 2565# Put assert.h where it won't override GNU libc's assert.h.
2566# It goes in a dir that is searched after GNU libc's headers;
2567# thus, the following conditionals are no longer needed.
2568# But it's not worth deleting them now.
2569## Don't replace the assert.h already there if it is not from GCC.
2570## This code would be simpler if it tested for -f ... && ! grep ...
2571## but supposedly the ! operator is missing in sh on some systems.
0d5bce1b 2572install-assert-h: assert.h installdirs
eb5a0caa 2573 if [ -f $(assertdir)/assert.h ]; \
2574 then \
95856242 2575 if grep "__eprintf" $(assertdir)/assert.h >/dev/null; \
a953974c 2576 then \
eb5a0caa 2577 rm -f $(assertdir)/assert.h; \
2578 $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \
04873c54 2579 chmod a-x $(assertdir)/assert.h; \
eb5a0caa 2580 else true; \
2581 fi; \
2ba284c3 2582 else \
db9a0b19 2583 rm -f $(assertdir)/assert.h; \
2584 $(INSTALL_DATA) $(srcdir)/assert.h $(assertdir)/assert.h; \
04873c54 2585 chmod a-x $(assertdir)/assert.h; \
2ba284c3 2586 fi
32e6d418 2587
0c787992 2588# Use this target to install the program `collect2' under the name `collect2'.
0d5bce1b 2589install-collect2: collect2 installdirs
0c787992 2590 $(INSTALL_PROGRAM) collect2$(exeext) $(libsubdir)/collect2$(exeext)
c6396a0b 2591# Install the driver program as $(libsubdir)/gcc for collect2.
f403cbcb 2592 $(INSTALL_PROGRAM) xgcc$(exeext) $(libsubdir)/gcc$(exeext)
c6396a0b 2593
32e6d418 2594# Cancel installation by deleting the installed files.
3e2f90b9 2595uninstall: intl.uninstall lang.uninstall $(UNINSTALL_CPP)
32e6d418 2596 -rm -rf $(libsubdir)
f403cbcb 2597 -rm -rf $(bindir)/$(GCC_INSTALL_NAME)$(exeext)
2598 -rm -rf $(bindir)/$(GCC_CROSS_NAME)$(exeext)
5ef852e5 2599 -rm -rf $(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext)
2600 -rm -rf $(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext)
2601 -rm -rf $(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext)
2602 -rm -rf $(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext)
2603 -rm -rf $(bindir)/$(GCOV_INSTALL_NAME)$(exeext)
3cf6a465 2604 -rm -rf $(man1dir)/$(GCC_INSTALL_NAME)$(manext)
2605 -rm -rf $(man1dir)/$(GCC_CROSS_NAME)$(manext)
0b30807c 2606 -rm -rf $(man1dir)/cpp$(manext)
3cf6a465 2607 -rm -rf $(man1dir)/protoize$(manext)
2608 -rm -rf $(man1dir)/unprotoize$(manext)
9e042f31 2609 -rm -f $(infodir)/cpp.info* $(infodir)/gcc.info*
2e9d8ccf 2610#\f
c6221df9 2611# These targets are for the dejagnu testsuites. The file site.exp
6c08487b 2612# contains global variables that all the testsuites will use.
2613
2614# Set to $(target_alias)/ for cross.
2615target_subdir = @target_subdir@
2616
2617site.exp: ./config.status Makefile
2618 @echo "Making a new config file..."
2619 -@rm -f ./tmp?
2620 @touch site.exp
2621 -@mv site.exp site.bak
2622 @echo "## these variables are automatically generated by make ##" > ./tmp0
2623 @echo "# Do not edit here. If you wish to override these values" >> ./tmp0
2624 @echo "# add them to the last section" >> ./tmp0
2625 @echo "set rootme \"`pwd`\"" >> ./tmp0
2626 @echo "set srcdir \"`cd ${srcdir}; pwd`\"" >> ./tmp0
2627 @echo "set host_triplet $(host_canonical)" >> ./tmp0
2628 @echo "set build_triplet $(build_canonical)" >> ./tmp0
2629 @echo "set target_triplet $(target)" >> ./tmp0
2630 @echo "set target_alias $(target_alias)" >> ./tmp0
2631# CFLAGS is set even though it's empty to show we reserve the right to set it.
2632 @echo "set CFLAGS \"\"" >> ./tmp0
2633 @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
a451a37b 2634 @echo "set HAVE_LIBSTDCXX_V3 @HAVE_LIBSTDCXX_V3@" >> ./tmp0
6c08487b 2635# If newlib has been configured, we need to pass -B to gcc so it can find
2636# newlib's crt0.o if it exists. This will cause a "path prefix not used"
2637# message if it doesn't, but the testsuite is supposed to ignore the message -
2638# it's too difficult to tell when to and when not to pass -B (not all targets
2639# have crt0's). We could only add the -B if ../newlib/crt0.o exists, but that
2640# seems like too selective a test.
2641# ??? Another way to solve this might be to rely on linker scripts. Then
2642# theoretically the -B won't be needed.
2643# We also need to pass -L ../ld so that the linker can find ldscripts.
2644 @if [ -d $(objdir)/../$(target_subdir)newlib ] ; then \
2645 echo "set newlib_cflags \"-I$(objdir)/../$(target_subdir)newlib/targ-include -I\$$srcdir/../newlib/libc/include\"" >> ./tmp0; \
2646 echo "set newlib_ldflags \"-B$(objdir)/../$(target_subdir)newlib/\"" >> ./tmp0; \
2647 echo "append CFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \
2648 echo "append CXXFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \
2649 echo "append LDFLAGS \" \$$newlib_ldflags\"" >> ./tmp0; \
2650 else true; \
2651 fi
2652 @if [ -d $(objdir)/../ld ] ; then \
2653 echo "append LDFLAGS \" -L$(objdir)/../ld\"" >> ./tmp0; \
2654 else true; \
2655 fi
16ee23c7 2656 echo "set tmpdir $(objdir)/testsuite" >> ./tmp0
6c08487b 2657 @echo "set srcdir \"\$${srcdir}/testsuite\"" >> ./tmp0
2658 @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
2659 @cat ./tmp0 > site.exp
2660 @cat site.bak | sed \
2661 -e '1,/^## All variables above are.*##/ d' >> site.exp
2662 -@rm -f ./tmp?
2663
ebb99334 2664CHECK_TARGETS = check-gcc check-g++ check-g77 check-objc @CHECK_PO@
6c08487b 2665
2666check: $(CHECK_TARGETS)
2667
20ab2c9c 2668testsuite/site.exp: site.exp
6c08487b 2669 if [ -d testsuite ]; then \
2670 true; \
2671 else \
2672 mkdir testsuite; \
2673 fi
2674 rm -rf testsuite/site.exp
2675 cp site.exp testsuite/site.exp
20ab2c9c 2676
2677check-g++: testsuite/site.exp
f357ac87 2678 -(rootme=`pwd`; export rootme; \
6c08487b 2679 srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
2680 cd testsuite; \
2681 EXPECT=${EXPECT} ; export EXPECT ; \
2682 if [ -f $${rootme}/../expect/expect ] ; then \
57b96326 2683 TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; pwd` ; \
6c08487b 2684 export TCL_LIBRARY ; fi ; \
f357ac87 2685 $(RUNTEST) --tool g++ $(RUNTESTFLAGS))
6c08487b 2686
20ab2c9c 2687check-gcc: testsuite/site.exp
f357ac87 2688 -(rootme=`pwd`; export rootme; \
6c08487b 2689 srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
2690 cd testsuite; \
2691 EXPECT=${EXPECT} ; export EXPECT ; \
2692 if [ -f $${rootme}/../expect/expect ] ; then \
57b96326 2693 TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; pwd` ; \
6c08487b 2694 export TCL_LIBRARY ; fi ; \
f357ac87 2695 $(RUNTEST) --tool gcc $(RUNTESTFLAGS))
6c08487b 2696
4230ead8 2697check-g77: testsuite/site.exp
f357ac87 2698 -(rootme=`pwd`; export rootme; \
4230ead8 2699 srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
2700 cd testsuite; \
2701 EXPECT=${EXPECT} ; export EXPECT ; \
2702 if [ -f $${rootme}/../expect/expect ] ; then \
57b96326 2703 TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; pwd` ; \
4230ead8 2704 export TCL_LIBRARY ; fi ; \
f357ac87 2705 $(RUNTEST) --tool g77 $(RUNTESTFLAGS))
4230ead8 2706
5c872430 2707check-objc: testsuite/site.exp
f357ac87 2708 -(rootme=`pwd`; export rootme; \
5c872430 2709 srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
2710 cd testsuite; \
2711 EXPECT=${EXPECT} ; export EXPECT ; \
2712 if [ -f $${rootme}/../expect/expect ] ; then \
57b96326 2713 TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; pwd` ; \
5c872430 2714 export TCL_LIBRARY ; fi ; \
f357ac87 2715 $(RUNTEST) --tool objc $(RUNTESTFLAGS))
5c872430 2716
ebb99334 2717check-po:
2718 if test -f cp/Makefile && test -f f/Makefile && \
2719 test -f java/Makefile && test -f objc/Makefile; then \
2720 make -C po check-po; \
2721 fi
2722
32e6d418 2723# These exist for maintenance purposes.
2724
2725# Update the tags table.
2726TAGS: force
f357ac87 2727 (cd $(srcdir); \
997d68fe 2728 mkdir tmp-tags; \
0b30807c 2729 mv -f c-parse.[ch] =*.[chy] tmp-tags; \
32e6d418 2730 etags *.y *.h *.c; \
997d68fe 2731 mv tmp-tags/* .; \
f357ac87 2732 rmdir tmp-tags)
32e6d418 2733
fef36666 2734# A list of files to be destroyed during "lean" builds.
0f221fb7 2735VOL_FILES=`echo $(BACKEND) $(OBJS) $(C_OBJS) $(LIBCPP_OBJS) *.c *.h gen*`
fef36666 2736
f357ac87 2737# Flags to pass to stage2 and later recursive makes. Note that the
2738# WARN_CFLAGS setting can't be to the expansion of GCC_WARN_CFLAGS in
2739# the context of the stage_x rule.
2740STAGE2_FLAGS_TO_PASS = \
2741 CFLAGS="$(BOOT_CFLAGS)" \
2742 LDFLAGS="$(BOOT_LDFLAGS)" \
2743 WARN_CFLAGS="\$$(GCC_WARN_CFLAGS)" \
2744 STRICT_WARN="$(STRICT2_WARN)" \
2745 libdir=$(libdir) \
2746 LANGUAGES="$(LANGUAGES)" \
2747 OUTPUT_OPTION="-o \$$@"
2748
41f63c60 2749# Only build the C compiler for stage1, because that is the only one that
2750# we can guarantee will build with the native compiler, and also it is the
2751# only thing useful for building stage2.
8f8091cf 2752stage_a:
89bf85ce 2753 +$(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)"
8f8091cf 2754 touch stage_a
2755
d4edf2cf 2756stage_b: stage_a
32e6d418 2757 $(MAKE) stage1
8f8091cf 2758 touch stage_b
2759
c6396a0b 2760# This used to define ALLOCA as empty, but that would lead to bad results
2761# for a subsequent `make install' since that would not have ALLOCA empty.
2762# To prevent `make install' from compiling alloca.o and then relinking cc1
2763# because alloca.o is newer, we permit these recursive makes to compile
2764# alloca.o. Then cc1 is newer, so it won't have to be relinked.
d4edf2cf 2765stage_c: stage_b
f357ac87 2766 +$(MAKE) CC="stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \
2767 STAGE_PREFIX=stage1/ \
2768 $(STAGE2_FLAGS_TO_PASS)
8f8091cf 2769 touch stage_c
2770
d4edf2cf 2771stage_d: stage_c
8f8091cf 2772 +$(MAKE) stage2
2773 touch stage_d
f357ac87 2774
d4edf2cf 2775stage_e: stage_d
f357ac87 2776 +$(MAKE) CC="stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" \
2777 STAGE_PREFIX=stage2/ \
2778 $(STAGE2_FLAGS_TO_PASS)
8f8091cf 2779 touch stage_e
2780
2781# For bootstrap4:
d4edf2cf 2782stage_f: stage_e
f357ac87 2783 +$(MAKE) CC="stage3/xgcc$(exeext) -B$(build_tooldir)/bin/ -Bstage3/" \
2784 STAGE_PREFIX=stage3/ \
2785 $(STAGE2_FLAGS_TO_PASS)
8f8091cf 2786 touch stage_f
2787
2788# Additional steps for *-lean targets:
0aa01e76 2789clean_s1: stage_b
f357ac87 2790 -(cd stage1 && rm -f $(VOL_FILES))
8f8091cf 2791 touch clean_s1
2792
0aa01e76 2793clean_s2: stage_d
8f8091cf 2794 -rm -rf stage1
8f8091cf 2795 touch clean_s2
2796
2797# This next little bit is the way it is for parallel builds. It's simply
2798# a chain of stages which DO have to be done sequentially.
2799
2800bootstrap_a: stage_a
2801bootstrap_b: bootstrap_a stage_b
2802bootstrap_c: bootstrap_b stage_c
2803bootstrap_d: bootstrap_c stage_d
2804bootstrap_e: bootstrap_d stage_e
2805bootstrap: force bootstrap_e
2806
2807bootstrap-lean_a: stage_a
2808bootstrap-lean_b: bootstrap-lean_a stage_b
2809bootstrap-lean_c: bootstrap-lean_b clean_s1
2810bootstrap-lean_d: bootstrap-lean_c stage_c
2811bootstrap-lean_e: bootstrap-lean_d stage_d
2812bootstrap-lean_f: bootstrap-lean_e clean_s2
2813bootstrap-lean_g: bootstrap-lean_f stage_e
fa7a27b5 2814bootstrap-lean: force bootstrap-lean_g
8f8091cf 2815
2816bootstrap2_c: stage_c
2817bootstrap2_d: bootstrap2_c stage_d
2818bootstrap2_e: bootstrap2_d stage_e
2819bootstrap2: force bootstrap2_e
2820
2821bootstrap2-lean_c: stage_c
2822bootstrap2-lean_d: bootstrap2-lean_c stage_d
2823bootstrap2-lean_e: bootstrap2-lean_d clean_s2
2824bootstrap2-lean_f: bootstrap2-lean_e stage_e
2825bootstrap2-lean: force bootstrap2-lean_f
2826
2827bootstrap3 bootstrap3-lean: force stage_e
2828
2829bootstrap4 bootstrap4-lean: force stage_f
58622ee7 2830
48c6936b 2831# Compare the object files in the current directory with those in the
2832# stage2 directory.
2833
639b13ee 2834# ./ avoids bug in some versions of tail.
d7fba489 2835compare compare3 compare4 compare-lean compare3-lean compare4-lean: force
20becaef 2836 -rm -f .bad_compare
d7fba489 2837 case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
62268150 2838 for file in *$(objext); do \
639b13ee 2839 tail +16c ./$$file > tmp-foo1; \
d7fba489 2840 tail +16c stage$$stage/$$file > tmp-foo2 \
20becaef 2841 && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
48c6936b 2842 done
d7fba489 2843 case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
be2828ce 2844 for dir in tmp-foo intl $(SUBDIRS); do \
62268150 2845 if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
2846 for file in $$dir/*$(objext); do \
73027c94 2847 tail +16c ./$$file > tmp-foo1; \
d7fba489 2848 tail +16c stage$$stage/$$file > tmp-foo2 \
20becaef 2849 && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
9771451c 2850 done; \
3806ffea 2851 else true; fi; \
73027c94 2852 done
48c6936b 2853 -rm -f tmp-foo*
77333ad9 2854 case "$@" in compare | compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
20becaef 2855 if [ -f .bad_compare ]; then \
2856 echo "Bootstrap comparison failure!"; \
2857 cat .bad_compare; \
2858 exit 1; \
d7fba489 2859 else \
2860 case "$@" in \
2861 *-lean ) rm -rf stage$$stage ;; \
05bdc491 2862 *) ;; \
d7fba489 2863 esac; true; \
20becaef 2864 fi
48c6936b 2865
d7fba489 2866# Compare the object files in the current directory with those in the
2867# stage2 directory. Use gnu cmp (diffutils v2.4 or later) to avoid
2868# running tail and the overhead of twice copying each object file.
2869
2870gnucompare gnucompare3 gnucompare4 gnucompare-lean gnucompare3-lean gnucompare4-lean: force
732395de 2871 -rm -f .bad_compare
d7fba489 2872 case "$@" in gnucompare | gnucompare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^gnucompare\([0-9][0-9]*\).*,\1,'` ;; esac; \
732395de 2873 for file in *$(objext); do \
d7fba489 2874 (cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
732395de 2875 done
d7fba489 2876 case "$@" in gnucompare | gnucompare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^gnucompare\([0-9][0-9]*\).*,\1,'` ;; esac; \
be2828ce 2877 for dir in tmp-foo intl $(SUBDIRS); do \
732395de 2878 if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
2879 for file in $$dir/*$(objext); do \
d7fba489 2880 (cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
732395de 2881 done; \
3806ffea 2882 else true; fi; \
732395de 2883 done
77333ad9 2884 case "$@" in gnucompare | gnucompare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^gnucompare\([0-9][0-9]*\).*,\1,'` ;; esac; \
732395de 2885 if [ -f .bad_compare ]; then \
2886 echo "Bootstrap comparison failure!"; \
2887 cat .bad_compare; \
2888 exit 1; \
d7fba489 2889 else \
2890 case "$@" in \
2891 *-lean ) rm -rf stage$$stage ;; \
2892 esac; true; \
732395de 2893 fi
2894
32e6d418 2895# Copy the object files from a particular stage into a subdirectory.
73027c94 2896stage1-start:
c6396a0b 2897 -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
9acd2dad 2898 $(MAKE) -f libgcc.mk libgcc-stage-start stage=stage1
2899 -for dir in intl $(SUBDIRS) ; \
73027c94 2900 do \
21fde8a9 2901 if [ -d stage1/$$dir ] ; then true ; else mkdir stage1/$$dir ; fi ; \
73027c94 2902 done
32e6d418 2903 -mv $(STAGESTUFF) stage1
be2828ce 2904 -mv intl/*$(objext) stage1/intl
b541ad9d 2905# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
2906# dir will work properly.
ea4a6c81 2907 -if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage1 ; else true ; fi
2908 -if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage1 ; else true ; fi
2909 -if [ -f collect-ld$(exeext) ] ; then $(LN_S) ../collect-ld$(exeext) stage1 ; else true ; fi
32e6d418 2910 -rm -f stage1/libgcc.a
2911 -cp libgcc.a stage1
396c97db 2912 -if $(RANLIB_TEST_FOR_TARGET) ; then \
2913 $(RANLIB_FOR_TARGET) stage1/libgcc.a; \
2914 else true; fi
3efc89f0 2915 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
2916 cp stage1/$${f} . ; \
7561ae90 2917 else true; \
3efc89f0 2918 fi; done
73027c94 2919stage1: force stage1-start lang.stage1
32e6d418 2920
73027c94 2921stage2-start:
c6396a0b 2922 -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
9acd2dad 2923 $(MAKE) -f libgcc.mk libgcc-stage-start stage=stage2
2924 -for dir in intl $(SUBDIRS) ; \
73027c94 2925 do \
21fde8a9 2926 if [ -d stage2/$$dir ] ; then true ; else mkdir stage2/$$dir ; fi ; \
73027c94 2927 done
32e6d418 2928 -mv $(STAGESTUFF) stage2
be2828ce 2929 -mv intl/*$(objext) stage2/intl
b541ad9d 2930# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
2931# dir will work properly.
ea4a6c81 2932 -if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage2 ; else true ; fi
2933 -if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage2 ; else true ; fi
2934 -if [ -f collect-ld ] ; then $(LN_S) ../collect-ld$(exeext) stage2 ; else true ; fi
32e6d418 2935 -rm -f stage2/libgcc.a
2936 -cp libgcc.a stage2
396c97db 2937 -if $(RANLIB_TEST_FOR_TARGET) ; then \
2938 $(RANLIB_FOR_TARGET) stage2/libgcc.a; \
2939 else true; fi
3efc89f0 2940 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
2941 cp stage2/$${f} . ; \
7561ae90 2942 else true; \
3efc89f0 2943 fi; done
73027c94 2944stage2: force stage2-start lang.stage2
32e6d418 2945
73027c94 2946stage3-start:
2388f67d 2947 -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
9acd2dad 2948 $(MAKE) -f libgcc.mk libgcc-stage-start stage=stage3
2949 -for dir in intl $(SUBDIRS) ; \
73027c94 2950 do \
21fde8a9 2951 if [ -d stage3/$$dir ] ; then true ; else mkdir stage3/$$dir ; fi ; \
73027c94 2952 done
32e6d418 2953 -mv $(STAGESTUFF) stage3
be2828ce 2954 -mv intl/*$(objext) stage3/intl
b541ad9d 2955# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
2956# dir will work properly.
ea4a6c81 2957 -if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage3 ; else true ; fi
2958 -if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage3 ; else true ; fi
2959 -if [ -f collect-ld$(exeext) ] ; then $(LN_S) ../collect-ld$(exeext) stage3 ; else true ; fi
32e6d418 2960 -rm -f stage3/libgcc.a
2961 -cp libgcc.a stage3
396c97db 2962 -if $(RANLIB_TEST_FOR_TARGET) ; then \
2963 $(RANLIB_FOR_TARGET) stage3/libgcc.a; \
2964 else true; fi
3efc89f0 2965 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
2966 cp stage3/$${f} . ; \
7561ae90 2967 else true; \
3efc89f0 2968 fi; done
73027c94 2969stage3: force stage3-start lang.stage3
32e6d418 2970
73027c94 2971stage4-start:
2388f67d 2972 -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
9acd2dad 2973 $(MAKE) -f libgcc.mk libgcc-stage-start stage=stage4
2974 -for dir in intl $(SUBDIRS) ; \
73027c94 2975 do \
21fde8a9 2976 if [ -d stage4/$$dir ] ; then true ; else mkdir stage4/$$dir ; fi ; \
73027c94 2977 done
32e6d418 2978 -mv $(STAGESTUFF) stage4
be2828ce 2979 -mv intl/*$(objext) stage4/intl
b541ad9d 2980# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
2981# dir will work properly.
ea4a6c81 2982 -if [ -f as$(exeext) ] ; then $(LN_S) ../as$(exeext) stage4 ; else true ; fi
2983 -if [ -f ld$(exeext) ] ; then $(LN_S) ../ld$(exeext) stage4 ; else true ; fi
2984 -if [ -f collect-ld$(exeext) ] ; then $(LN_S) ../collect-ld$(exeext) stage4 ; else true ; fi
32e6d418 2985 -rm -f stage4/libgcc.a
2986 -cp libgcc.a stage4
396c97db 2987 -if $(RANLIB_TEST_FOR_TARGET) ; then \
2988 $(RANLIB_FOR_TARGET) stage4/libgcc.a; \
2989 else true; fi
3efc89f0 2990 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
2991 cp stage4/$${f} . ; \
7561ae90 2992 else true; \
3efc89f0 2993 fi; done
73027c94 2994stage4: force stage4-start lang.stage4
32e6d418 2995
2996# Copy just the executable files from a particular stage into a subdirectory,
2997# and delete the object files. Use this if you're just verifying a version
2998# that is pretty sure to work, and you are short of disk space.
62268150 2999risky-stage1: stage1
7cc2ce68 3000 -make clean
32e6d418 3001
62268150 3002risky-stage2: stage2
32e6d418 3003 -make clean
3004
62268150 3005risky-stage3: stage3
32e6d418 3006 -make clean
3007
62268150 3008risky-stage4: stage4
32e6d418 3009 -make clean
3010
3011#In GNU Make, ignore whether `stage*' exists.
a8514488 3012.PHONY: stage1 stage2 stage3 stage4 clean maintainer-clean TAGS bootstrap
32e6d418 3013.PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
3014
3015force:
d54b81e0 3016
3017# ---
3018# The enquire rules are still useful for building new float-anything.h.
3019# Special flags for compiling enquire.
3020# We disable optimization to make floating point more reliable.
3021ENQUIRE_CFLAGS = -DNO_MEM -DNO_LONG_DOUBLE_IO -O0
3022ENQUIRE_LDFLAGS = $(LDFLAGS)
3023
3024# Enquire target (This is a variable so that a target can choose not to
3025# build it.)
3026ENQUIRE = enquire
3027
3028# Test to see whether <float.h> exists in the system header files,
3029# and is not derived from GCC.
3030FLOAT_H_TEST = \
3031 [ -f $(SYSTEM_HEADER_DIR)/float.h ] && \
3032 if grep 'ifndef _FLOAT_H___' $(SYSTEM_HEADER_DIR)/float.h >/dev/null; \
3033 then false; \
3034 else :; fi
3035# We pretend to not having a usable <float.h>, hence disable the FLOAT_H_TEST
3036# to ensure, we're emitting a full blown <float.h> ourselves.
3037FLOAT_H_TEST = false
3038
3039# Used to compile enquire with standard cc, but have forgotten why.
3040# Let's try with GCC.
3041enquire: enquire.o $(GCC_PARTS)
3042 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ENQUIRE_LDFLAGS) enquire.o -o $@
3043enquire.o: $(srcdir)/enquire.c $(GCC_PASSES) stmp-int-hdrs
3044 if $(FLOAT_H_TEST); then \
3045 rm -f include/float.h; \
3046 SYS_FLOAT_H_WRAP=1; \
3047 else :; \
3048 SYS_FLOAT_H_WRAP=0; \
3049 fi; \
3050 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(ENQUIRE_CFLAGS) \
3051 -DSYS_FLOAT_H_WRAP=$$SYS_FLOAT_H_WRAP \
3052 -I. -c $(srcdir)/enquire.c
3053
3054# Create float.h source for the native machine.
3055# Make it empty if we can use the system float.h without changes.
3056float.h-nat: enquire
3057 -./enquire -f > tmp-float.h
3058 grep '#define [^_]' tmp-float.h >/dev/null || true > tmp-float.h
3059 mv tmp-float.h float.h-nat
3060
3061# Create a dummy float.h source for a cross-compiler.
3062# ??? This isn't used anymore. Should we create config/float-unkn.h
3063# and make that the default float_format in configure?
3064float.h-cross:
3065 echo "#ifndef __GCC_FLOAT_NOT_NEEDED" > t-float.h-cross
3066 echo "#error float.h values not known for cross-compiler" >> t-float.h-cross
3067 echo "#endif" >> t-float.h-cross
3068 mv t-float.h-cross float.h-cross