]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/Makefile.in
* haifa-sched.c (choose_ready): Initialize index.
[thirdparty/gcc.git] / gcc / Makefile.in
CommitLineData
73458fb7
NN
1# Makefile for GNU Compiler Collection
2# Run 'configure' to generate Makefile from Makefile.in
3
d7068b3d 4# Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
73458fb7 5# 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
79d8453e 6
1322177d 7#This file is part of GCC.
79d8453e 8
1322177d 9#GCC is free software; you can redistribute it and/or modify
79d8453e
RS
10#it under the terms of the GNU General Public License as published by
11#the Free Software Foundation; either version 2, or (at your option)
12#any later version.
13
1322177d 14#GCC is distributed in the hope that it will be useful,
79d8453e
RS
15#but WITHOUT ANY WARRANTY; without even the implied warranty of
16#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17#GNU General Public License for more details.
18
19#You should have received a copy of the GNU General Public License
1322177d 20#along with GCC; see the file COPYING. If not, write to
940d9d63
RK
21#the Free Software Foundation, 59 Temple Place - Suite 330,
22#Boston MA 02111-1307, USA.
79d8453e
RS
23
24# The targets for external use include:
25# all, doc, proto, install, install-cross, install-cross-rest,
f1908d70 26# uninstall, TAGS, mostlyclean, clean, distclean, maintainer-clean,
79d8453e
RS
27# stage1, stage2, stage3, stage4.
28
6c80a645 29# This is the default target.
73458fb7
NN
30# Set by autoconf to "all.internal" for a native build, or
31# "all.cross" to build a cross compiler.
32all: @ALL@
33
34# Depend on this to specify a phony target portably.
35force:
36
37# This tells GNU make version 3 not to export the variables
38# defined in this file into the environment (and thus recursive makes).
39.NOEXPORT:
40# And this tells it not to automatically pass command-line variables
41# to recursive makes.
42MAKEOVERRIDES =
6c80a645 43
2e494f70
RS
44# Suppress smart makes who think they know how to automake Yacc files
45.y.c:
46
73458fb7
NN
47# The only suffixes we want for implicit rules are .c and .o, so clear
48# the list and add them. This speeds up GNU Make, and allows -r to work.
49# For i18n support, we also need .gmo, .po, .pox.
50# This must come before the language makefile fragments to allow them to
51# add suffixes and rules of their own.
52.SUFFIXES:
53.SUFFIXES: .c .o .po .pox .gmo
54
55# -------------------------------
56# Standard autoconf-set variables
57# -------------------------------
58
3c18ea24 59# Directory where sources are, from where we are.
3c18ea24
RK
60VPATH = @srcdir@
61
4665e56c
NN
62build=@build@
63host=@host@
73458fb7 64target=@target@
caa55b1e 65target_noncanonical=@target_noncanonical@
73458fb7
NN
66
67# Sed command to transform gcc to installed name.
68program_transform_name = @program_transform_name@
88e80294 69program_transform_cross_name = @program_transform_name@
73458fb7
NN
70
71# -----------------------------
72# Directories used during build
73# -----------------------------
74
75# Directory where sources are, from where we are.
76srcdir = @srcdir@
490cab72 77
3859c32a 78# These directories contain files that are provided as part of a FSF tarball,
51b9ff45
KC
79# but not provided in CVS. Unless --enable-generated-files-in-srcdir is
80# specified these files will be put in the object directory.
81parsedir = @parsedir@
82docobjdir = @docobjdir@
d790dd9f 83docdir = $(srcdir)/doc
3859c32a 84
73458fb7 85# Top build directory, relative to here.
56694dd9 86top_builddir = ..
73458fb7
NN
87# objdir is set by configure.
88# It's normally the absolute path to the current directory.
89objdir = @objdir@
90
91# --------
92# UNSORTED
93# --------
94
79d8453e
RS
95# Variables that exist for you to override.
96# See below for how to change them for certain systems.
97
013a2ee0 98# List of language subdirectories.
3c18ea24 99SUBDIRS =@subdirs@
013a2ee0 100
79d8453e 101# Selection of languages to be made.
71205e0b 102CONFIG_LANGUAGES = @all_languages@
4977bab6 103LANGUAGES = c gcov$(exeext) gcov-dump$(exeext) $(CONFIG_LANGUAGES)
79d8453e 104
5e31e473 105# Selection of languages to be made during stage1 build.
3c18ea24 106BOOT_LANGUAGES = c @all_boot_languages@
5e31e473 107
4c457b6b 108# Various ways of specifying flags for compilations:
78faa32d
FS
109# CFLAGS is for the user to override to, e.g., do a cross build with -O2.
110# For recursive bootstrap builds CFLAGS is used to pass in STAGE1_CFLAGS
111# or BOOT_CFLAGS
112# STAGE1_CFLAGS is set by configure on some targets or passed from toplevel
113# and sets the CFLAGS passed to stage1 of a bootstrap compilation.
114# BOOT_CFLAGS is the value of CFLAGS to pass to the stage2, stage3 and stage4
115# bootstrap compilations.
b8dad04b
ZW
116# XCFLAGS is used for most compilations but not when using the GCC just built.
117# TCFLAGS is used for compilations with the GCC just built.
b8dad04b
ZW
118XCFLAGS =
119TCFLAGS =
cbec6573
DB
120CFLAGS = -g
121STAGE1_CFLAGS = -g @stage1_cflags@
9541e2e3 122BOOT_CFLAGS = -g -O2
b8dad04b 123
22aa533e
NS
124# Flags to determine code coverage. When coverage is disabled, this will
125# contain the optimization flags, as you normally want code coverage
e61a2eb7 126# without optimization.
22aa533e 127COVERAGE_FLAGS = @coverage_flags@
160e2e4f 128coverageexts = .{gcda,gcno}
22aa533e 129
5b67ad6f
DA
130# The warning flags are separate from BOOT_CFLAGS because people tend to
131# override optimization flags and we'd like them to still have warnings
132# turned on. These flags are also used to pass other stage dependent
133# flags from configure. The user is free to explicitly turn these flags
134# off if they wish.
b8dad04b
ZW
135# LOOSE_WARN are the warning flags to use when compiling something
136# which is only compiled with gcc, such as libgcc and the frontends
137# other than C.
138# STRICT_WARN and STRICT2_WARN are the additional warning flags to
139# apply to the back end and the C front end, which may be compiled
140# with other compilers. This is partially controlled by configure in
141# stage1, as not all versions of gcc understand -Wno-long-long.
204250d2 142LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
78e68f88
GDR
143STRICT_WARN = @strict1_warn@
144STRICT2_WARN = -pedantic -Wno-long-long @WERROR@
b8dad04b 145
204250d2
RH
146# This is set by --enable-checking. The idea is to catch forgotten
147# "extern" tags in header files.
148NOCOMMON_FLAG = @nocommon_flag@
149
414d23ae
HPN
150# These are set by --enable-checking=valgrind.
151RUN_GEN = @valgrind_command@
152VALGRIND_DRIVER_DEFINES = @valgrind_path_defines@
153
b8dad04b
ZW
154# This is how we control whether or not the additional warnings are applied.
155.-warn = $(STRICT_WARN)
31260fb8 156GCC_WARN_CFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $($@-warn)
dd859b8a
KG
157
158# These files are to have -Werror bypassed in stage2:
dd859b8a 159# These are very hard to completely clean due to target complexities.
dd859b8a
KG
160gcc.o-warn = -Wno-error
161insn-conditions.o-warn = -Wno-error
dd859b8a
KG
162# Bison-1.75 output often yields (harmless) -Wtraditional warnings
163gengtype-yacc.o-warn = -Wno-error
164c-parse.o-warn = -Wno-error
87f85ea0
ZW
165# flex output may yield harmless "no previous prototype" warnings
166gengtype-lex.o-warn = -Wno-error
b8dad04b
ZW
167
168# All warnings have to be shut off in stage1 if the compiler used then
169# isn't gcc; configure determines that. WARN_CFLAGS will be either
170# $(GCC_WARN_CFLAGS), or nothing.
171WARN_CFLAGS = @warn_cflags@
172
79d8453e
RS
173# These exists to be overridden by the x-* and t-* files, respectively.
174X_CFLAGS =
175T_CFLAGS =
176
177X_CPPFLAGS =
178T_CPPFLAGS =
179
7d600178 180ADAC = @ADAC@
ab87f8c8 181AWK = @AWK@
b614ee64 182CC = @CC@
1e608388 183BISON = @BISON@
0777e4c6 184BISONFLAGS =
1e608388
ZW
185FLEX = @FLEX@
186FLEXFLAGS =
79d8453e 187AR = ar
79d8453e 188AR_FLAGS = rc
6822468a 189RANLIB = @RANLIB@
73458fb7
NN
190
191# -------------------------------------------
192# Programs which operate on the build machine
193# -------------------------------------------
194
b41e09a7 195SHELL = @SHELL@
1e6347d8
RO
196# pwd command to use. Allow user to override default by setting PWDCMD in
197# the environment to account for automounters. The make variable must not
198# be called PWDCMD, otherwise the value set here is passed to make
199# subprocesses and overrides the setting from the user's environment.
8c90b13a
L
200# Don't use PWD since it is a common shell environment variable and we
201# don't want to corrupt it.
202PWD_COMMAND = $${PWDCMD-pwd}
79d8453e 203# on sysV, define this as cp.
3c18ea24 204INSTALL = @INSTALL@
ac64120e
JW
205# Some systems may be missing symbolic links, regular links, or both.
206# Allow configure to check this and use "ln -s", "ln", or "cp" as appropriate.
207LN=@LN@
208LN_S=@LN_S@
79d8453e 209# These permit overriding just for certain files.
fca9d4b0
MH
210INSTALL_PROGRAM = @INSTALL_PROGRAM@
211INSTALL_DATA = @INSTALL_DATA@
7c1e8336 212INSTALL_SCRIPT = @INSTALL@
09fa0705 213MAKEINFO = @MAKEINFO@
3ef4c269 214MAKEINFOFLAGS =
d8984b6e 215TEXI2DVI = texi2dvi
fd939e46 216TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl
77bd67cb 217POD2MAN = pod2man --center="GNU" --release="gcc-$(version)"
5262d6b6 218# Some versions of `touch' (such as the version on Solaris 2.8)
d9835ae8 219# do not correctly set the timestamp due to buggy versions of `utime'
5262d6b6 220# in the kernel. So, we use `echo' instead.
d9835ae8
MM
221STAMP = echo timestamp >
222
73458fb7
NN
223# Make sure the $(MAKE) variable is defined.
224@SET_MAKE@
7f5cc0f3 225REMAKEFLAGS=LANGUAGES="$(LANGUAGES)" BOOT_CFLAGS="$(BOOT_CFLAGS)"
73458fb7
NN
226
227# --------
228# UNSORTED
229# --------
230
231# Some compilers can't handle cc -c blah.c -o foo/blah.o.
232# In stage2 and beyond, we force this to "-o $@" since we know we're using gcc.
233OUTPUT_OPTION = @OUTPUT_OPTION@
234
b8dad04b
ZW
235# This is where we get zlib from. zlibdir is -L../zlib and zlibinc is
236# -I../zlib, unless we were configured with --with-system-zlib, in which
237# case both are empty.
238ZLIB = @zlibdir@ -lz
239ZLIBINC = @zlibinc@
79d8453e 240
e256b8b6
DA
241# Substitution type for target's getgroups 2nd arg.
242TARGET_GETGROUPS_T = @TARGET_GETGROUPS_T@
243
ba1811f1 244# Target to use when installing include directory. Either
ff3aaf17 245# install-headers-tar, install-headers-cpio or install-headers-cp.
3c18ea24 246INSTALL_HEADERS_DIR = @build_install_headers_dir@
ba1811f1 247
d7371761
RK
248# Header files that are made available under the same name
249# to programs compiled with GCC.
d57a4b98
RH
250USER_H = $(srcdir)/ginclude/float.h \
251 $(srcdir)/ginclude/iso646.h \
252 $(srcdir)/ginclude/stdarg.h \
253 $(srcdir)/ginclude/stdbool.h \
254 $(srcdir)/ginclude/stddef.h \
255 $(srcdir)/ginclude/varargs.h \
336d0d96 256 $(srcdir)/unwind.h \
d57a4b98 257 $(EXTRA_HEADERS)
d7371761 258
39cef914 259# The GCC to use for compiling libgcc.a and crt*.o.
bf428f48 260# Usually the one we just built.
79d8453e 261# Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
4977bab6 262GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include -L$(objdir)/../ld
79d8453e
RS
263
264# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
265# It omits XCFLAGS, and specifies -B./.
3c9a2b55 266# It also specifies -isystem ./include to find, e.g., stddef.h.
b8dad04b 267GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(LOOSE_WARN) -isystem ./include $(TCFLAGS)
79d8453e 268
73458fb7
NN
269# ---------------------------------------------------
270# Programs which produce files for the target machine
271# ---------------------------------------------------
7e717196
JL
272
273AR_FOR_TARGET = ` \
274 if [ -f $(objdir)/../binutils/ar ] ; then \
275 echo $(objdir)/../binutils/ar ; \
276 else \
4665e56c 277 if [ "$(host)" = "$(target)" ] ; then \
7e717196
JL
278 echo ar; \
279 else \
35f86a50 280 t='$(program_transform_cross_name)'; echo ar | sed -e $$t ; \
7e717196
JL
281 fi; \
282 fi`
5262d6b6 283AR_FLAGS_FOR_TARGET =
7bde2862
GK
284AR_CREATE_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) rc
285AR_EXTRACT_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) x
7e717196
JL
286RANLIB_FOR_TARGET = ` \
287 if [ -f $(objdir)/../binutils/ranlib ] ; then \
288 echo $(objdir)/../binutils/ranlib ; \
289 else \
4665e56c 290 if [ "$(host)" = "$(target)" ] ; then \
6dd05d08 291 echo $(RANLIB); \
7e717196 292 else \
35f86a50 293 t='$(program_transform_cross_name)'; echo ranlib | sed -e $$t ; \
7e717196
JL
294 fi; \
295 fi`
83dad10c 296NM_FOR_TARGET = ` \
d08d4a19
AO
297 if [ -f ./nm ] ; then \
298 echo ./nm ; \
299 elif [ -f $(objdir)/../binutils/nm-new ] ; then \
300 echo $(objdir)/../binutils/nm-new ; \
83dad10c 301 else \
4665e56c 302 if [ "$(host)" = "$(target)" ] ; then \
83dad10c
RH
303 echo nm; \
304 else \
305 t='$(program_transform_cross_name)'; echo nm | sed -e $$t ; \
306 fi; \
307 fi`
7e717196 308
73458fb7
NN
309# --------
310# UNSORTED
311# --------
312
4e872036
AS
313# Where to find some libiberty headers.
314HASHTAB_H = $(srcdir)/../include/hashtab.h
315OBSTACK_H = $(srcdir)/../include/obstack.h
5193cc6d 316SPLAY_TREE_H= $(srcdir)/../include/splay-tree.h
2a6f0eca 317FIBHEAP_H = $(srcdir)/../include/fibheap.h
56f15830 318PARTITION_H = $(srcdir)/../include/partition.h
4e872036 319
a078a589
ZW
320# Default native SYSTEM_HEADER_DIR, to be overridden by targets.
321NATIVE_SYSTEM_HEADER_DIR = /usr/include
512b62fb 322# Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
4977bab6 323CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
512b62fb 324
a078a589
ZW
325# autoconf sets SYSTEM_HEADER_DIR to one of the above.
326SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@
327
f95e46b9 328# Control whether to run fixproto and fixincludes.
0df47f66
AS
329STMP_FIXPROTO = @STMP_FIXPROTO@
330STMP_FIXINC = @STMP_FIXINC@
ac1284f9 331
40dc28fc
ILT
332# Test to see whether <limits.h> exists in the system header files.
333LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
334
4977bab6
ZW
335# Directory for prefix to system directories, for
336# each of $(system_prefix)/usr/include, $(system_prefix)/usr/lib, etc.
337TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
338
2ed26f6b
ZW
339xmake_file=@xmake_file@
340tmake_file=@tmake_file@
3c18ea24
RK
341out_file=$(srcdir)/config/@out_file@
342out_object_file=@out_object_file@
343md_file=$(srcdir)/config/@md_file@
4977bab6 344tm_file_list=@tm_file_list@
e22340b0 345tm_include_list=@tm_include_list@
d5355cb2 346tm_defines=@tm_defines@
11642c3a 347tm_p_file_list=@tm_p_file_list@
e22340b0 348tm_p_include_list=@tm_p_include_list@
11642c3a 349build_xm_file_list=@build_xm_file_list@
e22340b0 350build_xm_include_list=@build_xm_include_list@
11642c3a
ZW
351build_xm_defines=@build_xm_defines@
352host_xm_file_list=@host_xm_file_list@
e22340b0 353host_xm_include_list=@host_xm_include_list@
11642c3a 354host_xm_defines=@host_xm_defines@
e22340b0
ZW
355xm_file_list=@xm_file_list@
356xm_include_list=@xm_include_list@
3d9d2476 357xm_defines=@xm_defines@
d7b42618 358lang_opt_files=@lang_opt_files@ $(srcdir)/c.opt $(srcdir)/common.opt
3c18ea24 359lang_specs_files=@lang_specs_files@
3103b7db 360lang_tree_files=@lang_tree_files@
11642c3a 361target_cpu_default=@target_cpu_default@
f25270fc 362GCC_THREAD_FILE=@thread_file@
d8bb17c8 363OBJC_BOEHM_GC=@objc_boehm_gc@
f24af81b 364GTHREAD_FLAGS=@gthread_flags@
0974c7d7 365extra_modes_file=@extra_modes_file@
476d9098 366host_hook_obj=@out_host_hook_obj@
f1943b77
MH
367# Be prepared for gcc2 merges.
368gcc_version=@gcc_version@
369gcc_version_trigger=@gcc_version_trigger@
370version=$(gcc_version)
4746ee26 371mainversion=`grep version_string $(srcdir)/version.c | sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/'`
79d8453e 372
73458fb7
NN
373# ------------------------
374# Installation directories
375# ------------------------
376
79d8453e
RS
377# Common prefix for installation directories.
378# NOTE: This directory must exist when you start installation.
3c18ea24 379prefix = @prefix@
c844ddda
RS
380# Directory in which to put localized header files. On the systems with
381# gcc as the native cc, `local_prefix' may not be `prefix' which is
382# `/usr'.
0b2fbcb2 383# NOTE: local_prefix *should not* default from prefix.
3c18ea24 384local_prefix = @local_prefix@
2e494f70 385# Directory in which to put host dependent programs and libraries
3c18ea24 386exec_prefix = @exec_prefix@
79d8453e 387# Directory in which to put the executable for the command `gcc'
3c18ea24 388bindir = @bindir@
79d8453e 389# Directory in which to put the directories used by the compiler.
3c18ea24 390libdir = @libdir@
a8ee6e2d
GK
391# Directory in which GCC puts its executables.
392libexecdir = @libexecdir@
73458fb7
NN
393
394# --------
395# UNSORTED
396# --------
397
a8ee6e2d 398# Directory in which the compiler finds libraries etc.
caa55b1e 399libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(version)
a8ee6e2d 400# Directory in which the compiler finds executables
caa55b1e 401libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(version)
91c7bd9b 402# Used to produce a relative $(gcc_tooldir) in gcc.o
1f72bfca 403unlibsubdir = ../../..
d062c304 404# Directory in which to find other cross-compilation tools and headers.
4c112cda 405dollar = @dollar@
d062c304
JL
406# Used in install-cross.
407gcc_tooldir = @gcc_tooldir@
2bbea3a6
RH
408# Used to install the shared libgcc.
409slibdir = @slibdir@
f098ead2 410# Since gcc_tooldir does not exist at build-time, use -B$(build_tooldir)/bin/
caa55b1e 411build_tooldir = $(exec_prefix)/$(target_noncanonical)
e2187d3b
BK
412# Directory in which the compiler finds target-independent g++ includes.
413gcc_gxx_include_dir = @gcc_gxx_include_dir@
49ba557e 414# Directory to search for site-specific includes.
793e9558
PB
415local_includedir = $(local_prefix)/include
416includedir = $(prefix)/include
0b2fbcb2 417# where the info files go
3c18ea24 418infodir = @infodir@
587a4ba6
L
419# Where cpp should go besides $prefix/bin if necessary
420cpp_install_dir = @cpp_install_dir@
ab87f8c8 421# where the locale files go
191bf464 422datadir = @datadir@
ab87f8c8 423localedir = $(datadir)/locale
79d8453e 424# Extension (if any) to put in installed man-page filename.
77bd67cb
JM
425man1ext = .1
426man7ext = .7
173712fb 427objext = .o
6e26218f
ILT
428exeext = @host_exeext@
429build_exeext = @build_exeext@
173712fb 430
79d8453e 431# Directory in which to put man pages.
a76b6b40
MH
432mandir = @mandir@
433man1dir = $(mandir)/man1
77bd67cb 434man7dir = $(mandir)/man7
62c13b81
RS
435# Dir for temp files.
436tmpdir = /tmp
79d8453e 437
ab87f8c8
JL
438# Whether we were configured with NLS.
439USE_NLS = @USE_NLS@
440
441# Internationalization library.
56694dd9
ZW
442LIBINTL = @LIBINTL@
443LIBINTL_DEP = @LIBINTL_DEP@
ab87f8c8 444
62c62a4f
RO
445# Character encoding conversion library.
446LIBICONV = @LIBICONV@
56694dd9 447LIBICONV_DEP = @LIBICONV_DEP@
62c62a4f 448
0a25f1f5 449# The GC method to be used on this system.
81bf3d9e 450GGC=@GGC@.o
0a25f1f5
RH
451
452# If a supplementary library is being used for the GC.
453GGC_LIB=
454
7857f134
ZW
455# libgcc.a may be built directly or via stmp-multilib,
456# and installed likewise. Overridden by t-fragment.
b583eed8 457LIBGCC = libgcc.a
b583eed8
DE
458INSTALL_LIBGCC = install-libgcc
459
79d8453e 460# Options to use when compiling libgcc2.a.
7337c67f 461#
2a4ea326 462LIBGCC2_DEBUG_CFLAGS = -g
4c457b6b 463LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED @inhibit_libc@
56f9206d
ILT
464
465# Additional options to use when compiling libgcc2.a.
3c9a2b55 466# Some targets override this to -isystem include
56f9206d
ILT
467LIBGCC2_INCLUDES =
468
7bb7f3df 469# Additional target-dependent options for compiling libgcc2.a.
4c457b6b 470TARGET_LIBGCC2_CFLAGS =
7bb7f3df 471
cea3bd3e
RH
472# Options to use when compiling crtbegin/end.
473CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
27b41650 474 -finhibit-size-directive -fno-inline-functions -fno-exceptions \
e72fcfe8 475 -fno-zero-initialized-in-bss -fno-unit-at-a-time
cea3bd3e 476
4977bab6 477# Additional sources to handle exceptions; overridden by targets as needed.
52a11cbf 478LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
0bfa5f65 479 $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c
52a11cbf 480LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h
ce152ef8 481
0ad7574f
DE
482# nm flags to list global symbols in libgcc object files.
483SHLIB_NM_FLAGS = -pg
484
79d8453e
RS
485# List of extra executables that should be compiled for this target machine
486# that are used for compiling from source code to object code.
487# The rules for compiling them should be in the t-* file for the machine.
3c18ea24 488EXTRA_PASSES =@extra_passes@
79d8453e 489
2e494f70 490# Like EXTRA_PASSES, but these are used when linking.
3c18ea24 491EXTRA_PROGRAMS = @extra_programs@
2e494f70
RS
492
493# List of extra object files that should be compiled for this target machine.
79d8453e 494# The rules for compiling them should be in the t-* file for the machine.
3c18ea24 495EXTRA_PARTS = @extra_parts@
79d8453e 496
2e494f70
RS
497# List of extra object files that should be compiled and linked with
498# compiler proper (cc1, cc1obj, cc1plus).
3c18ea24 499EXTRA_OBJS = @extra_objs@
2e494f70 500
43554690
RK
501# List of extra object files that should be compiled and linked with
502# the gcc driver.
3c18ea24 503EXTRA_GCC_OBJS =@host_extra_gcc_objs@
43554690 504
f780d21b 505# List of additional header files to install.
3c18ea24 506EXTRA_HEADERS =@extra_headers_list@
f780d21b 507
47547081
RS
508# It is convenient for configure to add the assignment at the beginning,
509# so don't override it here.
10da1131 510USE_COLLECT2 = collect2$(exeext)
47547081 511
fa9518de 512# List of extra C and assembler files to add to static and shared libgcc2.
79d8453e 513# Assembler files should have names ending in `.asm'.
4c457b6b 514LIB2FUNCS_EXTRA =
79d8453e 515
fa9518de
FS
516# List of extra C and assembler files to add to static libgcc2.
517# Assembler files should have names ending in `.asm'.
518LIB2FUNCS_STATIC_EXTRA =
519
79d8453e 520# Program to convert libraries.
4c457b6b 521LIBCONVERT =
79d8453e
RS
522
523# Control whether header files are installed.
e34a3d31 524INSTALL_HEADERS=install-headers install-mkheaders
79d8453e 525
09fa0705
ZW
526# Control whether Info documentation is built and installed.
527BUILD_INFO = @BUILD_INFO@
09fa0705 528
fd939e46
JM
529# Control whether manpages generated by texi2pod.pl can be rebuilt.
530GENERATED_MANPAGES = @GENERATED_MANPAGES@
531
66d7ffbf 532# Additional directories of header files to run fixincludes on.
4ab08223
RS
533# These should be directories searched automatically by default
534# just as /usr/include is.
4c457b6b 535# *Do not* use this for directories that happen to contain
4ab08223 536# header files, but are not searched automatically by default.
66d7ffbf
RS
537# On most systems, this is empty.
538OTHER_FIXINCLUDES_DIRS=
539
7c27f801 540# A list of all the language-specific executables.
3379e8ef 541COMPILERS = cc1$(exeext) @all_compilers@
7c27f801 542
acbbf3d9 543# List of things which should already be built whenever we try to use xgcc
79d8453e 544# to compile anything (without linking).
aaf93206 545GCC_PASSES=xgcc$(exeext) cc1$(exeext) specs $(EXTRA_PASSES)
79d8453e 546
acbbf3d9 547# List of things which should already be built whenever we try to use xgcc
79d8453e 548# to link anything.
b583eed8 549GCC_PARTS=$(GCC_PASSES) $(LIBGCC) $(EXTRA_PROGRAMS) $(USE_COLLECT2) $(EXTRA_PARTS)
79d8453e 550
79d8453e
RS
551# Directory to link to, when using the target `maketest'.
552DIR = ../gcc
553
554# Flags to use when cross-building GCC.
555# Prefix to apply to names of object files when using them
556# to run on the machine we are compiling on.
5c35940c 557BUILD_PREFIX = @BUILD_PREFIX@
79d8453e
RS
558# Prefix to apply to names of object files when compiling them
559# to run on the machine we are compiling on.
4c457b6b 560# The default for this variable is chosen to keep these rules
79d8453e 561# out of the way of the other rules for compiling the same source files.
5c35940c 562BUILD_PREFIX_1 = @BUILD_PREFIX_1@
a078a589 563# Native compiler for the build machine and its switches.
eaf9f3b2 564CC_FOR_BUILD = @CC_FOR_BUILD@
4977bab6 565BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE
a078a589
ZW
566
567# Native linker and preprocessor flags. For x-fragment overrides.
4977bab6
ZW
568BUILD_LDFLAGS=$(LDFLAGS)
569BUILD_CPPFLAGS=$(ALL_CPPFLAGS)
79d8453e 570
338023d4 571# Actual name to use when installing a native compiler.
b21d216c 572GCC_INSTALL_NAME = `echo gcc|sed '$(program_transform_name)'`
caa55b1e 573GCC_TARGET_INSTALL_NAME = $(target_noncanonical)-`echo gcc|sed '$(program_transform_name)'`
b21d216c
AF
574CPP_INSTALL_NAME = `echo cpp|sed '$(program_transform_name)'`
575PROTOIZE_INSTALL_NAME = `echo protoize|sed '$(program_transform_name)'`
576UNPROTOIZE_INSTALL_NAME = `echo unprotoize|sed '$(program_transform_name)'`
577GCOV_INSTALL_NAME = `echo gcov|sed '$(program_transform_name)'`
578GCCBUG_INSTALL_NAME = `echo gccbug|sed '$(program_transform_name)'`
338023d4
DE
579
580# Actual name to use when installing a cross-compiler.
b21d216c
AF
581GCC_CROSS_NAME = `echo gcc|sed '$(program_transform_cross_name)'`
582CPP_CROSS_NAME = `echo cpp|sed '$(program_transform_cross_name)'`
583PROTOIZE_CROSS_NAME = `echo protoize|sed '$(program_transform_cross_name)'`
584UNPROTOIZE_CROSS_NAME = `echo unprotoize|sed '$(program_transform_cross_name)'`
338023d4 585
e933cbe0
JL
586# Setup the testing framework, if you have one
587EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
588 echo $${rootme}/../expect/expect ; \
589 else echo expect ; fi`
590
591RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
592 echo $${srcdir}/../dejagnu/runtest ; \
593 else echo runtest; fi`
594RUNTESTFLAGS =
595
aefc3801 596# Extra symbols for fixproto to define when parsing headers.
4c457b6b 597FIXPROTO_DEFINES =
aefc3801 598
68d69835 599# Extra flags to use when compiling crt{begin,end}.o.
4c457b6b 600CRTSTUFF_T_CFLAGS =
68d69835 601
522170ca 602# Extra flags to use when compiling [m]crt0.o.
4c457b6b 603CRT0STUFF_T_CFLAGS =
522170ca 604
e9a25f70
JL
605# "t" or nothing, for building multilibbed versions of, say, crtbegin.o.
606T =
607
6c80a645
AO
608# Should T contain a `=', libgcc.mk will make T_TARGET, setting
609# $(T_TARGET) to the name of the actual target filename.
610T_TARGET =
611T_TARGET : $(T_TARGET)
612
3bd6d4c4
AO
613# This should name the specs file that we're going to install. Target
614# Makefiles may override it and name another file to be generated from
615# the built-in specs and installed as the default spec, as long as
616# they also introduce a rule to generate a file name specs, to be used
617# at build time.
618SPECS = specs
619
79d8453e
RS
620# End of variables for you to override.
621
4977bab6
ZW
622# GTM_H lists the config files that the generator files depend on,
623# while TM_H lists the ones ordinary gcc files depend on, which
624# includes several files generated by those generators.
625BCONFIG_H = bconfig.h $(build_xm_file_list)
626CONFIG_H = config.h $(host_xm_file_list)
1b0c37d7 627TCONFIG_H = tconfig.h $(xm_file_list)
4977bab6
ZW
628TM_P_H = tm_p.h $(tm_p_file_list)
629GTM_H = tm.h $(tm_file_list)
630TM_H = $(GTM_H) insn-constants.h insn-flags.h
631
672a6f42 632TARGET_H = target.h
e4ec2cac 633HOOKS_H = hooks.h
aea185b3 634LANGHOOKS_DEF_H = langhooks-def.h $(HOOKS_H)
e4ec2cac 635TARGET_DEF_H = target-def.h $(HOOKS_H)
0974c7d7 636MACHMODE_H = machmode.h mode-classes.def insn-modes.h
c4df8f8c 637RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H)
fd3acbb3 638RTL_H = $(RTL_BASE_H) genrtl.h input.h
639bc36c 639PARAMS_H = params.h params.def
e6986399 640TREE_H = tree.h tree.def $(MACHMODE_H) tree-check.h version.h builtins.def \
6060edcb 641 input.h
56f15830 642BASIC_BLOCK_H = basic-block.h bitmap.h sbitmap.h varray.h $(PARTITION_H) \
9ee634e3 643 hard-reg-set.h cfghooks.h
ca29da43 644COVERAGE_H = coverage.h gcov-io.h gcov-iov.h
c4df8f8c
KC
645DEMANGLE_H = $(srcdir)/../include/demangle.h
646RECOG_H = recog.h
e78d8e51
ZW
647EXPR_H = expr.h
648OPTABS_H = optabs.h insn-codes.h
c4df8f8c
KC
649REGS_H = regs.h varray.h $(MACHMODE_H)
650INTEGRATE_H = integrate.h varray.h
651LOOP_H = loop.h varray.h bitmap.h
652GCC_H = gcc.h version.h
17211ab5 653GGC_H = ggc.h gtype-desc.h
c4df8f8c
KC
654TIMEVAR_H = timevar.h timevar.def
655INSN_ATTR_H = insn-attr.h $(srcdir)/insn-addr.h $(srcdir)/varray.h
81a75f0f 656C_COMMON_H = c-common.h $(SPLAY_TREE_H) $(CPPLIB_H)
c4df8f8c
KC
657C_TREE_H = c-tree.h $(C_COMMON_H)
658SYSTEM_H = system.h hwint.h $(srcdir)/../include/libiberty.h
4db384c9 659PREDICT_H = predict.h predict.def
ef6e958a 660CPPLIB_H = cpplib.h line-map.h
b6fe0bb8
GDR
661PRETTY_PRINT_H = pretty-print.h input.h $(OBSTACK_H)
662DIAGNOSTIC_H = diagnostic.h diagnostic.def $(PRETTY_PRINT_H)
e1a4dd13 663C_PRETTY_PRINT_H = $(PRETTY_PRINT_H) $(C_COMMON_H) $(TREE_H)
c4df8f8c 664
2ed26f6b
ZW
665# target overrides
666ifneq ($(tmake_file),)
667include $(tmake_file)
668endif
669
670# host overrides
671ifneq ($(xmake_file),)
672include $(xmake_file)
673endif
3c18ea24 674
544eb21e 675#\f
79d8453e
RS
676# Now figure out from those variables how to compile and link.
677
a078a589
ZW
678# IN_GCC distinguishes between code compiled into GCC itself and other
679# programs built during a bootstrap.
680# autoconf inserts -DCROSS_COMPILE if we are building a cross compiler.
8733892f 681INTERNAL_CFLAGS = -DIN_GCC @CROSS@
79d8453e 682
83599948
NS
683# This is the variable actually used when we compile. If you change this,
684# you probably want to update BUILD_CFLAGS in configure.in
22aa533e 685ALL_CFLAGS = $(X_CFLAGS) $(T_CFLAGS) \
8733892f 686 $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) $(XCFLAGS) @DEFS@
79d8453e
RS
687
688# Likewise.
689ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
690
06f0b04c
ZW
691# Build and host support libraries. FORBUILD is either
692# .. or ../$(build_alias) depending on whether host != build.
693LIBIBERTY = ../libiberty/libiberty.a
694BUILD_LIBIBERTY = @FORBUILD@/libiberty/libiberty.a
79d8453e 695
935bfb44 696# Dependencies on the intl and portability libraries.
56694dd9 697LIBDEPS= $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP)
79d8453e
RS
698
699# Likewise, for use in the tools that must run on this machine
700# even if we are cross-building GCC.
4977bab6 701BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
79d8453e
RS
702
703# How to link with both our special library facilities
704# and the system's installed libraries.
56694dd9 705LIBS = @LIBS@ $(LIBIBERTY) $(LIBINTL) $(LIBICONV)
79d8453e 706
7d600178
RO
707# Any system libraries needed just for GNAT.
708SYSLIBS = @GNAT_LIBEXC@
709
62c9aa5f
ZW
710# Libs needed (at present) just for jcf-dump.
711LDEXP_LIB = @LDEXP_LIB@
712
79d8453e
RS
713# Likewise, for use in the tools that must run on this machine
714# even if we are cross-building GCC.
4977bab6 715BUILD_LIBS = $(BUILD_LIBIBERTY)
79d8453e 716
4977bab6 717BUILD_RTL = $(BUILD_PREFIX)rtl.o read-rtl.o $(BUILD_PREFIX)bitmap.o \
94134f42 718 $(BUILD_PREFIX)ggc-none.o min-insn-modes.o
4977bab6
ZW
719BUILD_SUPPORT = gensupport.o insn-conditions.o
720BUILD_EARLY_SUPPORT = gensupport.o dummy-conditions.o
c88c0d42 721
4977bab6
ZW
722BUILD_PRINT = print-rtl1.o
723BUILD_ERRORS = $(BUILD_PREFIX)errors.o
724BUILD_VARRAY = $(BUILD_PREFIX)varray.o
79d8453e
RS
725
726# Specify the directories to be searched for header files.
727# Both . and srcdir are used, in that order,
eaf4e618 728# so that *config.h will be found in the compilation
79d8453e 729# subdirectory rather than in the source directory.
b8dad04b
ZW
730# -I$(@D) and -I$(srcdir)/$(@D) cause the subdirectory of the file
731# currently being compiled, in both source trees, to be examined as well.
6eb95e99 732# libintl.h will be found in ../intl if we are using the included libintl.
b8dad04b 733INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
ca11c37c 734 -I$(srcdir)/../include @INCINTL@
79d8453e 735
79d8453e 736.c.o:
b8dad04b 737 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
79d8453e 738
544eb21e 739#\f
73458fb7
NN
740# Support for additional languages (other than C).
741# C can be supported this way too (leave for later).
013a2ee0 742
2ed26f6b 743LANG_MAKEFRAGS = @all_lang_makefrags@
3c18ea24
RK
744LANG_MAKEFILES = @all_lang_makefiles@
745LANG_STAGESTUFF = @all_stagestuff@
013a2ee0
DE
746
747# Flags to pass to recursive makes.
748# CC is set by configure. Hosts without symlinks need special handling
749# because we need CC="stage1/xgcc -Bstage1/" to work in the language
750# subdirectories.
751# ??? The choices here will need some experimenting with.
e158a5fb
MM
752
753export AR_FOR_TARGET
754export AR_CREATE_FOR_TARGET
755export AR_FLAGS_FOR_TARGET
756export AR_EXTRACT_FOR_TARGET
757export AWK
758export BUILD_PREFIX
759export BUILD_PREFIX_1
760export DESTDIR
761export GCC_FOR_TARGET
762export INCLUDES
763export INSTALL_DATA
764export LIB1ASMSRC
765export LIBGCC2_CFLAGS
766export MACHMODE_H
767export NM_FOR_TARGET
768export RANLIB_FOR_TARGET
769export libsubdir
770export slibdir
771
e6980e1b 772ORDINARY_FLAGS_TO_PASS = \
013a2ee0
DE
773 "BISON=$(BISON)" \
774 "BISONFLAGS=$(BISONFLAGS)" \
5b67ad6f 775 "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
013a2ee0 776 "LDFLAGS=$(LDFLAGS)" \
1e608388
ZW
777 "FLEX=$(FLEX)" \
778 "FLEXFLAGS=$(FLEXFLAGS)" \
ac64120e
JW
779 "LN=$(LN)" \
780 "LN_S=$(LN_S)" \
013a2ee0
DE
781 "MAKEINFO=$(MAKEINFO)" \
782 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
03bbd83f 783 "MAKEOVERRIDES=" \
013a2ee0 784 "SHELL=$(SHELL)" \
aab26e16 785 "exeext=$(exeext)" \
6e26218f 786 "build_exeext=$(build_exeext)" \
aab26e16 787 "objext=$(objext)" \
013a2ee0
DE
788 "exec_prefix=$(exec_prefix)" \
789 "prefix=$(prefix)" \
3bf810d8 790 "local_prefix=$(local_prefix)" \
8f8d3278 791 "gxx_include_dir=$(gcc_gxx_include_dir)" \
f098ead2 792 "build_tooldir=$(build_tooldir)" \
91c7bd9b 793 "gcc_tooldir=$(gcc_tooldir)" \
013a2ee0 794 "bindir=$(bindir)" \
a8ee6e2d 795 "libexecsubdir=$(libsubdir)" \
ab87f8c8 796 "datadir=$(datadir)" \
ab87f8c8 797 "localedir=$(localedir)"
04203c18
AC
798FLAGS_TO_PASS = $(ORDINARY_FLAGS_TO_PASS) "CC=@cc_set_by_configure@" \
799 "STAGE_PREFIX=@stage_prefix_set_by_configure@"
ab87f8c8
JL
800PREPEND_DOTDOT_TO_RELATIVE_PATHS = sed \
801 -e 's|^ *[^ /][^ /]*/|%&|' \
802 -e 's| -B| -B%|g' \
803 -e 's|% *[^- /]|%&|g' \
804 -e 's|%% *|../|g' \
805 -e 's|%||g'
806SUBDIR_FLAGS_TO_PASS = $(ORDINARY_FLAGS_TO_PASS) \
04203c18 807 "CC=`echo @quoted_cc_set_by_configure@ | $(PREPEND_DOTDOT_TO_RELATIVE_PATHS)`" \
596151e1 808 "STAGE_PREFIX=`echo @quoted_stage_prefix_set_by_configure@ | $(PREPEND_DOTDOT_TO_RELATIVE_PATHS)`"
544eb21e 809#\f
79d8453e
RS
810# Lists of files for various purposes.
811
aac69a49
NC
812# Target specific, C specific object file
813C_TARGET_OBJS=@c_target_objs@
814
815# Target specific, C++ specific object file
816CXX_TARGET_OBJS=@cxx_target_objs@
817
3cb88565 818# Language-specific object files for C and Objective C.
aaed0206 819C_AND_OBJC_OBJS = attribs.o c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o \
0b6f2917 820 c-convert.o c-aux-info.o c-common.o c-opts.o c-format.o c-semantics.o \
d7b42618 821 c-incpath.o cppdefault.o c-ppoutput.o c-cppbuiltin.o prefix.o \
17211ab5 822 c-objc-common.o c-dump.o c-pch.o libcpp.a $(C_TARGET_OBJS)
3cb88565 823
79d8453e 824# Language-specific object files for C.
264fa2db 825C_OBJS = c-parse.o c-lang.o c-pretty-print.o stub-objc.o $(C_AND_OBJC_OBJS)
e8066a5d 826
79d8453e 827# Language-independent object files.
a36556a8 828
d1bd0ded
GK
829OBJS-common = \
830 alias.o bb-reorder.o bitmap.o builtins.o caller-save.o calls.o \
e2500fed 831 cfg.o cfganal.o cfgbuild.o cfgcleanup.o cfglayout.o cfgloop.o \
b17d5d7c 832 cfgloopanal.o cfgloopmanip.o loop-init.o loop-unswitch.o loop-unroll.o \
ca29da43
NS
833 cfgrtl.o combine.o conflict.o convert.o coverage.o cse.o cselib.o \
834 dbxout.o debug.o df.o diagnostic.o dojump.o doloop.o dominance.o \
e2500fed
GK
835 dwarf2asm.o dwarf2out.o dwarfout.o emit-rtl.o except.o explow.o \
836 expmed.o expr.o final.o flow.o fold-const.o function.o gcse.o \
837 genrtl.o ggc-common.o global.o graph.o gtype-desc.o \
0974c7d7 838 haifa-sched.o hooks.o ifcvt.o insn-attrtab.o insn-emit.o insn-modes.o \
e2500fed 839 insn-extract.o insn-opinit.o insn-output.o insn-peep.o insn-recog.o \
7f22efe1 840 integrate.o intl.o jump.o langhooks.o lcm.o lists.o local-alloc.o \
ade4289c 841 loop.o optabs.o options.o opts.o params.o postreload.o predict.o \
af166e5d 842 print-rtl.o print-tree.o value-prof.o \
ed8d2920
MM
843 profile.o ra.o ra-build.o ra-colorize.o ra-debug.o ra-rewrite.o \
844 real.o recog.o reg-stack.o regclass.o regmove.o regrename.o \
e2500fed
GK
845 reload.o reload1.o reorg.o resource.o rtl.o rtlanal.o rtl-error.o \
846 sbitmap.o sched-deps.o sched-ebb.o sched-rgn.o sched-vis.o sdbout.o \
ac5e69da 847 sibcall.o simplify-rtx.o sreal.o ssa.o ssa-ccp.o ssa-dce.o stmt.o \
61f71b34 848 stor-layout.o stringpool.o targhooks.o timevar.o toplev.o tracer.o tree.o tree-dump.o \
d1bd0ded 849 unroll.o varasm.o varray.o version.o vmsdbgout.o xcoffout.o \
62551c66 850 alloc-pool.o et-forest.o cfghooks.o bt-load.o pretty-print.o $(GGC) web.o
d1bd0ded
GK
851
852OBJS-md = $(out_object_file)
853OBJS-archive = $(EXTRA_OBJS) $(host_hook_obj) hashtable.o tree-inline.o \
4985cde3 854 tree-optimize.o cgraph.o cgraphunit.o
d1bd0ded
GK
855
856OBJS = $(OBJS-common) $(out_object_file) $(OBJS-archive)
857
858OBJS-onestep = libbackend.o $(OBJS-archive)
79d8453e 859
aa5b94de 860BACKEND = main.o libbackend.a
a36556a8 861
79d8453e 862# Files to be copied away after each stage in building.
aab26e16 863STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
79d8453e 864 insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
1b0c37d7 865 insn-attr.h insn-attrtab.c insn-opinit.c insn-constants.h tm-preds.h \
94134f42 866 tree-check.h insn-conditions.c min-insn-modes.c insn-modes.c insn-modes.h \
0974c7d7 867 s-flags s-config s-codes s-mlib s-genrtl s-modes s-gtype gtyp-gen.h \
2199e5fa 868 s-output s-recog s-emit s-extract s-peep s-check s-conditions \
1b0c37d7 869 s-attr s-attrtab s-opinit s-preds s-constants s-crt0 \
6e26218f
ILT
870 genemit$(build_exeext) genoutput$(build_exeext) genrecog$(build_exeext) \
871 genextract$(build_exeext) genflags$(build_exeext) gencodes$(build_exeext) \
872 genconfig$(build_exeext) genpeep$(build_exeext) genattrtab$(build_exeext) \
206ae7cf 873 genattr$(build_exeext) genopinit$(build_exeext) gengenrtl$(build_exeext) \
1b0c37d7 874 gencheck$(build_exeext) genpreds$(build_exeext) genconstants$(build_exeext) \
0974c7d7 875 gengtype$(build_exeext) genconditions$(build_exeext) genmodes$(build_exeext) \
ad854f24 876 genrtl.c genrtl.h gt-*.h gtype-*.h gtype-desc.c \
aaf93206 877 xgcc$(exeext) cpp$(exeext) cc1$(exeext) $(EXTRA_PASSES) \
8f7d850c 878 $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
39cef914 879 protoize$(exeext) unprotoize$(exeext) \
3bd6d4c4 880 $(SPECS) collect2$(exeext) $(USE_COLLECT2) \
4977bab6
ZW
881 gcov-iov$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \
882 *.[0-9][0-9].* *.[si] libcpp.a libbackend.a libgcc.mk \
013a2ee0 883 $(LANG_STAGESTUFF)
79d8453e 884
3fe68d0a 885# Defined in libgcc2.c, included only in the static library.
23af32e6
NS
886LIB2FUNCS_ST = _eprintf __gcc_bcmp
887
888# Defined in libgcov.c, included only in gcov library
af166e5d 889LIBGCOV = _gcov _gcov_merge_add _gcov_merge_single _gcov_merge_delta
3fe68d0a 890
5198352e
JL
891FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \
892 _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
1eb8759b 893 _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf _make_sf \
88e83acb 894 _sf_to_df _sf_to_tf _thenan_sf _sf_to_usi _usi_to_sf
5198352e
JL
895
896DPBIT_FUNCS = _pack_df _unpack_df _addsub_df _mul_df _div_df \
897 _fpcmp_parts_df _compare_df _eq_df _ne_df _gt_df _ge_df \
1eb8759b 898 _lt_df _le_df _unord_df _si_to_df _df_to_si _negate_df _make_df \
88e83acb
AO
899 _df_to_sf _df_to_tf _thenan_df _df_to_usi _usi_to_df
900
901TPBIT_FUNCS = _pack_tf _unpack_tf _addsub_tf _mul_tf _div_tf \
902 _fpcmp_parts_tf _compare_tf _eq_tf _ne_tf _gt_tf _ge_tf \
903 _lt_tf _le_tf _unord_tf _si_to_tf _tf_to_si _negate_tf _make_tf \
904 _tf_to_df _tf_to_sf _thenan_tf _tf_to_usi _usi_to_tf
5198352e 905
fc6aa0a9
AH
906# These might cause a divide overflow trap and so are compiled with
907# unwinder info.
908LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
909
544eb21e 910#\f
013a2ee0
DE
911# Language makefile fragments.
912
913# The following targets define the interface between us and the languages.
914#
a078a589 915# all.cross, start.encap, rest.encap,
013a2ee0 916# install-normal, install-common, install-info, install-man,
436a88a6 917# uninstall,
f1908d70 918# mostlyclean, clean, distclean, extraclean, maintainer-clean,
013a2ee0
DE
919# stage1, stage2, stage3, stage4
920#
62b81e45
MM
921# Each language is linked in with a series of hooks. The name of each
922# hooked is "lang.${target_name}" (eg: lang.info). Configure computes
923# and adds these here. We use double-colon rules for some of the hooks;
924# double-colon rules should be preferred for any new hooks.
013a2ee0 925
2ed26f6b 926# language hooks, generated by configure
3c18ea24 927@language_hooks@
013a2ee0 928
2ed26f6b
ZW
929# per-language makefile fragments
930ifneq ($(LANG_MAKEFRAGS),)
931include $(LANG_MAKEFRAGS)
932endif
013a2ee0 933
544eb21e 934#\f
79d8453e 935
73458fb7
NN
936# -----------------------------
937# Rebuilding this configuration
938# -----------------------------
939
fca086c1 940Makefile: config.status $(srcdir)/Makefile.in $(srcdir)/version.c $(LANG_MAKEFRAGS)
2ed26f6b
ZW
941 LANGUAGES="$(CONFIG_LANGUAGES)" \
942 CONFIG_HEADERS= \
943 CONFIG_FILES=$@ $(SHELL) config.status
79d8453e 944
11642c3a 945config.h: cs-config.h ; @true
4977bab6 946bconfig.h: cs-bconfig.h ; @true
11642c3a 947tconfig.h: cs-tconfig.h ; @true
4977bab6 948tm.h: cs-tm.h ; @true
11642c3a
ZW
949tm_p.h: cs-tm_p.h ; @true
950
951cs-config.h: Makefile
4977bab6 952 TARGET_CPU_DEFAULT="" \
e22340b0 953 HEADERS="$(host_xm_include_list)" DEFINES="$(host_xm_defines)" \
11642c3a
ZW
954 $(SHELL) $(srcdir)/mkconfig.sh config.h
955
4977bab6
ZW
956cs-bconfig.h: Makefile
957 TARGET_CPU_DEFAULT="" \
e22340b0 958 HEADERS="$(build_xm_include_list)" DEFINES="$(build_xm_defines)" \
4977bab6 959 $(SHELL) $(srcdir)/mkconfig.sh bconfig.h
11642c3a 960
0d24f4d1 961cs-tconfig.h: Makefile
3d9d2476 962 TARGET_CPU_DEFAULT="" \
e22340b0 963 HEADERS="$(xm_include_list)" DEFINES="$(xm_defines)" \
11642c3a
ZW
964 $(SHELL) $(srcdir)/mkconfig.sh tconfig.h
965
4977bab6
ZW
966cs-tm.h: Makefile
967 TARGET_CPU_DEFAULT="$(target_cpu_default)" \
e22340b0 968 HEADERS="$(tm_include_list)" DEFINES="$(tm_defines)" \
4977bab6
ZW
969 $(SHELL) $(srcdir)/mkconfig.sh tm.h
970
11642c3a 971cs-tm_p.h: Makefile
4977bab6 972 TARGET_CPU_DEFAULT="" \
e22340b0 973 HEADERS="$(tm_p_include_list)" DEFINES="" \
11642c3a
ZW
974 $(SHELL) $(srcdir)/mkconfig.sh tm_p.h
975
e7f62dcf
NC
976# Don't automatically run autoconf, since configure.in might be accidentally
977# newer than configure. Also, this writes into the source directory which
978# might be on a read-only file system. If configured for maintainer mode
979# then do allow autoconf to be run.
980
981$(srcdir)/configure: @MAINT@ $(srcdir)/configure.in
b8dad04b 982 (cd $(srcdir) && autoconf)
3c18ea24 983
501a4819 984gccbug: $(srcdir)/gccbug.in
5262d6b6 985 CONFIG_FILES=gccbug CONFIG_HEADERS= ./config.status
501a4819 986
3ec83fc2 987mklibgcc: $(srcdir)/mklibgcc.in
5262d6b6 988 CONFIG_FILES=mklibgcc CONFIG_HEADERS= ./config.status
3ec83fc2 989
e34a3d31
GK
990mkheaders: $(srcdir)/mkheaders.in
991 CONFIG_FILES=mkheaders CONFIG_HEADERS= ./config.status
992
da7ece9a 993# cstamp-h.in controls rebuilding of config.in.
7c0ae5f1
DE
994# It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't
995# delete it. A stamp file is needed as autoheader won't update the file if
996# nothing has changed.
da7ece9a
DE
997# It remains in the source directory and is part of the distribution.
998# This follows what is done in shellutils, fileutils, etc.
5408f8d0
DE
999# "echo timestamp" is used instead of touch to be consistent with other
1000# packages that use autoconf (??? perhaps also to avoid problems with patch?).
da7ece9a 1001# ??? Newer versions have a maintainer mode that may be useful here.
e7f62dcf
NC
1002
1003# Don't run autoheader automatically either.
1004# Only run it if maintainer mode is enabled.
1005@MAINT@ $(srcdir)/config.in: $(srcdir)/cstamp-h.in
46db61e7 1006@MAINT@ $(srcdir)/cstamp-h.in: $(srcdir)/configure.in
e7f62dcf
NC
1007@MAINT@ (cd $(srcdir) && autoheader)
1008@MAINT@ @rm -f $(srcdir)/cstamp-h.in
1009@MAINT@ echo timestamp > $(srcdir)/cstamp-h.in
b7cb92ad 1010auto-host.h: cstamp-h ; @true
da7ece9a 1011cstamp-h: config.in config.status
2ed26f6b
ZW
1012 CONFIG_HEADERS=auto-host.h:config.in \
1013 CONFIG_FILES= \
1014 LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status
d68b51ef 1015
7c0ae5f1
DE
1016# Really, really stupid make features, such as SUN's KEEP_STATE, may force
1017# a target to build even if it is up-to-date. So we must verify that
1018# config.status does not exist before failing.
61ed06c3 1019config.status: $(srcdir)/configure $(srcdir)/config.gcc version.c
7c0ae5f1 1020 @if [ ! -f config.status ] ; then \
436a88a6 1021 echo You must configure gcc. Look at http://gcc.gnu.org/install/ for details.; \
7c0ae5f1
DE
1022 false; \
1023 else \
71205e0b 1024 LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status --recheck; \
7c0ae5f1
DE
1025 fi
1026
73458fb7
NN
1027# --------
1028# UNSORTED
1029# --------
1030
43297964 1031all.internal: start.encap rest.encap doc
79d8453e 1032# This is what to compile if making a cross-compiler.
4871239e 1033all.cross: native gcc-cross cpp$(exeext) specs \
7857f134 1034 $(LIBGCC) $(EXTRA_PARTS) lang.all.cross doc
79d8453e 1035# This is what must be made before installing GCC and converting libraries.
4871239e 1036start.encap: native xgcc$(exeext) cpp$(exeext) specs \
922cf99e 1037 xlimits.h lang.start.encap
eea77e5f 1038# These can't be made until after GCC can run.
f95e46b9 1039rest.encap: $(STMP_FIXPROTO) $(LIBGCC) $(EXTRA_PARTS) lang.rest.encap
79d8453e
RS
1040# This is what is made with the host's compiler
1041# whether making a cross compiler or not.
6eb95e99 1042native: config.status auto-host.h build-@POSUB@ $(LANGUAGES) \
88393a07 1043 $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2)
79d8453e
RS
1044
1045# Define the names for selecting languages in LANGUAGES.
353a10d0 1046C c: cc1$(exeext)
79d8453e
RS
1047PROTO: proto
1048
bff3fc41 1049# Tell GNU make these are phony targets.
3379e8ef 1050.PHONY: C c PROTO proto
bff3fc41 1051
3aa072f2
RS
1052# On the target machine, finish building a cross compiler.
1053# This does the things that can't be done on the host machine.
027ea2a7 1054rest.cross: $(LIBGCC) specs
3aa072f2 1055
3aa072f2
RS
1056# Recompile all the language-independent object files.
1057# This is used only if the user explicitly asks for it.
a36556a8 1058compilations: $(BACKEND)
79d8453e 1059
a36556a8 1060# Like libcpp.a, this archive is strictly for the host.
d1bd0ded 1061libbackend.a: $(OBJS@onestep@)
a36556a8 1062 -rm -rf libbackend.a
d1bd0ded 1063 $(AR) $(AR_FLAGS) libbackend.a $(OBJS@onestep@)
6822468a 1064 -$(RANLIB) libbackend.a
6c1cc7fa 1065
acbbf3d9
RS
1066# We call this executable `xgcc' rather than `gcc'
1067# to avoid confusion if the current directory is in the path
1068# and CC is `gcc'. It is renamed to `gcc' when it is installed.
08dc830e 1069xgcc$(exeext): gcc.o gccspec.o version.o intl.o prefix.o \
917acb0e 1070 version.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
08dc830e
ZW
1071 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o gccspec.o intl.o \
1072 prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
3aa072f2 1073
4871239e 1074# cpp is to cpp0 as gcc is to cc1.
922cf99e
ZW
1075# The only difference from xgcc is that it's linked with cppspec.o
1076# instead of gccspec.o.
4871239e 1077cpp$(exeext): gcc.o cppspec.o version.o intl.o prefix.o \
922cf99e
ZW
1078 version.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
1079 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o cppspec.o intl.o \
1080 prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
1081
3aa072f2 1082# Dump a specs file to make -B./ read these specs over installed ones.
3bd6d4c4 1083$(SPECS): xgcc$(exeext)
d521a023 1084 $(GCC_FOR_TARGET) -dumpspecs > tmp-specs
3bd6d4c4 1085 mv tmp-specs $(SPECS)
79d8453e 1086
acbbf3d9 1087# We do want to create an executable named `xgcc', so we can use it to
79d8453e
RS
1088# compile libgcc2.a.
1089# Also create gcc-cross, so that install-common will install properly.
e09e14e9 1090gcc-cross: xgcc$(exeext)
aab26e16 1091 cp xgcc$(exeext) gcc-cross$(exeext)
79d8453e 1092
b8dad04b 1093cc1$(exeext): $(C_OBJS) $(BACKEND) $(LIBDEPS)
a36556a8
ZW
1094 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1$(exeext) \
1095 $(C_OBJS) $(BACKEND) $(LIBS)
79d8453e 1096
1402d22c
RS
1097# Build the version of limits.h that we will install.
1098xlimits.h: glimits.h limitx.h limity.h
40dc28fc 1099 if $(LIMITS_H_TEST) ; then \
d521a023 1100 cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > tmp-xlimits.h; \
1402d22c 1101 else \
d521a023 1102 cat $(srcdir)/glimits.h > tmp-xlimits.h; \
1402d22c 1103 fi
d521a023 1104 mv tmp-xlimits.h xlimits.h
544eb21e 1105#\f
79d8453e 1106# Build libgcc.a.
a2ab7f2b 1107
52a11cbf 1108LIB2ADD = $(LIB2FUNCS_EXTRA)
fa9518de 1109LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA)
3ec83fc2 1110
556b821e 1111libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) $(LIB2ADD_ST) xgcc$(exeext) specs
3ec83fc2 1112 objext='$(objext)' \
3ec83fc2 1113 LIB1ASMFUNCS='$(LIB1ASMFUNCS)' \
3fe68d0a 1114 LIB2FUNCS_ST='$(LIB2FUNCS_ST)' \
23af32e6 1115 LIBGCOV='$(LIBGCOV)' \
3ec83fc2 1116 LIB2ADD='$(LIB2ADD)' \
fa9518de 1117 LIB2ADD_ST='$(LIB2ADD_ST)' \
52a11cbf
RH
1118 LIB2ADDEH='$(LIB2ADDEH)' \
1119 LIB2ADDEHDEP='$(LIB2ADDEHDEP)' \
3ec83fc2
RH
1120 FPBIT='$(FPBIT)' \
1121 FPBIT_FUNCS='$(FPBIT_FUNCS)' \
fc6aa0a9 1122 LIB2_DIVMOD_FUNCS='$(LIB2_DIVMOD_FUNCS)' \
3ec83fc2
RH
1123 DPBIT='$(DPBIT)' \
1124 DPBIT_FUNCS='$(DPBIT_FUNCS)' \
88e83acb
AO
1125 TPBIT='$(TPBIT)' \
1126 TPBIT_FUNCS='$(TPBIT_FUNCS)' \
3ec83fc2
RH
1127 MULTILIBS=`$(GCC_FOR_TARGET) --print-multi-lib` \
1128 EXTRA_MULTILIB_PARTS='$(EXTRA_MULTILIB_PARTS)' \
50503ac8 1129 SHLIB_LINK='$(SHLIB_LINK)' \
2bbea3a6 1130 SHLIB_INSTALL='$(SHLIB_INSTALL)' \
aefa45d3 1131 SHLIB_EXT='$(SHLIB_EXT)' \
50503ac8 1132 SHLIB_MULTILIB='$(SHLIB_MULTILIB)' \
83dad10c 1133 SHLIB_MKMAP='$(SHLIB_MKMAP)' \
bac015e7 1134 SHLIB_MKMAP_OPTS='$(SHLIB_MKMAP_OPTS)' \
83dad10c 1135 SHLIB_MAPFILES='$(SHLIB_MAPFILES)' \
0ad7574f 1136 SHLIB_NM_FLAGS='$(SHLIB_NM_FLAGS)' \
5bbcd587 1137 MULTILIB_OSDIRNAMES='$(MULTILIB_OSDIRNAMES)' \
ef1f96f0 1138 mkinstalldirs='$(SHELL) $(srcdir)/mkinstalldirs' \
3ec83fc2 1139 $(SHELL) mklibgcc > tmp-libgcc.mk
2aceb30d
JM
1140 mv tmp-libgcc.mk libgcc.mk
1141
1142# All the things that might cause us to want to recompile bits of libgcc.
1143LIBGCC_DEPS = $(GCC_PASSES) $(LANGUAGES) stmp-int-hdrs $(STMP_FIXPROTO) \
23af32e6 1144 libgcc.mk $(srcdir)/libgcc2.c $(srcdir)/libgcov.c $(TCONFIG_H) \
52a11cbf 1145 $(MACHMODE_H) longlong.h gbl-ctors.h config.status stmp-int-hdrs \
88e83acb
AO
1146 tsystem.h $(FPBIT) $(DPBIT) $(TPBIT) $(LIB2ADD) \
1147 $(LIB2ADD_ST) $(LIB2ADDEH) $(LIB2ADDEHDEP) $(EXTRA_PARTS) \
990f4800
NS
1148 $(srcdir)/config/$(LIB1ASMSRC) \
1149 $(srcdir)/gcov-io.h $(srcdir)/gcov-io.c gcov-iov.h
3ec83fc2 1150
990f4800 1151libgcov.a: libgcc.a; @true
23af32e6 1152
2aceb30d 1153libgcc.a: $(LIBGCC_DEPS)
e158a5fb 1154 $(MAKE) \
5b67ad6f 1155 CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \
e158a5fb 1156 CONFIG_H="$(TCONFIG_H)" TM_H="$(TM_H)" \
03bbd83f 1157 MAKEOVERRIDES= \
3ec83fc2 1158 -f libgcc.mk all
79d8453e 1159
f6cdc7ea
DE
1160# Use the genmultilib shell script to generate the information the gcc
1161# driver program needs to select the library directory based on the
1162# switches.
e5e809f4
JL
1163multilib.h: s-mlib; @true
1164s-mlib: $(srcdir)/genmultilib Makefile
c49d2df6
JJ
1165 if test @enable_multilib@ = yes \
1166 || test -n "$(MULTILIB_OSDIRNAMES)"; then \
4d2fb38b
JJ
1167 $(SHELL) $(srcdir)/genmultilib \
1168 "$(MULTILIB_OPTIONS)" \
1169 "$(MULTILIB_DIRNAMES)" \
1170 "$(MULTILIB_MATCHES)" \
1171 "$(MULTILIB_EXCEPTIONS)" \
1172 "$(MULTILIB_EXTRA_OPTS)" \
1173 "$(MULTILIB_EXCLUSIONS)" \
5bbcd587 1174 "$(MULTILIB_OSDIRNAMES)" \
c49d2df6 1175 "@enable_multilib@" \
4d2fb38b
JJ
1176 > tmp-mlib.h; \
1177 else \
c49d2df6
JJ
1178 $(SHELL) $(srcdir)/genmultilib '' '' '' '' '' '' '' no \
1179 > tmp-mlib.h; \
4d2fb38b 1180 fi
84c81320 1181 $(SHELL) $(srcdir)/move-if-change tmp-mlib.h multilib.h
d9835ae8 1182 $(STAMP) s-mlib
f6cdc7ea
DE
1183
1184# Build multiple copies of libgcc.a, one for each target switch.
2aceb30d 1185stmp-multilib: $(LIBGCC_DEPS)
e158a5fb 1186 $(MAKE) \
5b67ad6f 1187 CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \
e158a5fb 1188 CONFIG_H="$(CONFIG_H)" \
03bbd83f 1189 MAKEOVERRIDES= \
3ec83fc2 1190 -f libgcc.mk all
d9835ae8 1191 $(STAMP) stmp-multilib
ad3a9224 1192
79d8453e 1193# Compile two additional files that are linked with every program
32988c4a
RM
1194# linked using GCC on systems using COFF or ELF, for the sake of C++
1195# constructors.
11642c3a 1196$(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
4977bab6 1197 gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
cea3bd3e
RH
1198 $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
1199 @inhibit_libc@ -c $(srcdir)/crtstuff.c -DCRT_BEGIN \
1200 -o $(T)crtbegin$(objext)
47a22692 1201
11642c3a 1202$(T)crtend.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
4977bab6 1203 gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
cea3bd3e
RH
1204 $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
1205 @inhibit_libc@ -c $(srcdir)/crtstuff.c -DCRT_END \
1206 -o $(T)crtend$(objext)
32988c4a 1207
a9e6777f 1208# These are versions of crtbegin and crtend for shared libraries.
11642c3a 1209$(T)crtbeginS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
4977bab6 1210 gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
cea3bd3e
RH
1211 $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
1212 @inhibit_libc@ -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFS_O \
a9e6777f 1213 -o $(T)crtbeginS$(objext)
32988c4a 1214
11642c3a 1215$(T)crtendS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
4977bab6 1216 gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
cea3bd3e
RH
1217 $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
1218 @inhibit_libc@ -c $(srcdir)/crtstuff.c -DCRT_END -DCRTSTUFFS_O \
a9e6777f 1219 -o $(T)crtendS$(objext)
522170ca 1220
275b60d6
JJ
1221# This is a version of crtbegin for -static links.
1222$(T)crtbeginT.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
4977bab6 1223 gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
cea3bd3e
RH
1224 $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
1225 @inhibit_libc@ -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O \
275b60d6
JJ
1226 -o $(T)crtbeginT$(objext)
1227
3ec83fc2
RH
1228# Compile the start modules crt0.o and mcrt0.o that are linked with
1229# every program
e5e809f4
JL
1230crt0.o: s-crt0 ; @true
1231mcrt0.o: s-crt0; @true
522170ca 1232
e5e809f4 1233s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
522170ca
RK
1234 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
1235 -o crt0.o -c $(CRT0_S)
1236 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(CRT0STUFF_T_CFLAGS) \
1237 -o mcrt0.o -c $(MCRT0_S)
d9835ae8 1238 $(STAMP) s-crt0
544eb21e 1239#\f
79d8453e
RS
1240# Compiling object files from source files.
1241
1242# Note that dependencies on obstack.h are not written
1243# because that file is not part of GCC.
79d8453e
RS
1244
1245# C language specific files.
1246
4977bab6 1247c-errors.o: c-errors.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
b6fe0bb8 1248 $(C_TREE_H) flags.h $(DIAGNOSTIC_H) $(TM_P_H)
3859c32a 1249c-parse.o : $(parsedir)/c-parse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
4977bab6 1250 $(GGC_H) intl.h $(C_TREE_H) input.h flags.h toplev.h output.h $(CPPLIB_H) \
17211ab5 1251 varray.h gt-c-parse.h
96a9c44f 1252 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2f12fb2b 1253 -c $(parsedir)/c-parse.c $(OUTPUT_OPTION)
0e5921e8 1254
3859c32a
GK
1255$(parsedir)/c-parse.c: $(parsedir)/c-parse.y
1256 cd $(parsedir) && \
b88c0704
JM
1257 if $(BISON) $(BISONFLAGS) -o c-p$$$$.c c-parse.y; then \
1258 test -f c-p$$$$.output && mv -f c-p$$$$.output c-parse.output ; \
1259 mv -f c-p$$$$.c c-parse.c ; \
1260 else \
1261 rm -f c-p$$$$.* ; \
1262 false ; \
1263 fi
1264
3859c32a 1265$(parsedir)/c-parse.y: c-parse.in
49381011 1266 echo '/*WARNING: This file is automatically generated!*/' >tmp-c-parse.y
264fa2db
ZL
1267 sed -e "/^@@ifobjc.*/,/^@@end_ifobjc.*/d" \
1268 -e "/^@@ifc.*/d" -e "/^@@end_ifc.*/d" \
49381011 1269 $(srcdir)/c-parse.in >>tmp-c-parse.y
3859c32a 1270 $(SHELL) $(srcdir)/move-if-change tmp-c-parse.y $(parsedir)/c-parse.y
1c48d17e 1271
5793b276
NB
1272c-incpath.o: c-incpath.c c-incpath.h $(CONFIG_H) $(SYSTEM_H) $(CPPLIB_H) \
1273 intl.h prefix.h coretypes.h $(TM_H) cppdefault.h
1274
66ea6f4c
RH
1275c-decl.o : c-decl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
1276 $(RTL_H) $(C_TREE_H) $(GGC_H) $(TARGET_H) flags.h function.h output.h \
1277 $(EXPR_H) debug.h toplev.h intl.h $(TM_P_H) tree-inline.h $(TIMEVAR_H) \
40e941af 1278 opts.h c-pragma.h gt-c-decl.h cgraph.h $(HASHTAB_H) libfuncs.h except.h \
48873ed2 1279 $(LANGHOOKS_DEF_H)
4977bab6 1280c-typeck.o : c-typeck.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \
672a6f42 1281 $(TARGET_H) flags.h intl.h output.h $(EXPR_H) $(RTL_H) toplev.h $(TM_P_H)
4b780675
GDR
1282c-lang.o : c-lang.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
1283 $(C_TREE_H) $(C_PRETTY_PRINT_H) $(DIAGNOSTIC_H) \
dd220c49 1284 $(GGC_H) langhooks.h $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-c.h
d70f15d2
ZL
1285stub-objc.o : stub-objc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \
1286 $(GGC_H) $(C_COMMON_H)
5793b276 1287c-lex.o : c-lex.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
dd220c49 1288 $(RTL_H) debug.h $(C_TREE_H) $(C_COMMON_H) real.h c-incpath.h cppdefault.h \
8f17b5c5 1289 c-pragma.h input.h intl.h flags.h toplev.h output.h \
6338b358 1290 $(CPPLIB_H) $(EXPR_H) $(TM_P_H)
63973df3 1291c-ppoutput.o : c-ppoutput.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
dd220c49 1292 $(C_COMMON_H) $(TREE_H) $(CPPLIB_H) cpphash.h $(TM_P_H) c-pragma.h
4977bab6 1293c-objc-common.o : c-objc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
dd220c49 1294 $(C_TREE_H) $(RTL_H) insn-config.h $(INTEGRATE_H) $(EXPR_H) $(C_TREE_H) \
b6fe0bb8 1295 flags.h toplev.h tree-inline.h $(DIAGNOSTIC_H) $(VARRAY_H) \
4a46cbfb 1296 langhooks.h $(GGC_H) $(TARGET_H) cgraph.h
4977bab6
ZW
1297c-aux-info.o : c-aux-info.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
1298 $(C_TREE_H) flags.h toplev.h
1299c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
77f9af81 1300 flags.h toplev.h $(C_COMMON_H) real.h
4977bab6
ZW
1301c-pragma.o: c-pragma.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
1302 function.h c-pragma.h toplev.h output.h $(GGC_H) $(TM_P_H) $(C_COMMON_H) gt-c-pragma.h
4977bab6
ZW
1303graph.o: graph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h flags.h output.h \
1304 $(RTL_H) function.h hard-reg-set.h $(BASIC_BLOCK_H) graph.h
1305sbitmap.o: sbitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
1306 hard-reg-set.h $(BASIC_BLOCK_H)
79d8453e 1307
3fd9d606 1308COLLECT2_OBJS = collect2.o tlink.o intl.o version.o
4e70264f 1309COLLECT2_LIBS = @COLLECT2_LIBS@
a2d25763 1310collect2$(exeext): $(COLLECT2_OBJS) $(LIBDEPS)
057f494b 1311# Don't try modifying collect2 (aka ld) in place--it might be linking this.
ff0a63e8 1312 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o T$@ \
4e70264f 1313 $(COLLECT2_OBJS) $(LIBS) $(COLLECT2_LIBS)
ff0a63e8 1314 mv -f T$@ $@
79d8453e 1315
4977bab6 1316collect2.o : collect2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) gstab.h intl.h \
4e872036 1317 $(OBSTACK_H) $(DEMANGLE_H) collect2.h version.h
b7b08dcd 1318 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
caa55b1e 1319 -DTARGET_MACHINE=\"$(target_noncanonical)\" \
96a9c44f 1320 -c $(srcdir)/collect2.c $(OUTPUT_OPTION)
79d8453e 1321
4977bab6 1322tlink.o: tlink.c $(DEMANGLE_H) $(HASHTAB_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
e2500fed 1323 $(OBSTACK_H) collect2.h intl.h
eaa41c8d 1324
79d8453e
RS
1325# A file used by all variants of C.
1326
4977bab6 1327c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
d9b2742a 1328 $(OBSTACK_H) $(C_COMMON_H) flags.h toplev.h output.h c-pragma.h intl.h \
cb60f38d 1329 $(GGC_H) $(EXPR_H) $(TM_P_H) builtin-types.def builtin-attrs.def \
b6fe0bb8
GDR
1330 $(DIAGNOSTIC_H) gt-c-common.h langhooks.h varray.h $(RTL_H) \
1331 $(TARGET_H) $(C_TREE_H)
e1a4dd13 1332c-pretty-print.o : c-pretty-print.c $(C_PRETTY_PRINT_H) \
4977bab6 1333 $(C_COMMON_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) real.h
1312c143 1334
23345bbb 1335c-opts.o : c-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
b6fe0bb8 1336 c-pragma.h flags.h toplev.h langhooks.h tree-inline.h $(DIAGNOSTIC_H) \
48873ed2 1337 intl.h debug.h $(C_COMMON_H) opts.h options.h $(PARAMS_H)
8951a635
NB
1338 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1339 $< $(OUTPUT_OPTION) @TARGET_SYSTEM_ROOT_DEFINE@
0b6f2917 1340
cb60f38d
NB
1341c-cppbuiltin.o : c-cppbuiltin.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
1342 $(TREE_H) $(C_COMMON_H) c-pragma.h flags.h toplev.h langhooks.h \
e24c3d71 1343 output.h except.h real.h $(TM_P_H)
cb60f38d 1344
aaed0206
RK
1345# A file used by all variants of C and some other languages.
1346
4977bab6 1347attribs.o : attribs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) flags.h \
aaed0206 1348 toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) $(EXPR_H) $(TM_P_H) \
7ffb4fd2 1349 builtin-types.def $(TARGET_H) langhooks.h
aaed0206 1350
4977bab6 1351c-format.o : c-format.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) langhooks.h \
b6fe0bb8 1352 $(C_COMMON_H) flags.h toplev.h intl.h $(DIAGNOSTIC_H)
79d8453e 1353
4977bab6
ZW
1354c-semantics.o : c-semantics.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
1355 $(C_TREE_H) flags.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
96c6931d 1356 $(EXPR_H) $(PREDICT_H) tree-inline.h
f2c5f623 1357
4977bab6
ZW
1358c-dump.o : c-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
1359 $(C_TREE_H) tree-dump.h
558ee214 1360
17211ab5 1361c-pch.o : c-pch.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(CPPLIB_H) $(TREE_H) \
18c81520
GK
1362 $(C_COMMON_H) output.h toplev.h c-pragma.h $(GGC_H) debug.h \
1363 langhooks.h flags.h hosthooks.h
17211ab5 1364
79d8453e
RS
1365# Language-independent files.
1366
610c62ac 1367DRIVER_DEFINES = \
0deb20df 1368 -DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \
a8ee6e2d
GK
1369 -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
1370 -DSTANDARD_LIBEXEC_PREFIX=\"$(libexecdir)/gcc/\" \
964ceda1 1371 -DDEFAULT_TARGET_VERSION=\"$(version)\" \
caa55b1e 1372 -DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\" \
0deb20df 1373 -DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \
9db0819e 1374 -DTOOLDIR_BASE_PREFIX=\"$(unlibsubdir)/../\" \
4977bab6 1375 @TARGET_SYSTEM_ROOT_DEFINE@ \
414d23ae 1376 $(VALGRIND_DRIVER_DEFINES) \
db3f0336
HPN
1377 `test "X$${SHLIB_LINK}" = "X" || test "@enable_shared@" != "yes" || echo "-DENABLE_SHARED_LIBGCC"` \
1378 `test "X$${SHLIB_MULTILIB}" = "X" || echo "-DNO_SHARED_LIBGCC_MULTILIB"`
9db0819e 1379
4977bab6 1380gcc.o: gcc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h multilib.h \
a693284d 1381 Makefile $(lang_specs_files) specs.h prefix.h $(GCC_H)
8c310e3f
MM
1382 (SHLIB_LINK='$(SHLIB_LINK)' \
1383 SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
610c62ac
BK
1384 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1385 $(DRIVER_DEFINES) \
96a9c44f 1386 -c $(srcdir)/gcc.c $(OUTPUT_OPTION))
79d8453e 1387
4977bab6 1388gccspec.o: gccspec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H)
38935c21
FS
1389 (SHLIB_LINK='$(SHLIB_LINK)' \
1390 SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
1391 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1392 $(DRIVER_DEFINES) \
96a9c44f 1393 -c $(srcdir)/gccspec.c $(OUTPUT_OPTION))
38935c21 1394
4977bab6 1395cppspec.o: cppspec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H)
08dc830e 1396
12b195d9 1397tree-check.h: s-check ; @true
193ad8c6 1398s-check : gencheck$(build_exeext) $(srcdir)/move-if-change
414d23ae 1399 $(RUN_GEN) ./gencheck$(build_exeext) > tmp-check.h
84c81320 1400 $(SHELL) $(srcdir)/move-if-change tmp-check.h tree-check.h
d9835ae8 1401 $(STAMP) s-check
12b195d9 1402
4977bab6 1403gencheck$(build_exeext) : gencheck.o $(BUILD_LIBDEPS)
eaf9f3b2 1404 $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
4977bab6 1405 gencheck.o $(BUILD_LIBS)
12b195d9 1406
4977bab6
ZW
1407gencheck.o : gencheck.c gencheck.h tree.def $(BCONFIG_H) $(SYSTEM_H) \
1408 coretypes.h $(GTM_H) $(lang_tree_files)
1a4bf22f 1409
0d24f4d1
ZW
1410gencheck.h : s-gencheck ; @true
1411s-gencheck : Makefile
766c7ad1
ZW
1412 ltf="$(lang_tree_files)"; for f in $$ltf; do \
1413 echo "#include \"$$f\""; \
0d24f4d1
ZW
1414 done | sed 's|$(srcdir)/||' > tmp-gencheck.h
1415 $(SHELL) $(srcdir)/move-if-change tmp-gencheck.h gencheck.h
1416 $(STAMP) s-gencheck
1417
0d24f4d1
ZW
1418specs.h : s-specs ; @true
1419s-specs : Makefile
766c7ad1
ZW
1420 lsf="$(lang_specs_files)"; for f in $$lsf; do \
1421 echo "#include \"$$f\""; \
0d24f4d1
ZW
1422 done | sed 's|$(srcdir)/||' > tmp-specs.h
1423 $(SHELL) $(srcdir)/move-if-change tmp-specs.h specs.h
1424 $(STAMP) s-specs
1425
cf03fd63 1426options.c: $(lang_opt_files) $(srcdir)/opts.sh options.h intl.h
d7b42618 1427
4ade7b1a
KC
1428options.h: $(lang_opt_files) $(srcdir)/opts.sh Makefile
1429 AWK=$(AWK) $(SHELL) $(srcdir)/opts.sh \
1430 '$(SHELL) $(srcdir)/move-if-change' \
1431 options.c options.h $(lang_opt_files)
d7b42618 1432
79d8453e
RS
1433dumpvers: dumpvers.c
1434
4746ee26 1435version.o: version.c version.h
0a25f1f5 1436
4977bab6
ZW
1437gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) varray.h \
1438 $(HASHTAB_H) $(TREE_H) $(RTL_H) function.h insn-config.h $(EXPR_H) $(OPTABS_H) \
e2500fed
GK
1439 libfuncs.h debug.h $(GGC_H) bitmap.h $(BASIC_BLOCK_H) hard-reg-set.h \
1440 ssa.h cselib.h insn-addr.h
1441
17211ab5 1442ggc-common.o: ggc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GGC_H) \
18c81520 1443 $(HASHTAB_H) toplev.h $(PARAMS_H) hosthooks.h
b49a6a90 1444
4977bab6
ZW
1445ggc-simple.o: ggc-simple.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
1446 flags.h $(GGC_H) varray.h $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H)
0a25f1f5 1447
4977bab6 1448ggc-page.o: ggc-page.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
c4775f82 1449 flags.h toplev.h $(GGC_H) $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H)
21341cfd 1450
17211ab5
GK
1451stringpool.o: stringpool.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
1452 $(TREE_H) $(GGC_H) gt-stringpool.h
520a57c8 1453
4977bab6 1454ggc-none.o: ggc-none.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(GGC_H)
9196ece5 1455 $(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
0a25f1f5 1456
4977bab6 1457prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) Makefile prefix.h
e9a25f70
JL
1458 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1459 -DPREFIX=\"$(prefix)\" \
96a9c44f 1460 -c $(srcdir)/prefix.c $(OUTPUT_OPTION)
79d8453e 1461
4977bab6
ZW
1462convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) flags.h \
1463 convert.h toplev.h langhooks.h
c5d3565c 1464
4977bab6 1465langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) toplev.h \
dd220c49 1466 tree-inline.h $(RTL_H) insn-config.h $(INTEGRATE_H) langhooks.h \
dba65e79 1467 $(LANGHOOKS_DEF_H) flags.h $(GGC_H) gt-langhooks.h diagnostic.h
4977bab6
ZW
1468tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) flags.h function.h \
1469 toplev.h $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h \
e2500fed 1470 real.h gt-tree.h
4977bab6
ZW
1471tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
1472 $(C_TREE_H) flags.h langhooks.h toplev.h output.h c-pragma.h $(RTL_H) $(GGC_H) \
89d684bb 1473 $(EXPR_H) $(SPLAY_TREE_H) tree-dump.h
4985cde3
RH
1474tree-inline.o : tree-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
1475 $(TREE_H) $(RTL_H) $(EXPR_H) flags.h $(PARAMS_H) input.h insn-config.h \
1476 $(INTEGRATE_H) $(VARRAY_H) $(HASHTAB_H) $(SPLAY_TREE_H) toplev.h \
ddd2d57e 1477 langhooks.h $(C_COMMON_H) tree-inline.h cgraph.h intl.h
4985cde3
RH
1478tree-optimize.o : tree-optimize.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
1479 $(TREE_H) toplev.h langhooks.h cgraph.h $(TIMEVAR_H) function.h $(GGC_H)
1480
4977bab6
ZW
1481print-tree.o : print-tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
1482 $(GGC_H) langhooks.h real.h
1483stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
1484 flags.h function.h $(EXPR_H) $(RTL_H) toplev.h $(GGC_H) $(TM_P_H) $(TARGET_H) \
43577e6b 1485 langhooks.h
4977bab6
ZW
1486fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
1487 flags.h real.h toplev.h $(HASHTAB_H) $(EXPR_H) $(RTL_H) $(GGC_H) $(TM_P_H) langhooks.h
b6fe0bb8 1488diagnostic.o : diagnostic.c $(DIAGNOSTIC_H) real.h \
4977bab6 1489 $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(TM_P_H) flags.h $(GGC_H) \
e5f3b786 1490 input.h toplev.h intl.h langhooks.h $(LANGHOOKS_DEF_H)
d7b42618 1491opts.o : opts.c opts.h options.h toplev.h $(CONFIG_H) $(SYSTEM_H) \
de32c0cb 1492 coretypes.h $(TREE_H) $(TM_H) $(LANGHOOKS_H) $(GGC_H) $(RTL_H) \
b6fe0bb8 1493 output.h $(DIAGNOSTIC_H) $(TM_P_H) $(INSN_ATTR_H) intl.h
61f71b34 1494targhooks.o : targhooks.c targhooks.h $(CONFIG_H) $(SYSTEM_H) \
d84a4ef1
RO
1495 coretypes.h $(TREE_H) $(TM_H) $(RTL_H) $(TM_P_H) function.h \
1496 output.h toplev.h
61f71b34 1497
4977bab6 1498toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
b6fe0bb8 1499 function.h flags.h xcoffout.h input.h $(INSN_ATTR_H) output.h $(DIAGNOSTIC_H) \
2b85879e 1500 debug.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h \
efc9bd41 1501 dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \
fca9dc00 1502 graph.h $(LOOP_H) except.h $(REGS_H) $(TIMEVAR_H) value-prof.h \
0f81faf6 1503 ssa.h $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \
b2e608ca 1504 langhooks.h insn-flags.h cfglayout.h real.h cfgloop.h \
5b0e2409 1505 hosthooks.h $(LANGHOOKS_DEF_H) cgraph.h $(COVERAGE_H)
2cc07db4 1506 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
caa55b1e 1507 -DTARGET_NAME=\"$(target_noncanonical)\" \
96a9c44f 1508 -c $(srcdir)/toplev.c $(OUTPUT_OPTION)
4977bab6 1509main.o : main.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h
79d8453e 1510
476d9098
GK
1511host-default.o : host-default.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
1512 hosthooks.h hosthooks-def.h
1513
4977bab6 1514rtl-error.o: rtl-error.c $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(INSN_ATTR_H) \
b6fe0bb8 1515 insn-config.h input.h toplev.h intl.h $(DIAGNOSTIC_H) $(CONFIG_H)
c895acf2 1516
4977bab6
ZW
1517rtl.o : rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(RTL_H) real.h \
1518 $(GGC_H) errors.h
9196ece5 1519 $(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
79d8453e 1520
4977bab6 1521print-rtl.o : print-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
94134f42 1522 hard-reg-set.h $(BASIC_BLOCK_H) real.h $(TM_P_H)
4977bab6 1523rtlanal.o : rtlanal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h $(RTL_H) \
52bfebf0 1524 hard-reg-set.h $(TM_P_H) insn-config.h $(RECOG_H) real.h flags.h
bc204393 1525
e5610450 1526errors.o : errors.c $(CONFIG_H) $(SYSTEM_H) errors.h
9196ece5 1527 $(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
79d8453e 1528
4977bab6
ZW
1529varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
1530 flags.h function.h $(EXPR_H) hard-reg-set.h $(REGS_H) \
440aabf8 1531 output.h c-pragma.h toplev.h xcoffout.h debug.h $(GGC_H) $(TM_P_H) \
907aee69 1532 $(HASHTAB_H) $(TARGET_H) langhooks.h gt-varasm.h real.h
4977bab6 1533function.o : function.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
c6b97fac 1534 flags.h function.h $(EXPR_H) $(OPTABS_H) libfuncs.h $(REGS_H) hard-reg-set.h \
e2500fed 1535 insn-config.h $(RECOG_H) output.h toplev.h except.h $(HASHTAB_H) $(GGC_H) \
61f71b34 1536 $(TM_P_H) langhooks.h gt-function.h $(TARGET_H)
4977bab6
ZW
1537stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) flags.h \
1538 function.h insn-config.h hard-reg-set.h $(EXPR_H) libfuncs.h except.h \
43577e6b 1539 $(LOOP_H) $(RECOG_H) toplev.h output.h varray.h $(GGC_H) $(TM_P_H) \
61f71b34 1540 langhooks.h $(PREDICT_H) gt-stmt.h $(OPTABS_H) $(TARGET_H)
dd07abd7
RH
1541except.o : except.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
1542 $(TREE_H) flags.h except.h function.h $(EXPR_H) libfuncs.h $(INTEGRATE_H) \
1543 langhooks.h insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \
e2500fed 1544 dwarf2asm.h dwarf2out.h toplev.h $(HASHTAB_H) intl.h $(GGC_H) \
dd07abd7 1545 gt-except.h cgraph.h
4977bab6 1546expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) flags.h \
dd220c49 1547 function.h $(REGS_H) $(EXPR_H) $(OPTABS_H) libfuncs.h $(INSN_ATTR_H) insn-config.h \
34e81b5a 1548 $(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
11ad4784 1549 except.h reload.h $(GGC_H) langhooks.h intl.h $(TM_P_H) real.h
1cff8964 1550dojump.o : dojump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
dd220c49 1551 flags.h function.h $(EXPR_H) $(OPTABS_H) $(INSN_ATTR_H) insn-config.h \
1cff8964 1552 langhooks.h
4977bab6
ZW
1553builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H)\
1554 flags.h $(TARGET_H) function.h $(REGS_H) $(EXPR_H) $(OPTABS_H) insn-config.h \
28f4ec01 1555 $(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \
a77a9a18 1556 except.h $(TM_P_H) $(PREDICT_H) libfuncs.h real.h langhooks.h
4977bab6 1557calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) flags.h \
6e985040 1558 $(EXPR_H) $(OPTABS_H) langhooks.h $(TARGET_H) \
b2dd096b 1559 libfuncs.h $(REGS_H) toplev.h output.h function.h $(TIMEVAR_H) $(TM_P_H) cgraph.h except.h
4977bab6
ZW
1560expmed.o : expmed.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
1561 flags.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) real.h \
b0c48229 1562 toplev.h $(TM_P_H) langhooks.h
4977bab6
ZW
1563explow.o : explow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
1564 flags.h hard-reg-set.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) \
dd220c49 1565 toplev.h function.h $(GGC_H) $(TM_P_H) gt-explow.h
4977bab6
ZW
1566optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
1567 flags.h insn-config.h $(EXPR_H) $(OPTABS_H) libfuncs.h $(RECOG_H) reload.h \
c15c90bb
ZW
1568 toplev.h $(GGC_H) real.h $(TM_P_H) except.h gt-optabs.h $(BASIC_BLOCK_H) \
1569 target.h
4977bab6
ZW
1570dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
1571 flags.h $(REGS_H) debug.h $(TM_P_H) $(TARGET_H) function.h langhooks.h \
17211ab5
GK
1572 insn-config.h reload.h gstab.h xcoffout.h output.h dbxout.h toplev.h \
1573 $(GGC_H) gt-dbxout.h
4977bab6
ZW
1574debug.o : debug.c debug.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
1575sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
1576 flags.h function.h $(EXPR_H) output.h hard-reg-set.h $(REGS_H) real.h \
17211ab5 1577 insn-config.h xcoffout.h c-pragma.h $(GGC_H) $(TARGET_H) \
e2500fed 1578 sdbout.h toplev.h $(TM_P_H) except.h debug.h langhooks.h gt-sdbout.h
4977bab6
ZW
1579dwarfout.o : dwarfout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
1580 $(RTL_H) dwarf.h flags.h insn-config.h reload.h output.h toplev.h $(TM_P_H) \
69bd9368 1581 debug.h langhooks.h $(TARGET_H)
4977bab6 1582dwarf2out.o : dwarf2out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
b6fe0bb8 1583 $(RTL_H) dwarf2.h debug.h flags.h insn-config.h reload.h output.h $(DIAGNOSTIC_H) real.h \
e78d8e51 1584 hard-reg-set.h $(REGS_H) $(EXPR_H) libfuncs.h toplev.h dwarf2out.h varray.h \
69bd9368
RS
1585 $(GGC_H) except.h dwarf2asm.h $(TM_P_H) langhooks.h $(HASHTAB_H) \
1586 gt-dwarf2out.h $(TARGET_H)
4977bab6 1587dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) flags.h $(RTL_H) \
17211ab5 1588 $(TREE_H) output.h dwarf2asm.h $(TM_P_H) $(GGC_H) gt-dwarf2asm.h
4977bab6
ZW
1589vmsdbgout.o : vmsdbgout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
1590 $(RTL_H) flags.h output.h vmsdbg.h debug.h langhooks.h function.h $(TARGET_H)
1591xcoffout.o : xcoffout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \
1592 xcoffout.h flags.h toplev.h output.h dbxout.h $(GGC_H) $(TARGET_H)
1593emit-rtl.o : emit-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
1594 flags.h function.h $(REGS_H) insn-config.h $(RECOG_H) real.h $(GGC_H) \
dd220c49 1595 $(EXPR_H) $(OBSTACK_H) hard-reg-set.h bitmap.h toplev.h \
5ba6918e 1596 $(HASHTAB_H) $(TM_P_H) debug.h langhooks.h gt-emit-rtl.h
4977bab6
ZW
1597real.o : real.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) toplev.h $(TM_P_H)
1598integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
1599 flags.h debug.h $(INTEGRATE_H) insn-config.h $(EXPR_H) real.h $(REGS_H) \
c6d9a88c 1600 intl.h function.h output.h $(RECOG_H) except.h toplev.h $(LOOP_H) \
e2500fed 1601 $(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h gt-integrate.h
4977bab6
ZW
1602jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
1603 hard-reg-set.h $(REGS_H) insn-config.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \
49468c8b 1604 toplev.h $(INSN_ATTR_H) $(TM_P_H) reload.h $(PREDICT_H) $(TIMEVAR_H) \
b6fe0bb8 1605 $(DIAGNOSTIC_H)
79d8453e 1606
4977bab6
ZW
1607simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
1608 $(REGS_H) hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
7daebb7a 1609 output.h function.h $(GGC_H) $(OBSTACK_H) $(TM_P_H) $(TREE_H) $(TARGET_H)
e72fcfe8 1610cgraph.o : cgraph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
dd220c49 1611 langhooks.h toplev.h flags.h $(GGC_H) $(TARGET_H) cgraph.h gt-cgraph.h output.h
1c4a429a 1612cgraphunit.o : cgraphunit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
dd220c49 1613 langhooks.h tree-inline.h toplev.h flags.h $(GGC_H) $(TARGET_H) cgraph.h
ca29da43
NS
1614coverage.o : coverage.c gcov-io.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
1615 $(TM_H) $(RTL_H) $(TREE_H) flags.h output.h $(REGS_H) $(EXPR_H) function.h \
1616 toplev.h $(GGC_H) $(TARGET_H) langhooks.h $(COVERAGE_H) libfuncs.h \
1617 gt-coverage.h $(HASHTAB_H)
4977bab6 1618cselib.o : cselib.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
0cedb36c 1619 hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
e2500fed 1620 output.h function.h cselib.h $(GGC_H) $(TM_P_H) gt-cselib.h
4977bab6 1621cse.o : cse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
3c50106f
RH
1622 hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
1623 output.h function.h $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_H) \
9bf8cfbf 1624 except.h $(TARGET_H) $(PARAMS_H)
62551c66
JH
1625web.o : web.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
1626 hard-reg-set.h flags.h $(BASIC_BLOCK_H) function.h output.h toplev.h df.h
4977bab6 1627gcse.o : gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
dd220c49 1628 hard-reg-set.h flags.h real.h insn-config.h $(GGC_H) $(RECOG_H) $(EXPR_H) \
4977bab6
ZW
1629 $(BASIC_BLOCK_H) function.h output.h toplev.h $(TM_P_H) $(PARAMS_H) except.h gt-gcse.h
1630sibcall.o : sibcall.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
1631 function.h hard-reg-set.h flags.h insn-config.h $(RECOG_H) $(BASIC_BLOCK_H)
1632resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h $(SYSTEM_H) coretypes.h \
1633 $(TM_H) $(BASIC_BLOCK_H) $(REGS_H) flags.h output.h resource.h function.h toplev.h \
639bc36c 1634 $(INSN_ATTR_H) except.h $(PARAMS_H) $(TM_P_H)
4977bab6
ZW
1635lcm.o : lcm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
1636 hard-reg-set.h flags.h real.h insn-config.h $(INSN_ATTR_H) $(RECOG_H) $(EXPR_H) \
fa1a0d02 1637 $(BASIC_BLOCK_H) $(TM_P_H) df.h function.h
4977bab6
ZW
1638ssa.o : ssa.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) varray.h \
1639 $(EXPR_H) hard-reg-set.h flags.h function.h real.h insn-config.h $(RECOG_H) \
b53978a3 1640 $(BASIC_BLOCK_H) output.h ssa.h
4977bab6 1641ssa-dce.o : ssa-dce.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) hard-reg-set.h \
0b47e4c1 1642 $(BASIC_BLOCK_H) ssa.h insn-config.h $(RECOG_H) output.h
dd220c49 1643ssa-ccp.o : ssa-ccp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) hard-reg-set.h \
0b47e4c1
JL
1644 $(BASIC_BLOCK_H) ssa.h insn-config.h $(RECOG_H) output.h \
1645 errors.h $(GGC_H) df.h function.h
38afe605 1646df.o : df.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
873ceaab 1647 insn-config.h $(RECOG_H) function.h $(REGS_H) alloc-pool.h hard-reg-set.h \
4977bab6
ZW
1648 $(BASIC_BLOCK_H) df.h $(FIBHEAP_H)
1649conflict.o : conflict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(OBSTACK_H) \
1650 $(HASHTAB_H) $(RTL_H) hard-reg-set.h $(BASIC_BLOCK_H)
ca29da43
NS
1651profile.o : profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
1652 $(TREE_H) flags.h output.h $(REGS_H) $(EXPR_H) function.h \
af166e5d
ZD
1653 toplev.h $(BASIC_BLOCK_H) $(COVERAGE_H) $(TREE_H) value-prof.h
1654value-prof.o : value-prof.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
1655 $(BASIC_BLOCK_H) hard-reg-set.h value-prof.h $(EXPR_H) output.h flags.h \
fca9dc00 1656 $(RECOG_H) insn-config.h $(OPTABS_H) $(REGS_H)
4977bab6 1657loop.o : loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h $(LOOP_H) \
e78d8e51 1658 insn-config.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) \
3d436d2a 1659 real.h $(PREDICT_H) $(BASIC_BLOCK_H) function.h cfgloop.h \
11303d15 1660 toplev.h varray.h except.h cselib.h $(OPTABS_H) $(TM_P_H)
4977bab6 1661doloop.o : doloop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
3d436d2a
ZD
1662 $(LOOP_H) $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H) toplev.h \
1663 cfgloop.h
4977bab6
ZW
1664unroll.o : unroll.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) insn-config.h \
1665 function.h $(INTEGRATE_H) $(REGS_H) $(RECOG_H) flags.h $(EXPR_H) $(LOOP_H) toplev.h \
3d436d2a
ZD
1666 hard-reg-set.h varray.h $(BASIC_BLOCK_H) $(TM_P_H) $(PREDICT_H) $(PARAMS_H) \
1667 cfgloop.h
7f22efe1 1668alloc-pool.o : alloc-pool.c $(CONFIG_H) $(SYSTEM_H) alloc-pool.h
4977bab6
ZW
1669flow.o : flow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
1670 flags.h insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \
1671 $(RECOG_H) function.h except.h $(EXPR_H) ssa.h $(GGC_H) $(TM_P_H)
1672cfg.o : cfg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h insn-config.h \
402209ff 1673 $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
f6cb56fa 1674 function.h except.h $(GGC_H) $(TM_P_H) alloc-pool.h
9ee634e3
JH
1675cfghooks.o: cfghooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
1676 $(BASIC_BLOCK_H) cfglayout.h
4977bab6
ZW
1677cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
1678 insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
ff25ef99 1679 function.h except.h $(GGC_H) $(TM_P_H) insn-config.h $(EXPR_H)
4977bab6
ZW
1680cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
1681 $(BASIC_BLOCK_H) hard-reg-set.h insn-config.h $(RECOG_H) $(GGC_H) $(TM_P_H)
1682cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
1683 insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
0f81faf6 1684 function.h except.h $(GGC_H)
5f24e0dc
RH
1685cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
1686 $(RTL_H) $(TIMEVAR_H) $(BASIC_BLOCK_H) hard-reg-set.h output.h flags.h \
1687 $(RECOG_H) toplev.h $(GGC_H) insn-config.h cselib.h $(TARGET_H) $(TM_P_H) \
1688 $(PARAMS_H)
cd68f4e4 1689cfgloop.o : cfgloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) coretypes.h $(TM_H) \
3d436d2a
ZD
1690 $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h flags.h
1691cfgloopanal.o : cfgloopanal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
cd68f4e4 1692 $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h $(EXPR_H) coretypes.h $(TM_H)
3d436d2a 1693cfgloopmanip.o : cfgloopmanip.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
cd68f4e4 1694 $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h cfglayout.h output.h coretypes.h $(TM_H)
94de45d9 1695loop-init.o : loop-init.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
ca29da43 1696 $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h cfglayout.h \
617b465c
ZD
1697 coretypes.h $(TM_H)
1698loop-unswitch.o : loop-unswitch.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \
dd220c49 1699 $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h cfglayout.h $(PARAMS_H) \
617b465c 1700 output.h $(EXPR_H) coretypes.h $(TM_H)
b17d5d7c 1701loop-unroll.o: loop-unroll.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \
dd220c49 1702 $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h cfglayout.h $(PARAMS_H) \
b17d5d7c 1703 output.h $(EXPR_H) coretypes.h $(TM_H)
4977bab6
ZW
1704dominance.o : dominance.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
1705 hard-reg-set.h $(BASIC_BLOCK_H) et-forest.h
7f22efe1 1706et-forest.o : et-forest.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) et-forest.h alloc-pool.h
4977bab6
ZW
1707combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
1708 function.h insn-config.h $(INSN_ATTR_H) $(REGS_H) $(EXPR_H) \
61f71b34 1709 $(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h toplev.h $(TM_P_H) $(TREE_H) $(TARGET_H)
4977bab6
ZW
1710regclass.o : regclass.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
1711 hard-reg-set.h flags.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(RECOG_H) reload.h \
0d446150 1712 real.h toplev.h function.h output.h $(GGC_H) $(TM_P_H) $(EXPR_H) $(TIMEVAR_H)
4977bab6
ZW
1713local-alloc.o : local-alloc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
1714 flags.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
a4d3961a 1715 output.h function.h $(INSN_ATTR_H) toplev.h except.h $(TM_P_H)
4977bab6 1716bitmap.o : bitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(RTL_H) flags.h \
e2500fed 1717 $(BASIC_BLOCK_H) $(REGS_H) $(GGC_H)
9196ece5 1718 $(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
4977bab6
ZW
1719global.o : global.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
1720 reload.h function.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h output.h \
1721 toplev.h $(TM_P_H)
1722varray.o : varray.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) varray.h $(GGC_H) errors.h
1723ra.o : ra.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TM_P_H) insn-config.h \
dd220c49
KG
1724 $(RECOG_H) $(INTEGRATE_H) function.h $(REGS_H) $(OBSTACK_H) hard-reg-set.h \
1725 $(BASIC_BLOCK_H) df.h $(EXPR_H) output.h toplev.h flags.h reload.h ra.h
4977bab6 1726ra-build.o : ra-build.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TM_P_H) \
ed8d2920 1727 insn-config.h $(RECOG_H) function.h $(REGS_H) hard-reg-set.h \
dd220c49 1728 $(BASIC_BLOCK_H) df.h output.h $(GGC_H) ra.h gt-ra-build.h reload.h
4977bab6
ZW
1729ra-colorize.o : ra-colorize.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
1730 $(TM_P_H) function.h $(REGS_H) hard-reg-set.h $(BASIC_BLOCK_H) df.h output.h ra.h
1731ra-debug.o : ra-debug.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
1732 insn-config.h $(RECOG_H) function.h hard-reg-set.h $(BASIC_BLOCK_H) df.h output.h \
1733 ra.h $(TM_P_H)
1734ra-rewrite.o : ra-rewrite.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
dd220c49 1735 $(TM_P_H) function.h $(REGS_H) hard-reg-set.h $(BASIC_BLOCK_H) df.h $(EXPR_H) \
54b2a7f8 1736 output.h except.h ra.h reload.h insn-config.h
4977bab6 1737reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h output.h \
e78d8e51
ZW
1738 $(EXPR_H) $(OPTABS_H) reload.h $(RECOG_H) hard-reg-set.h insn-config.h \
1739 $(REGS_H) function.h real.h toplev.h $(TM_P_H)
4977bab6 1740reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) real.h flags.h \
d9e674f7
KH
1741 $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \
1742 $(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h $(TM_P_H) \
1743 except.h $(TREE_H)
1744postreload.o : postreload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) real.h flags.h \
e78d8e51 1745 $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \
39f95a2c 1746 $(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h cselib.h $(TM_P_H) \
a20fd5ac 1747 except.h $(TREE_H)
4977bab6
ZW
1748caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
1749 flags.h $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) function.h \
830a47ec 1750 $(RECOG_H) reload.h $(EXPR_H) toplev.h $(TM_P_H)
e22340b0 1751bt-load.o : bt-load.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
8f7193b8 1752 $(BASIC_BLOCK_H) $(RTL_H) hard-reg-set.h $(REGS_H) $(OBSTACK_H) $(TM_P_H) \
fe3ad572 1753 $(FIBHEAP_H) output.h $(TARGET_H) $(EXPR_H) flags.h $(INSN_ATTR_H)
4977bab6
ZW
1754reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) conditions.h \
1755 hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(INSN_ATTR_H) except.h \
639bc36c 1756 $(RECOG_H) function.h flags.h output.h $(EXPR_H) toplev.h $(PARAMS_H) $(TM_P_H)
4977bab6
ZW
1757alias.o : alias.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
1758 hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) toplev.h output.h $(EXPR_H) \
e2500fed 1759 $(GGC_H) function.h cselib.h $(TREE_H) $(TM_P_H) langhooks.h $(TARGET_H) \
b255a036 1760 gt-alias.h $(TIMEVAR_H) cgraph.h
4977bab6 1761regmove.o : regmove.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) insn-config.h \
4b983fdc 1762 $(RECOG_H) output.h $(REGS_H) hard-reg-set.h flags.h function.h \
8461e984 1763 $(EXPR_H) $(BASIC_BLOCK_H) toplev.h $(TM_P_H) except.h reload.h
4977bab6
ZW
1764haifa-sched.o : haifa-sched.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
1765 sched-int.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
c237e94a 1766 $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(TARGET_H)
4977bab6
ZW
1767sched-deps.o : sched-deps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
1768 sched-int.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
4b6c5340 1769 $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h cselib.h $(PARAMS_H) $(TM_P_H)
4977bab6
ZW
1770sched-rgn.o : sched-rgn.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
1771 sched-int.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
fae15c93 1772 $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(TARGET_H)
4977bab6
ZW
1773sched-ebb.o : sched-ebb.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
1774 sched-int.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \
ca29da43 1775 $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(PARAMS_H)
4977bab6
ZW
1776sched-vis.o : sched-vis.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
1777 sched-int.h hard-reg-set.h $(BASIC_BLOCK_H) $(INSN_ATTR_H) $(REGS_H) $(TM_P_H) \
b3ae1ccd 1778 $(TARGET_H) real.h
4977bab6
ZW
1779final.o : final.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
1780 flags.h intl.h $(REGS_H) $(RECOG_H) conditions.h insn-config.h $(INSN_ATTR_H) \
1781 function.h real.h output.h hard-reg-set.h except.h debug.h xcoffout.h \
1782 toplev.h reload.h dwarf2out.h $(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H) \
1783 $(EXPR_H)
1784recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) function.h \
1785 $(BASIC_BLOCK_H) $(REGS_H) $(RECOG_H) $(EXPR_H) hard-reg-set.h flags.h insn-config.h \
da920570 1786 $(INSN_ATTR_H) real.h toplev.h output.h reload.h $(TM_P_H)
4977bab6
ZW
1787reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
1788 $(RECOG_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h toplev.h reload.h \
e2500fed 1789 varray.h function.h $(TM_P_H) $(GGC_H) gt-reg-stack.h
ac5e69da 1790sreal.o: sreal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) sreal.h
4977bab6
ZW
1791predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
1792 flags.h insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \
ac5e69da 1793 $(RECOG_H) function.h except.h $(EXPR_H) $(TM_P_H) $(PREDICT_H) sreal.h \
ca29da43 1794 $(PARAMS_H) $(TARGET_H) cfgloop.h $(COVERAGE_H)
4977bab6 1795lists.o: lists.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h $(RTL_H) $(GGC_H)
aa634f11
JZ
1796bb-reorder.o : bb-reorder.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
1797 $(RTL_H) $(BASIC_BLOCK_H) flags.h output.h cfglayout.h $(FIBHEAP_H) \
1798 $(TARGET_H)
4977bab6 1799tracer.o : tracer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
5c856b23 1800 $(BASIC_BLOCK_H) hard-reg-set.h output.h cfglayout.h flags.h \
ca29da43 1801 $(PARAMS_H) $(COVERAGE_H)
0b077eac
RH
1802cfglayout.o : cfglayout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
1803 $(RTL_H) $(TREE_H) insn-config.h $(BASIC_BLOCK_H) hard-reg-set.h output.h \
0435312e 1804 function.h cfglayout.h cfgloop.h $(TARGET_H) gt-cfglayout.h $(GGC_H)
4977bab6 1805timevar.o : timevar.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TIMEVAR_H) flags.h \
dd1b7476 1806 intl.h toplev.h
4977bab6
ZW
1807regrename.o : regrename.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
1808 insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h $(RECOG_H) function.h \
11642c3a 1809 resource.h $(OBSTACK_H) flags.h $(TM_P_H)
2ef0a555 1810ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
11a004ef 1811 $(REGS_H) toplev.h flags.h insn-config.h function.h $(RECOG_H) target.h \
65f43cdf
ZD
1812 $(BASIC_BLOCK_H) $(EXPR_H) output.h except.h $(TM_P_H) real.h $(OPTABS_H) \
1813 cfgloop.h
4977bab6
ZW
1814params.o : params.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(PARAMS_H) toplev.h
1815hooks.o: hooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(HOOKS_H)
b6fe0bb8 1816pretty-print.o: pretty-print.c $(PRETTY_PRINT_H)
d061bc1e 1817
4977bab6 1818$(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) $(GGC_H) \
6feacd09 1819 $(RTL_H) $(REGS_H) hard-reg-set.h real.h insn-config.h conditions.h \
e78d8e51 1820 output.h $(INSN_ATTR_H) $(SYSTEM_H) toplev.h $(TARGET_H) libfuncs.h \
3ac88239
NB
1821 $(TARGET_DEF_H) function.h sched-int.h $(TM_P_H) $(EXPR_H) $(OPTABS_H) \
1822 langhooks.h
b8dad04b
ZW
1823 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1824 $(out_file) $(OUTPUT_OPTION)
79d8453e 1825
4e0db2ce
RK
1826# Build auxiliary files that support ecoff format.
1827mips-tfile: mips-tfile.o version.o $(LIBDEPS)
aab26e16 1828 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS)
4e0db2ce 1829
4977bab6 1830mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) coretypes.h $(TM_H) version.h
4e0db2ce
RK
1831
1832mips-tdump: mips-tdump.o version.o $(LIBDEPS)
aab26e16 1833 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tdump.o version.o $(LIBS)
4e0db2ce 1834
d90f9882 1835mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) coretypes.h $(TM_H) version.h
4e0db2ce 1836
d1bd0ded
GK
1837# FIXME: writing proper dependencies for this is a *LOT* of work.
1838libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
1839 insn-config.h insn-flags.h insn-codes.h insn-constants.h \
d2908a50 1840 insn-attr.h
d1bd0ded 1841 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
caa55b1e 1842 -DTARGET_NAME=\"$(target_noncanonical)\" \
d1bd0ded
GK
1843 -DLOCALEDIR=\"$(localedir)\" \
1844 -c $(filter %.c,$^) -o $@
1845
544eb21e 1846#\f
4c457b6b 1847# Generate header and source files from the machine description,
79d8453e
RS
1848# and compile them.
1849
1b0c37d7 1850.PRECIOUS: insn-config.h insn-flags.h insn-codes.h insn-constants.h \
79d8453e
RS
1851 insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \
1852 insn-attr.h insn-attrtab.c
1853
1854# The following pair of rules has this effect:
1855# genconfig is run only if the md has changed since genconfig was last run;
1856# but the file insn-config.h is touched only when its contents actually change.
1857
1858# Each of the other insn-* files is handled by a similar pair of rules.
1859
1402d22c 1860# This causes an anomaly in the results of make -n
e5e809f4 1861# because insn-* is older than s-*
1402d22c
RS
1862# and thus make -n thinks that insn-* will be updated
1863# and force recompilation of things that depend on it.
424aa086 1864# We use move-if-change precisely to avoid such recompilation.
1402d22c
RS
1865# But there is no way to teach make -n that it will be avoided.
1866
79d8453e
RS
1867# Each of the insn-*.[ch] rules has a semicolon at the end,
1868# for otherwise the system Make on SunOS 4.1 never tries
7bd95cc1
BK
1869# to recompile insn-*.o. To avoid problems and extra noise from
1870# versions of make which don't like empty commands (nothing after the
1871# trailing `;'), we call true for each.
79d8453e 1872
e5e809f4 1873insn-config.h: s-config ; @true
193ad8c6 1874s-config : $(md_file) genconfig$(build_exeext) $(srcdir)/move-if-change
414d23ae 1875 $(RUN_GEN) ./genconfig$(build_exeext) $(md_file) > tmp-config.h
84c81320 1876 $(SHELL) $(srcdir)/move-if-change tmp-config.h insn-config.h
d9835ae8 1877 $(STAMP) s-config
79d8453e 1878
2199e5fa
ZW
1879insn-conditions.c: s-conditions ; @true
1880s-conditions : $(md_file) genconditions$(build_exeext) $(srcdir)/move-if-change
414d23ae 1881 $(RUN_GEN) ./genconditions$(build_exeext) $(md_file) > tmp-conditions.c
2199e5fa
ZW
1882 $(SHELL) $(srcdir)/move-if-change tmp-conditions.c insn-conditions.c
1883 $(STAMP) s-conditions
1884
4977bab6
ZW
1885insn-conditions.o : insn-conditions.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
1886 $(GTM_H) $(RTL_H) $(TM_P_H) $(REGS_H) function.h $(RECOG_H) real.h output.h \
1887 flags.h hard-reg-set.h resource.h toplev.h reload.h gensupport.h \
1888 insn-constants.h
eaf9f3b2 1889 $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) insn-conditions.c
2199e5fa 1890
4977bab6
ZW
1891dummy-conditions.o : dummy-conditions.c $(BCONFIG_H) $(SYSTEM_H) \
1892 coretypes.h $(GTM_H) gensupport.h
2199e5fa 1893
e5e809f4 1894insn-flags.h: s-flags ; @true
193ad8c6 1895s-flags : $(md_file) genflags$(build_exeext) $(srcdir)/move-if-change
414d23ae 1896 $(RUN_GEN) ./genflags$(build_exeext) $(md_file) > tmp-flags.h
84c81320 1897 $(SHELL) $(srcdir)/move-if-change tmp-flags.h insn-flags.h
d9835ae8 1898 $(STAMP) s-flags
79d8453e 1899
e5e809f4 1900insn-codes.h: s-codes ; @true
193ad8c6 1901s-codes : $(md_file) gencodes$(build_exeext) $(srcdir)/move-if-change
414d23ae 1902 $(RUN_GEN) ./gencodes$(build_exeext) $(md_file) > tmp-codes.h
84c81320 1903 $(SHELL) $(srcdir)/move-if-change tmp-codes.h insn-codes.h
d9835ae8 1904 $(STAMP) s-codes
79d8453e 1905
1b0c37d7
ZW
1906insn-constants.h: s-constants ; @true
1907s-constants : $(md_file) genconstants$(build_exeext) $(srcdir)/move-if-change
414d23ae 1908 $(RUN_GEN) ./genconstants$(build_exeext) $(md_file) > tmp-constants.h
1b0c37d7
ZW
1909 $(SHELL) $(srcdir)/move-if-change tmp-constants.h insn-constants.h
1910 $(STAMP) s-constants
1911
4977bab6
ZW
1912insn-emit.o : insn-emit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
1913 $(RTL_H) $(EXPR_H) real.h output.h insn-config.h $(OPTABS_H) reload.h \
1914 $(RECOG_H) toplev.h function.h flags.h hard-reg-set.h resource.h $(TM_P_H)
96a9c44f
DR
1915 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c \
1916 $(OUTPUT_OPTION)
79d8453e 1917
e5e809f4 1918insn-emit.c: s-emit ; @true
193ad8c6 1919s-emit : $(md_file) genemit$(build_exeext) $(srcdir)/move-if-change
414d23ae 1920 $(RUN_GEN) ./genemit$(build_exeext) $(md_file) > tmp-emit.c
84c81320 1921 $(SHELL) $(srcdir)/move-if-change tmp-emit.c insn-emit.c
d9835ae8 1922 $(STAMP) s-emit
79d8453e 1923
4977bab6
ZW
1924insn-recog.o : insn-recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
1925 $(RTL_H) insn-config.h $(RECOG_H) real.h output.h flags.h function.h \
1926 hard-reg-set.h resource.h $(TM_P_H) toplev.h reload.h
96a9c44f
DR
1927 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-recog.c \
1928 $(OUTPUT_OPTION)
79d8453e 1929
e5e809f4 1930insn-recog.c: s-recog ; @true
193ad8c6 1931s-recog : $(md_file) genrecog$(build_exeext) $(srcdir)/move-if-change
414d23ae 1932 $(RUN_GEN) ./genrecog$(build_exeext) $(md_file) > tmp-recog.c
84c81320 1933 $(SHELL) $(srcdir)/move-if-change tmp-recog.c insn-recog.c
d9835ae8 1934 $(STAMP) s-recog
79d8453e 1935
4977bab6
ZW
1936insn-opinit.o : insn-opinit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
1937 $(RTL_H) insn-config.h flags.h $(RECOG_H) $(EXPR_H) $(OPTABS_H) reload.h
96a9c44f
DR
1938 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-opinit.c \
1939 $(OUTPUT_OPTION)
118bdbf8 1940
e5e809f4 1941insn-opinit.c: s-opinit ; @true
193ad8c6 1942s-opinit : $(md_file) genopinit$(build_exeext) $(srcdir)/move-if-change
414d23ae 1943 $(RUN_GEN) ./genopinit$(build_exeext) $(md_file) > tmp-opinit.c
84c81320 1944 $(SHELL) $(srcdir)/move-if-change tmp-opinit.c insn-opinit.c
d9835ae8 1945 $(STAMP) s-opinit
118bdbf8 1946
4977bab6
ZW
1947insn-extract.o : insn-extract.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
1948 $(RTL_H) toplev.h insn-config.h $(RECOG_H)
96a9c44f
DR
1949 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-extract.c \
1950 $(OUTPUT_OPTION)
79d8453e 1951
e5e809f4 1952insn-extract.c: s-extract ; @true
193ad8c6 1953s-extract : $(md_file) genextract$(build_exeext) $(srcdir)/move-if-change
414d23ae 1954 $(RUN_GEN) ./genextract$(build_exeext) $(md_file) > tmp-extract.c
84c81320 1955 $(SHELL) $(srcdir)/move-if-change tmp-extract.c insn-extract.c
d9835ae8 1956 $(STAMP) s-extract
79d8453e 1957
4977bab6
ZW
1958insn-peep.o : insn-peep.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
1959 $(RTL_H) $(REGS_H) output.h real.h insn-config.h $(RECOG_H) except.h \
1960 function.h $(TM_P_H)
96a9c44f
DR
1961 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c \
1962 $(OUTPUT_OPTION)
79d8453e 1963
e5e809f4 1964insn-peep.c: s-peep ; @true
193ad8c6 1965s-peep : $(md_file) genpeep$(build_exeext) $(srcdir)/move-if-change
414d23ae 1966 $(RUN_GEN) ./genpeep$(build_exeext) $(md_file) > tmp-peep.c
84c81320 1967 $(SHELL) $(srcdir)/move-if-change tmp-peep.c insn-peep.c
d9835ae8 1968 $(STAMP) s-peep
79d8453e 1969
4977bab6
ZW
1970insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
1971 $(RTL_H) $(REGS_H) real.h output.h $(INSN_ATTR_H) insn-config.h toplev.h \
1972 $(RECOG_H) $(TM_P_H) flags.h
96a9c44f
DR
1973 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-attrtab.c \
1974 $(OUTPUT_OPTION)
79d8453e 1975
e5e809f4 1976insn-attr.h: s-attr ; @true
193ad8c6 1977s-attr : $(md_file) genattr$(build_exeext) $(srcdir)/move-if-change
414d23ae 1978 $(RUN_GEN) ./genattr$(build_exeext) $(md_file) > tmp-attr.h
84c81320 1979 $(SHELL) $(srcdir)/move-if-change tmp-attr.h insn-attr.h
d9835ae8 1980 $(STAMP) s-attr
79d8453e 1981
e5e809f4 1982insn-attrtab.c: s-attrtab ; @true
193ad8c6 1983s-attrtab : $(md_file) genattrtab$(build_exeext) $(srcdir)/move-if-change
414d23ae 1984 $(RUN_GEN) ./genattrtab$(build_exeext) $(md_file) > tmp-attrtab.c
84c81320 1985 $(SHELL) $(srcdir)/move-if-change tmp-attrtab.c insn-attrtab.c
d9835ae8 1986 $(STAMP) s-attrtab
79d8453e 1987
4977bab6
ZW
1988insn-output.o : insn-output.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
1989 $(RTL_H) $(GGC_H) $(REGS_H) real.h conditions.h hard-reg-set.h \
1990 insn-config.h $(INSN_ATTR_H) $(EXPR_H) output.h $(RECOG_H) function.h \
1991 toplev.h flags.h insn-codes.h $(TM_P_H) $(TARGET_H)
96a9c44f
DR
1992 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-output.c \
1993 $(OUTPUT_OPTION)
79d8453e 1994
e5e809f4 1995insn-output.c: s-output ; @true
193ad8c6 1996s-output : $(md_file) genoutput$(build_exeext) $(srcdir)/move-if-change
414d23ae 1997 $(RUN_GEN) ./genoutput$(build_exeext) $(md_file) > tmp-output.c
84c81320 1998 $(SHELL) $(srcdir)/move-if-change tmp-output.c insn-output.c
d9835ae8 1999 $(STAMP) s-output
3b80f6ca 2000
4977bab6
ZW
2001genrtl.o : genrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
2002 $(GGC_H)
e5e809f4 2003genrtl.c genrtl.h : s-genrtl
a3f80023
AS
2004 @true # force gnu make to recheck modification times.
2005
0974c7d7 2006s-genrtl: gengenrtl$(build_exeext) $(srcdir)/move-if-change
414d23ae 2007 $(RUN_GEN) ./gengenrtl$(build_exeext) -h > tmp-genrtl.h
84c81320 2008 $(SHELL) $(srcdir)/move-if-change tmp-genrtl.h genrtl.h
414d23ae 2009 $(RUN_GEN) ./gengenrtl$(build_exeext) > tmp-genrtl.c
84c81320 2010 $(SHELL) $(srcdir)/move-if-change tmp-genrtl.c genrtl.c
d9835ae8 2011 $(STAMP) s-genrtl
1b0c37d7 2012
94134f42
ZW
2013insn-modes.o : insn-modes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
2014 $(MACHMODE_H) real.h
2015min-insn-modes.c insn-modes.c insn-modes.h : s-modes ; @true
0974c7d7
ZW
2016
2017s-modes: genmodes$(build_exeext) $(srcdir)/move-if-change
2018 $(RUN_GEN) ./genmodes$(build_exeext) -h > tmp-modes.h
2019 $(SHELL) $(srcdir)/move-if-change tmp-modes.h insn-modes.h
94134f42
ZW
2020 $(RUN_GEN) ./genmodes$(build_exeext) -m > tmp-min-modes.c
2021 $(SHELL) $(srcdir)/move-if-change tmp-min-modes.c min-insn-modes.c
0974c7d7
ZW
2022 $(RUN_GEN) ./genmodes$(build_exeext) > tmp-modes.c
2023 $(SHELL) $(srcdir)/move-if-change tmp-modes.c insn-modes.c
2024 $(STAMP) s-modes
2025
1b0c37d7
ZW
2026tm-preds.h: s-preds; @true
2027
2028s-preds: genpreds$(build_exeext) $(srcdir)/move-if-change
414d23ae 2029 $(RUN_GEN) ./genpreds$(build_exeext) > tmp-preds.h
1b0c37d7
ZW
2030 $(SHELL) $(srcdir)/move-if-change tmp-preds.h tm-preds.h
2031 $(STAMP) s-preds
2032
6060edcb 2033GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h $(srcdir)/cpplib.h \
17211ab5 2034 $(host_xm_file_list) $(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) \
ca29da43
NS
2035 $(srcdir)/bitmap.h $(srcdir)/coverage.c $(srcdir)/function.h $(srcdir)/rtl.h \
2036 $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/libfuncs.h $(srcdir)/hashtable.h \
2037 $(srcdir)/real.h $(srcdir)/varray.h $(srcdir)/ssa.h $(srcdir)/insn-addr.h \
ed2df68b 2038 $(srcdir)/cselib.h $(srcdir)/basic-block.h $(srcdir)/cgraph.h \
e2500fed 2039 $(srcdir)/c-common.h $(srcdir)/c-tree.h \
988d1653 2040 $(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \
17211ab5
GK
2041 $(srcdir)/dbxout.c $(srcdir)/dwarf2out.c $(srcdir)/dwarf2asm.c \
2042 $(srcdir)/emit-rtl.c $(srcdir)/except.c $(srcdir)/explow.c $(srcdir)/expr.c \
e2500fed
GK
2043 $(srcdir)/fold-const.c $(srcdir)/function.c \
2044 $(srcdir)/gcse.c $(srcdir)/integrate.c $(srcdir)/lists.c $(srcdir)/optabs.c \
ed8d2920 2045 $(srcdir)/profile.c $(srcdir)/ra-build.c $(srcdir)/regclass.c \
26e0dcb3 2046 $(srcdir)/reg-stack.c $(srcdir)/cfglayout.c $(srcdir)/langhooks.c \
e2500fed 2047 $(srcdir)/sdbout.c $(srcdir)/stmt.c $(srcdir)/stor-layout.c \
17211ab5 2048 $(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \
e2500fed 2049 $(out_file) \
e2500fed
GK
2050 @all_gtfiles@
2051
8ac9d31f
TJ
2052GTFILES_FILES_LANGS = @all_gtfiles_files_langs@
2053GTFILES_FILES_FILES = @all_gtfiles_files_files@
2054GTFILES_LANG_DIR_NAMES = @subdirs@
2055GTFILES_SRCDIR = @srcdir@
2056
ca29da43
NS
2057gt-cgraph.h gt-coverage.h gtype-desc.h gtype-desc.c gt-except.h \
2058gt-function.h gt-integrate.h gt-stmt.h gt-tree.h gt-varasm.h \
2059gt-emit-rtl.h gt-explow.h gt-stor-layout.h gt-regclass.h \
2060gt-lists.h gt-alias.h gt-cselib.h gt-fold-const.h gt-gcse.h \
2061gt-expr.h gt-sdbout.h gt-optabs.h gt-bitmap.h \
2062gt-dwarf2out.h gt-ra-build.h gt-reg-stack.h gt-dwarf2asm.h \
2063gt-dbxout.h gt-c-common.h gt-c-decl.h gt-c-parse.h \
4a46cbfb 2064gt-c-pragma.h gtype-c.h gt-input.h gt-cfglayout.h \
26e0dcb3 2065gt-stringpool.h gt-langhooks.h : s-gtype ; @true
e2500fed 2066
8ac9d31f
TJ
2067gtyp-gen.h: Makefile
2068 echo "/* This file is machine generated. Do not edit. */" > tmp-gtyp.h
83fa8d7a 2069 echo "static const char *const srcdir = " >> tmp-gtyp.h
8ac9d31f
TJ
2070 echo "\"$(GTFILES_SRCDIR)\"" >> tmp-gtyp.h
2071 echo ";" >> tmp-gtyp.h
83fa8d7a 2072 echo "static const char *const lang_files[] = {" >> tmp-gtyp.h
8ac9d31f
TJ
2073 ll="$(GTFILES_FILES_FILES)"; \
2074 for f in $$ll; do \
2075 echo "\"$$f\", "; done >> tmp-gtyp.h
2076 echo "NULL};" >> tmp-gtyp.h
83fa8d7a 2077 echo "static const char *const langs_for_lang_files[] = {" >> tmp-gtyp.h
8ac9d31f
TJ
2078 ff="$(GTFILES_FILES_LANGS)"; \
2079 for f in $$ff; do \
2080 echo "\"$$f\", " ; done >> tmp-gtyp.h
2081 echo "NULL};" >> tmp-gtyp.h
83fa8d7a 2082 echo "static const char *const all_files[] = {" >> tmp-gtyp.h
8ac9d31f
TJ
2083 gf="$(GTFILES)"; \
2084 for f in $$gf; do \
2085 echo "\"$$f\", "; done >> tmp-gtyp.h
2086 echo " NULL};" >> tmp-gtyp.h
83fa8d7a 2087 echo "static const char *const lang_dir_names[] = { \"c\", " >> tmp-gtyp.h
8ac9d31f
TJ
2088 gf="$(GTFILES_LANG_DIR_NAMES)"; \
2089 for l in $$gf; do \
2090 echo "\"$$l\", "; done >> tmp-gtyp.h
2091 echo "NULL};" >> tmp-gtyp.h
2092 $(SHELL) $(srcdir)/move-if-change tmp-gtyp.h gtyp-gen.h
2093
b835f6f1 2094s-gtype: gengtype$(build_exeext) $(GTFILES)
414d23ae 2095 $(RUN_GEN) ./gengtype
e2500fed
GK
2096 $(STAMP) s-gtype
2097
544eb21e 2098#\f
79d8453e 2099# Compile the programs that generate insn-* from the machine description.
eaf9f3b2 2100# They are compiled with $(CC_FOR_BUILD), and associated libraries,
79d8453e
RS
2101# since they need to run on this machine
2102# even if GCC is being compiled to run on some other machine.
2103
2104# $(CONFIG_H) is omitted from the deps of the gen*.o
4c457b6b 2105# because these programs don't really depend on anything
79d8453e
RS
2106# about the target machine. They do depend on config.h itself,
2107# since that describes the host machine.
2108
4b09846b
MM
2109# The names of programs that run on the "build" machine.
2110genprognames=genconfig genflags gencodes genemit genopinit genrecog \
2111 genextract genpeep genattr genoutput
2112
2113# The names of the executable files for those programs.
9b0f6145 2114genprogs=$(genprognames:%=%$(build_exeext))
4b09846b
MM
2115
2116# Object files used in those programs.
2117genobjs=$(genprognames:%=%.o) read-rtl.o gensupport.o genattrtab.o \
94134f42 2118 genautomata.o gengenrtl.o genmodes.o genpreds.o gengtype.o \
4b09846b
MM
2119 genconstants.o gen-protos.o scan.o fix-header.o scan-decls.o \
2120 gencheck.o dummy-conditions.o genconditions.o
2121
2122$(genprogs): %$(build_exeext): %.o $(BUILD_RTL) $(BUILD_SUPPORT) \
2123 $(BUILD_PRINT) $(BUILD_ERRORS) \
2124 $(BUILD_LIBDEPS)
2125 $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
2126 $< $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) \
2127 $(BUILD_ERRORS) $(BUILD_LIBS)
2128
2129$(genobjs): %.o : %.c
2130 $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2131
4977bab6 2132read-rtl.o: read-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(RTL_H) \
0f40f9f7 2133 $(OBSTACK_H) $(HASHTAB_H)
4977bab6
ZW
2134
2135gensupport.o: gensupport.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(RTL_H) \
2136 $(OBSTACK_H) errors.h $(HASHTAB_H) gensupport.h
4977bab6
ZW
2137
2138genconfig.o : genconfig.c $(RTL_H) $(BCONFIG_H) \
2139 $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
4977bab6
ZW
2140
2141genflags.o : genflags.c $(RTL_H) $(OBSTACK_H) $(BCONFIG_H) \
2142 $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
4977bab6
ZW
2143
2144gencodes.o : gencodes.c $(RTL_H) $(BCONFIG_H) \
2145 $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
4977bab6
ZW
2146
2147genconstants$(build_exeext) : genconstants.o $(BUILD_RTL) $(BUILD_EARLY_SUPPORT) \
2148 $(BUILD_ERRORS) $(BUILD_LIBDEPS)
eaf9f3b2 2149 $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
4977bab6
ZW
2150 genconstants.o $(BUILD_EARLY_SUPPORT) $(BUILD_RTL) \
2151 $(BUILD_ERRORS) $(BUILD_LIBS)
2152
2153genconstants.o : genconstants.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \
2154 errors.h
4977bab6
ZW
2155
2156genemit.o : genemit.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \
2157 errors.h gensupport.h
4977bab6
ZW
2158
2159genopinit.o : genopinit.c $(RTL_H) $(BCONFIG_H) \
2160 $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
4977bab6
ZW
2161
2162genrecog.o : genrecog.c $(RTL_H) $(BCONFIG_H) \
2163 $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
4977bab6
ZW
2164
2165genextract.o : genextract.c $(RTL_H) $(BCONFIG_H) \
2166 $(SYSTEM_H) coretypes.h $(GTM_H) insn-config.h errors.h gensupport.h
4977bab6
ZW
2167
2168genpeep.o : genpeep.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \
2169 errors.h gensupport.h
4977bab6
ZW
2170
2171genattr.o : genattr.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h \
2172 gensupport.h
79d8453e 2173
935bfb44 2174genattrtab$(build_exeext) : genattrtab.o genautomata.o \
4977bab6
ZW
2175 $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) $(BUILD_ERRORS) $(BUILD_VARRAY) \
2176 $(BUILD_LIBDEPS)
eaf9f3b2 2177 $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
935bfb44 2178 genattrtab.o genautomata.o \
4977bab6
ZW
2179 $(BUILD_RTL) $(BUILD_SUPPORT) $(BUILD_PRINT) $(BUILD_ERRORS) \
2180 $(BUILD_VARRAY) $(BUILD_LIBS) -lm
79d8453e 2181
4977bab6
ZW
2182genattrtab.o : genattrtab.c $(RTL_H) $(OBSTACK_H) $(BCONFIG_H) \
2183 $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(GGC_H) gensupport.h genattrtab.h
79d8453e 2184
4977bab6
ZW
2185genautomata.o : genautomata.c $(RTL_H) $(OBSTACK_H) $(BCONFIG_H) \
2186 $(SYSTEM_H) coretypes.h $(GTM_H) errors.h varray.h genattrtab.h $(HASHTAB_H)
79d8453e 2187
4977bab6
ZW
2188genoutput.o : genoutput.c $(RTL_H) $(BCONFIG_H) \
2189 $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h
3b80f6ca 2190
4977bab6 2191gengenrtl$(build_exeext) : gengenrtl.o $(BUILD_LIBDEPS)
eaf9f3b2 2192 $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
4977bab6 2193 gengenrtl.o $(BUILD_LIBS)
3b80f6ca 2194
0974c7d7
ZW
2195gengenrtl.o : gengenrtl.c $(BCONFIG_H) $(SYSTEM_H) rtl.def
2196
2197genmodes$(build_exeext) : genmodes.o $(BUILD_ERRORS) $(BUILD_LIBDEPS)
2198 $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
2199 genmodes.o $(BUILD_ERRORS) $(BUILD_LIBS)
2200
b8eaca23
ZW
2201genmodes.o : genmodes.c $(BCONFIG_H) $(SYSTEM_H) errors.h $(HASHTAB_H) \
2202 machmode.def $(extra_modes_file)
1b0c37d7 2203
4977bab6 2204genpreds$(build_exeext) : genpreds.o $(BUILD_LIBDEPS)
eaf9f3b2 2205 $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
4977bab6 2206 genpreds.o $(BUILD_LIBS)
1b0c37d7 2207
4977bab6 2208genpreds.o : genpreds.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H)
1b0c37d7 2209
e2500fed 2210gengtype$(build_exeext) : gengtype.o gengtype-lex.o gengtype-yacc.o \
4977bab6 2211 $(BUILD_LIBDEPS)
eaf9f3b2 2212 $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
4977bab6 2213 gengtype.o gengtype-lex.o gengtype-yacc.o $(BUILD_LIBS)
e2500fed 2214
4977bab6 2215gengtype.o : gengtype.c gengtype.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \
5ba6918e 2216 real.h $(RTL_BASE_H) gtyp-gen.h
e2500fed 2217
3859c32a 2218gengtype-lex.o : $(parsedir)/gengtype-lex.c gengtype.h $(parsedir)/gengtype-yacc.c \
4977bab6 2219 $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H)
eaf9f3b2 2220 $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
3859c32a 2221 $(parsedir)/gengtype-lex.c $(OUTPUT_OPTION)
e2500fed 2222
3859c32a 2223gengtype-yacc.o : $(parsedir)/gengtype-yacc.c gengtype.h $(BCONFIG_H) $(SYSTEM_H) \
4977bab6 2224 coretypes.h $(GTM_H)
eaf9f3b2 2225 $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
3859c32a 2226 $(parsedir)/gengtype-yacc.c $(OUTPUT_OPTION)
e2500fed 2227
3859c32a 2228$(parsedir)/gengtype-lex.c : $(srcdir)/gengtype-lex.l
e6e2802f 2229 if $(FLEX) $(FLEXFLAGS) -og-$$$$ $(srcdir)/gengtype-lex.l; then \
dcd1c2b8 2230 mv -f g-$$$$ $(parsedir)/gengtype-lex.c ; \
e66f55b8 2231 else \
dcd1c2b8 2232 rm -f g-$$$$ ; \
e66f55b8
KG
2233 false ; \
2234 fi
e2500fed 2235
3859c32a 2236$(parsedir)/gengtype-yacc.c: $(srcdir)/gengtype-yacc.y
dcd1c2b8
AS
2237 if $(BISON) $(BISONFLAGS) -d -o g-yacc.$$$$.c $(srcdir)/gengtype-yacc.y; then \
2238 mv -f g-yacc.$$$$.h $(parsedir)/gengtype-yacc.h; \
2239 mv -f g-yacc.$$$$.c $(parsedir)/gengtype-yacc.c; \
2240 else \
2241 rm -f g-yacc.$$$$.*; \
2242 false; \
2243 fi
e2500fed 2244
4977bab6
ZW
2245genconditions$(build_exeext) : genconditions.o $(BUILD_EARLY_SUPPORT) \
2246 $(BUILD_RTL) $(BUILD_ERRORS) $(BUILD_LIBDEPS)
eaf9f3b2 2247 $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
4977bab6
ZW
2248 genconditions.o $(BUILD_EARLY_SUPPORT) $(BUILD_RTL) \
2249 $(BUILD_ERRORS) $(BUILD_LIBS)
2199e5fa 2250
4977bab6
ZW
2251genconditions.o : genconditions.c $(RTL_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
2252 $(GTM_H) errors.h
2199e5fa 2253
544eb21e 2254#\f
79d8453e
RS
2255# Compile the libraries to be used by gen*.
2256# If we are not cross-building, gen* use the same .o's that cc1 will use,
5c35940c 2257# and BUILD_PREFIX_1 is `loser-', just to ensure these rules don't conflict
b548dffb 2258# with the rules for rtl.o, etc.
4977bab6 2259$(BUILD_PREFIX_1)rtl.o: $(srcdir)/rtl.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) $(RTL_H) \
66e918e5 2260 real.h $(GGC_H) errors.h
5c35940c 2261 rm -f $(BUILD_PREFIX)rtl.c
4977bab6 2262 sed -e 's/config[.]h/bconfig.h/' $(srcdir)/rtl.c > $(BUILD_PREFIX)rtl.c
eaf9f3b2 2263 $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)rtl.c $(OUTPUT_OPTION)
79d8453e 2264
4977bab6 2265print-rtl1.o: $(srcdir)/print-rtl.c $(BCONFIG_H) coretypes.h $(GTM_H) \
94134f42 2266 $(RTL_H) $(TREE_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H)
4d2d910c 2267 rm -f print-rtl1.c
4977bab6 2268 sed -e 's/config[.]h/bconfig.h/' $(srcdir)/print-rtl.c > print-rtl1.c
eaf9f3b2 2269 $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) print-rtl1.c $(OUTPUT_OPTION)
d3614a37 2270
4977bab6 2271$(BUILD_PREFIX_1)bitmap.o: $(srcdir)/bitmap.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) \
e2500fed 2272 $(RTL_H) flags.h $(BASIC_BLOCK_H) $(REGS_H) $(GGC_H)
5c35940c 2273 rm -f $(BUILD_PREFIX)bitmap.c
4977bab6 2274 sed -e 's/config[.]h/bconfig.h/' $(srcdir)/bitmap.c > $(BUILD_PREFIX)bitmap.c
eaf9f3b2 2275 $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)bitmap.c $(OUTPUT_OPTION)
0dfa1860 2276
e5610450 2277$(BUILD_PREFIX_1)errors.o: errors.c $(BCONFIG_H) $(SYSTEM_H) errors.h
5c35940c 2278 rm -f $(BUILD_PREFIX)errors.c
4977bab6 2279 sed -e 's/config[.]h/bconfig.h/' $(srcdir)/errors.c > $(BUILD_PREFIX)errors.c
eaf9f3b2 2280 $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)errors.c $(OUTPUT_OPTION)
f8b6598e 2281
4977bab6 2282$(BUILD_PREFIX_1)varray.o: varray.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) varray.h \
fde59d4b 2283 $(RTL_H) $(GGC_H) $(TREE_H) bitmap.h errors.h
5c35940c 2284 rm -f $(BUILD_PREFIX)varray.c
4977bab6 2285 sed -e 's/config[.]h/bconfig.h/' $(srcdir)/varray.c > \
5c35940c 2286 $(BUILD_PREFIX)varray.c
eaf9f3b2 2287 $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
5c35940c 2288 $(BUILD_PREFIX)varray.c $(OUTPUT_OPTION)
fae15c93 2289
4977bab6 2290$(BUILD_PREFIX_1)ggc-none.o: ggc-none.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) $(GGC_H)
5c35940c 2291 rm -f $(BUILD_PREFIX)ggc-none.c
4977bab6 2292 sed -e 's/config[.]h/bconfig.h/' $(srcdir)/ggc-none.c > $(BUILD_PREFIX)ggc-none.c
eaf9f3b2 2293 $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(BUILD_PREFIX)ggc-none.c $(OUTPUT_OPTION)
d7160de9 2294
94134f42
ZW
2295min-insn-modes.o: insn-modes.c $(BCONFIG_H) $(SYSTEM_H) $(MACHMODE_H)
2296 $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) \
2297 min-insn-modes.c $(OUTPUT_OPTION)
0974c7d7 2298
ab87f8c8
JL
2299#\f
2300# Remake internationalization support.
4977bab6 2301intl.o: intl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h Makefile
ab87f8c8
JL
2302 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2303 -DLOCALEDIR=\"$(localedir)\" \
96a9c44f 2304 -c $(srcdir)/intl.c $(OUTPUT_OPTION)
ab87f8c8 2305
5b7874aa
ZW
2306# Make-lang.in should add dependencies of po-generated on any generated
2307# files which need to be scanned by gettext (usually Yacc-generated parsers).
6ec3f553 2308po-generated: $(parsedir)/c-parse.c options.c
5b7874aa 2309
544eb21e 2310#\f
79d8453e
RS
2311# Remake cpp and protoize.
2312
d059a239
FF
2313PREPROCESSOR_DEFINES = \
2314 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
2315 -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
caa55b1e 2316 -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
98c2359b 2317 -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
793e9558 2318 -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
4977bab6 2319 -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
047d636f
DJ
2320 -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
2321 @TARGET_SYSTEM_ROOT_DEFINE@
79d8453e 2322
004cb263 2323LIBCPP_OBJS = cpplib.o cpplex.o cppmacro.o cppexp.o cppfiles.o cpptrad.o \
1613e52b 2324 cpphash.o cpperror.o cppinit.o cppcharset.o \
6338b358 2325 hashtable.o line-map.o mkdeps.o cpppch.o
19283265 2326
ef6e958a 2327LIBCPP_DEPS = $(CPPLIB_H) cpphash.h line-map.h hashtable.h intl.h \
bf42e45b 2328 $(OBSTACK_H) $(CONFIG_H) $(SYSTEM_H)
8ebb00d5 2329
a36556a8
ZW
2330# Most of the other archives built/used by this makefile are for
2331# targets. This one is strictly for the host.
19283265 2332libcpp.a: $(LIBCPP_OBJS)
b8d12d79 2333 -rm -rf libcpp.a
8f25d5cd 2334 $(AR) $(AR_FLAGS) libcpp.a $(LIBCPP_OBJS)
6822468a 2335 -$(RANLIB) libcpp.a
19283265 2336
e6cc3a24 2337cppcharset.o: cppcharset.c $(LIBCPP_DEPS) cppucnid.h
4977bab6
ZW
2338cpperror.o: cpperror.c $(LIBCPP_DEPS)
2339cppexp.o: cppexp.c $(LIBCPP_DEPS)
6338b358 2340cpplex.o: cpplex.c $(LIBCPP_DEPS)
4977bab6
ZW
2341cppmacro.o: cppmacro.c $(LIBCPP_DEPS)
2342cpplib.o: cpplib.c $(LIBCPP_DEPS)
2343cpphash.o: cpphash.c $(LIBCPP_DEPS)
2344cpptrad.o: cpptrad.c $(LIBCPP_DEPS)
bf42e45b 2345cppfiles.o: cppfiles.c $(LIBCPP_DEPS) $(HASHTAB_H) mkdeps.h
c1bad961 2346cppinit.o: cppinit.c $(LIBCPP_DEPS) mkdeps.h
17211ab5 2347cpppch.o: cpppch.c $(LIBCPP_DEPS) mkdeps.h
e915b770 2348
5793b276
NB
2349cppdefault.o: cppdefault.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
2350 cppdefault.h Makefile
59949f60 2351 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
d059a239 2352 $(PREPROCESSOR_DEFINES) \
96a9c44f 2353 -c $(srcdir)/cppdefault.c $(OUTPUT_OPTION)
5538ada6 2354
43839642
ZW
2355mkdeps.o: mkdeps.c $(CONFIG_H) $(SYSTEM_H) mkdeps.h
2356hashtable.o: hashtable.c hashtable.h $(CONFIG_H) $(SYSTEM_H) $(OBSTACK_H)
2357line-map.o: line-map.c line-map.h intl.h $(CONFIG_H) $(SYSTEM_H)
49e6c08e 2358
7bd95cc1
BK
2359# Note for the stamp targets, we run the program `true' instead of
2360# having an empty command (nothing following the semicolon).
2361
e09e14e9 2362proto: config.status protoize$(exeext) unprotoize$(exeext) SYSCALLS.c.X
79d8453e 2363
75a65e46 2364PROTO_OBJS = intl.o version.o cppdefault.o
ab87f8c8
JL
2365
2366protoize$(exeext): protoize.o $(PROTO_OBJS) $(LIBDEPS)
2367 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ protoize.o $(PROTO_OBJS) $(LIBS)
2e0b13db 2368
ab87f8c8
JL
2369unprotoize$(exeext): unprotoize.o $(PROTO_OBJS) $(LIBDEPS)
2370 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ unprotoize.o $(PROTO_OBJS) $(LIBS)
2e0b13db 2371
911e6107 2372protoize.o: protoize.c $(srcdir)/../include/getopt.h $(CONFIG_H) $(SYSTEM_H) \
4977bab6 2373 coretypes.h $(TM_H) Makefile version.h
8c310e3f
MM
2374 (SHLIB_LINK='$(SHLIB_LINK)' \
2375 SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
79d8453e 2376 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
75a65e46 2377 $(DRIVER_DEFINES) \
8c310e3f 2378 $(srcdir)/protoize.c $(OUTPUT_OPTION))
6c32c807 2379
75a65e46 2380unprotoize.o: protoize.c $(srcdir)/../include/getopt.h \
911e6107 2381 $(CONFIG_H) $(SYSTEM_H) Makefile version.h
8c310e3f
MM
2382 (SHLIB_LINK='$(SHLIB_LINK)' \
2383 SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
75a65e46
ZW
2384 $(CC) -c -DUNPROTOIZE $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2385 $(DRIVER_DEFINES) \
2386 $(srcdir)/protoize.c $(OUTPUT_OPTION))
79d8453e 2387
79d8453e 2388# This info describes the target machine, so compile with GCC just built.
aab26e16
RK
2389SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES) \
2390 stmp-int-hdrs
c21cf0a7 2391 -rm -f SYSCALLS.c tmp-SYSCALLS.s
e256b8b6
DA
2392 sed -e s/TARGET_GETGROUPS_T/$(TARGET_GETGROUPS_T)/ \
2393 $(srcdir)/sys-types.h $(srcdir)/sys-protos.h > SYSCALLS.c
79d8453e 2394 $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
c21cf0a7
RS
2395 -aux-info $@ -S -o tmp-SYSCALLS.s SYSCALLS.c
2396 -rm -f SYSCALLS.c tmp-SYSCALLS.s
9c0022f6 2397
ac1284f9 2398
9c0022f6 2399test-protoize-simple: ./protoize ./unprotoize $(GCC_PASSES)
4803a34a 2400 -rm -f tmp-proto.[cso]
d3614a37
RS
2401 cp $(srcdir)/protoize.c tmp-proto.c
2402 chmod u+w tmp-proto.c
4803a34a 2403 ./protoize -N -B ./ -x getopt.h -c "-B./ -Wall -Wwrite-strings \
d059a239 2404 $(GCC_CFLAGS) $(INCLUDES) \
9c0022f6
RS
2405 -DGCC_INCLUDE_DIR=0 \
2406 -DGPLUSPLUS_INCLUDE_DIR=0 \
2407 -DCROSS_INCLUDE_DIR=0 \
14b18068 2408 -DTOOL_INCLUDE_DIR=0 \
d059a239
FF
2409 -DSTANDARD_EXEC_PREFIX=0 \
2410 -DDEFAULT_TARGET_MACHINE=0 \
2411 -DDEFAULT_TARGET_VERSION=0" tmp-proto.c
e3e873d2 2412 @echo '**********' Expect 400 lines of differences.
4803a34a
RK
2413 -diff $(srcdir)/protoize.c tmp-proto.c > tmp-proto.diff
2414 -wc -l tmp-proto.diff
2415 ./unprotoize -N -x getopt.h -c "-B./ -Wall -Wwrite-strings \
d059a239 2416 $(GCC_CFLAGS) $(INCLUDES) \
9c0022f6
RS
2417 -DGCC_INCLUDE_DIR=0 \
2418 -DGPLUSPLUS_INCLUDE_DIR=0 \
2419 -DCROSS_INCLUDE_DIR=0 \
14b18068 2420 -DTOOL_INCLUDE_DIR=0 \
d059a239
FF
2421 -DSTANDARD_EXEC_PREFIX=0 \
2422 -DDEFAULT_TARGET_MACHINE=0 \
2423 -DDEFAULT_TARGET_VERSION=0" tmp-proto.c
9c0022f6 2424 @echo Expect zero differences.
d3614a37 2425 diff $(srcdir)/protoize.c tmp-proto.c | cat
aab26e16 2426 -rm -f tmp-proto.[cs] tmp-proto$(objext)
59a64126 2427
4977bab6
ZW
2428# gcov-iov.c is run on the build machine to generate gcov-iov.h from version.c
2429gcov-iov.o: gcov-iov.c version.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) coretypes.h $(TM_H)
eaf9f3b2 2430 $(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(INCLUDES) $(srcdir)/gcov-iov.c $(OUTPUT_OPTION)
4977bab6 2431gcov-iov$(build_exeext): gcov-iov.o
eaf9f3b2 2432 $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) gcov-iov.o -o $@
28068c2c
MK
2433gcov-iov.h: s-iov
2434s-iov: gcov-iov$(build_exeext) $(srcdir)/move-if-change
2435 ./gcov-iov$(build_exeext) > tmp-gcov-iov.h
2436 $(SHELL) $(srcdir)/move-if-change tmp-gcov-iov.h gcov-iov.h
2437 $(STAMP) s-iov
4977bab6 2438
990f4800
NS
2439gcov.o: gcov.c gcov-io.h gcov-io.c gcov-iov.h intl.h $(SYSTEM_H) coretypes.h $(TM_H) $(CONFIG_H)
2440gcov-dump.o: gcov-dump.c gcov-io.h gcov-io.c gcov-iov.h $(SYSTEM_H) coretypes.h $(TM_H) $(CONFIG_H)
59a64126 2441
2ea9a965
NC
2442# Only one of 'gcov' or 'gcov.exe' is actually built, depending
2443# upon whether $(exeext) is empty or not.
5735c3ea 2444GCOV_OBJS = gcov.o intl.o version.o
ab87f8c8
JL
2445gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
2446 $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
4977bab6
ZW
2447GCOV_DUMP_OBJS = gcov-dump.o version.o
2448gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(LIBDEPS)
2449 $(CC) $(ALL_CFLAGS) $(LDFLAGS) $(GCOV_DUMP_OBJS) $(LIBS) -o $@
544eb21e 2450#\f
ba1811f1 2451# Build the include directory. The stamp files are stmp-* rather than
e5e809f4 2452# s-* so that mostlyclean does not force the include directory to
ba1811f1
ILT
2453# be rebuilt.
2454
d57a4b98 2455# Build the include directory
f95e46b9 2456stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) xlimits.h
ba1811f1
ILT
2457# Copy in the headers provided with gcc.
2458# The sed command gets just the last file name component;
2459# this is necessary because VPATH could add a dirname.
2460# Using basename would be simpler, but some systems don't have it.
c85f7c16 2461# The touch command is here to workaround an AIX/Linux NFS bug.
7bfe3c97 2462 -if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi
d7371761
RK
2463 for file in .. $(USER_H); do \
2464 if [ X$$file != X.. ]; then \
2465 realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
d9835ae8 2466 $(STAMP) include/$$realfile; \
ae678a13
JW
2467 rm -f include/$$realfile; \
2468 cp $$file include; \
2469 chmod a+r include/$$realfile; \
d7371761 2470 fi; \
ba1811f1 2471 done
1f050b9b 2472 rm -f include/limits.h
ba1811f1
ILT
2473 cp xlimits.h include/limits.h
2474 chmod a+r include/limits.h
e7f62ad3
MH
2475# Install the README
2476 rm -f include/README
2477 cp $(srcdir)/README-fixinc include/README
2478 chmod a+r include/README
d9835ae8 2479 $(STAMP) $@
e7f62ad3 2480
f2321837
KG
2481# fixinc.sh depends on this, not on specs directly.
2482# The idea is to make sure specs gets built, but not rerun fixinc.sh
2483# after each stage just because specs' mtime has changed.
2484specs.ready: specs
2485 -if [ -f specs.ready ] ; then \
2486 true; \
2487 else \
d9835ae8 2488 $(STAMP) specs.ready; \
f2321837
KG
2489 fi
2490
31260fb8
LR
2491# Until someone fixes this recursive make nightmare (please note where
2492# BUILD_CFLAGS and WARN_CFLAGS are first expanded below versus which
2493# later make invocation has the fine-grain -warn markings for fixinc):
2494fixinc.sh-warn = -Wno-error
2495
5d55e5cd
RL
2496FIXINCSRCDIR=$(srcdir)/fixinc
2497fixinc.sh: $(FIXINCSRCDIR)/mkfixinc.sh $(FIXINCSRCDIR)/fixincl.c \
ab747408 2498 $(FIXINCSRCDIR)/procopen.c $(FIXINCSRCDIR)/server.c \
f2321837 2499 $(FIXINCSRCDIR)/server.h $(FIXINCSRCDIR)/inclhack.def specs.ready
8c90b13a 2500 (MAKE="$(MAKE)"; srcdir=`cd $(srcdir)/fixinc && ${PWD_COMMAND}` ; \
eaf9f3b2 2501 CC="$(CC_FOR_BUILD)"; CFLAGS="$(BUILD_CFLAGS)"; LDFLAGS="$(BUILD_LDFLAGS)"; \
5f08e44f 2502 WARN_CFLAGS="$(WARN_CFLAGS)"; LIBERTY=`${PWD_COMMAND}`/"$(BUILD_LIBIBERTY)"; \
7a615b25
AO
2503 export MAKE srcdir CC CFLAGS LDFLAGS WARN_CFLAGS LIBERTY; \
2504 cd ./fixinc && \
4665e56c 2505 $(SHELL) $${srcdir}/mkfixinc.sh $(build) $(target))
9f3d1bc2 2506
4977bab6
ZW
2507.PHONY: install-gcc-tooldir
2508install-gcc-tooldir:
90961eff 2509 $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(gcc_tooldir)
4977bab6 2510
ba1811f1 2511# Build fixed copies of system files.
9f3d1bc2 2512stmp-fixinc: fixinc.sh gsyslimits.h
4977bab6
ZW
2513 @if test ! -d ${SYSTEM_HEADER_DIR}; then \
2514 echo The directory that should contain system headers does not exist: >&2 ; \
2515 echo " ${SYSTEM_HEADER_DIR}" >&2 ; \
2516 if test "x${SYSTEM_HEADER_DIR}" = "x${gcc_tooldir}/sys-include"; \
2517 then sleep 1; else exit 1; fi; \
2518 fi
9f3d1bc2 2519 rm -rf include; mkdir include
c5c76735 2520 -chmod a+rx include
8c90b13a 2521 (TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \
fecd6201
ZW
2522 SHELL='$(SHELL)' ;\
2523 export TARGET_MACHINE srcdir SHELL ; \
8c90b13a 2524 $(SHELL) ./fixinc.sh `${PWD_COMMAND}`/include $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS); \
b8dad04b 2525 rm -f include/syslimits.h; \
3dc4a939
RK
2526 if [ -f include/limits.h ]; then \
2527 mv include/limits.h include/syslimits.h; \
2528 else \
2529 cp $(srcdir)/gsyslimits.h include/syslimits.h; \
b8dad04b
ZW
2530 fi; \
2531 chmod a+r include/syslimits.h)
d9835ae8 2532 $(STAMP) stmp-fixinc
469778e2 2533
ac1284f9 2534# Files related to the fixproto script.
eaf9f3b2 2535# gen-protos and fix-header are compiled with CC_FOR_BUILD, but they are only
f95e46b9
ZW
2536# used in native and host-x-target builds, so it's safe to link them with
2537# libiberty.a.
ac1284f9 2538
74bb4fdf 2539deduced.h: $(GCC_PASSES) $(srcdir)/scan-types.sh stmp-int-hdrs
4977bab6 2540 if [ -d "$(SYSTEM_HEADER_DIR)" ]; \
40859b41 2541 then \
3c9a2b55 2542 CC="$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(ALL_CPPFLAGS) -I. -I$(srcdir) -isystem include -isystem ${SYSTEM_HEADER_DIR}"; \
ac1284f9 2543 export CC; \
40859b41
JL
2544 $(SHELL) $(srcdir)/scan-types.sh "$(srcdir)" >tmp-deduced.h; \
2545 mv tmp-deduced.h deduced.h; \
2546 else \
d9835ae8 2547 $(STAMP) deduced.h; \
40859b41 2548 fi
ac1284f9 2549
5fa7f88c 2550GEN_PROTOS_OBJS = gen-protos.o scan.o
193ad8c6 2551gen-protos$(build_exeext): $(GEN_PROTOS_OBJS)
eaf9f3b2 2552 ${CC_FOR_BUILD} $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \
4977bab6 2553 $(GEN_PROTOS_OBJS) $(BUILD_LIBS)
ac1284f9 2554
4977bab6 2555gen-protos.o: gen-protos.c scan.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H)
c192da27 2556
4977bab6 2557scan.o: scan.c scan.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H)
7b41f815 2558
193ad8c6 2559xsys-protos.h: $(GCC_PASSES) $(srcdir)/sys-protos.h deduced.h gen-protos$(build_exeext) Makefile
e256b8b6
DA
2560 sed -e s/TARGET_GETGROUPS_T/$(TARGET_GETGROUPS_T)/ \
2561 deduced.h $(srcdir)/sys-protos.h > tmp-fixtmp.c
d521a023 2562 mv tmp-fixtmp.c fixtmp.c
c061c5d7 2563 $(GCC_FOR_TARGET) fixtmp.c -w -U__SIZE_TYPE__ -U__PTRDIFF_TYPE__ -U__WCHAR_TYPE__ -E \
c1b9947f 2564 | sed -e 's/ / /g' -e 's/ *(/ (/g' -e 's/ [ ]*/ /g' -e 's/( )/()/' \
414d23ae 2565 | $(RUN_GEN) ./gen-protos >xsys-protos.hT
d521a023 2566 mv xsys-protos.hT xsys-protos.h
d7a58f93 2567 rm -rf fixtmp.c
ac1284f9 2568
6650a443
ZW
2569# This is nominally a 'build' program, but it's run only when host==build,
2570# so we can (indeed, must) use $(LIBDEPS) and $(LIBS).
d577781c 2571fix-header$(build_exeext): fix-header.o scan-decls.o scan.o xsys-protos.h \
c1bad961 2572 c-incpath.o cppdefault.o prefix.o $(LIBDEPS) libcpp.a
eaf9f3b2 2573 $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ fix-header.o \
c1bad961 2574 c-incpath.o cppdefault.o scan-decls.o prefix.o scan.o libcpp.a $(LIBS)
ac1284f9 2575
4e872036 2576fix-header.o: fix-header.c $(OBSTACK_H) scan.h \
4977bab6 2577 xsys-protos.h $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(CPPLIB_H)
c192da27 2578
4977bab6 2579scan-decls.o: scan-decls.c scan.h $(CPPLIB_H) $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H)
ac1284f9 2580
74bb4fdf
RS
2581# stmp-fixproto depends on this, not on fix-header directly.
2582# The idea is to make sure fix-header gets built,
2583# but not rerun fixproto after each stage
2584# just because fix-header's mtime has changed.
d577781c 2585fixhdr.ready: fix-header$(build_exeext)
74bb4fdf
RS
2586 -if [ -f fixhdr.ready ] ; then \
2587 true; \
2588 else \
d9835ae8 2589 $(STAMP) fixhdr.ready; \
74bb4fdf
RS
2590 fi
2591
f95e46b9 2592# stmp-int-headers is to make sure fixincludes has already finished.
700ba19c
RS
2593# The if statement is so that we don't run fixproto a second time
2594# if it has already been run on the files in `include'.
f95e46b9 2595stmp-fixproto: fixhdr.ready fixproto stmp-int-hdrs
01b2995f 2596 if [ -f include/fixed ] ; then true; \
700ba19c 2597 else \
b1f99e2f 2598 : This line works around a 'make' bug in BSDI 1.1.; \
b3ca463c 2599 FIXPROTO_DEFINES="$(FIXPROTO_DEFINES)"; export FIXPROTO_DEFINES; \
bcf1ba1d
AO
2600 mkinstalldirs="$(SHELL) $(srcdir)/mkinstalldirs"; \
2601 export mkinstalldirs; \
4977bab6 2602 if [ -d "$(SYSTEM_HEADER_DIR)" ]; then \
aef1617c 2603 $(SHELL) ${srcdir}/fixproto include include $(SYSTEM_HEADER_DIR); \
01b2995f 2604 if [ $$? -eq 0 ] ; then true ; else exit 1 ; fi ; \
aef1617c 2605 else true; fi; \
d9835ae8 2606 $(STAMP) include/fixed; \
700ba19c 2607 fi
d9835ae8 2608 $(STAMP) stmp-fixproto
544eb21e 2609#\f
79d8453e
RS
2610# Remake the info files.
2611
b2790407
PE
2612stmp-docobjdir:
2613 -test -d $(docobjdir) || mkdir $(docobjdir)
2614 $(STAMP) stmp-docobjdir
2615
51817b10 2616doc: $(BUILD_INFO) $(GENERATED_MANPAGES) gccbug
62b81e45 2617info:: $(docobjdir)/cpp.info $(docobjdir)/gcc.info $(docobjdir)/gccint.info $(docobjdir)/gccinstall.info $(docobjdir)/cppinternals.info
79d8453e 2618
e2500fed 2619TEXI_CPP_FILES = $(docdir)/cpp.texi $(docdir)/include/fdl.texi \
40adaa27 2620 $(docdir)/cppenv.texi $(docdir)/cppopts.texi
79d8453e 2621
e2500fed 2622TEXI_GCC_FILES = $(docdir)/gcc.texi $(docdir)/include/gcc-common.texi \
b11cc610
JM
2623 $(docdir)/frontends.texi $(docdir)/standards.texi \
2624 $(docdir)/invoke.texi $(docdir)/extend.texi $(docdir)/md.texi \
2625 $(docdir)/objc.texi $(docdir)/gcov.texi $(docdir)/trouble.texi \
2626 $(docdir)/bugreport.texi $(docdir)/service.texi \
6f6a3861 2627 $(docdir)/contribute.texi $(docdir)/compat.texi \
b11cc610
JM
2628 $(docdir)/include/funding.texi $(docdir)/gnu.texi \
2629 $(docdir)/include/gpl.texi $(docdir)/include/fdl.texi \
40adaa27 2630 $(docdir)/contrib.texi $(docdir)/cppenv.texi $(docdir)/cppopts.texi
f780d21b 2631
e2500fed 2632TEXI_GCCINT_FILES = $(docdir)/gccint.texi \
b11cc610
JM
2633 $(docdir)/include/gcc-common.texi $(docdir)/contribute.texi \
2634 $(docdir)/makefile.texi $(docdir)/configterms.texi \
2635 $(docdir)/portability.texi $(docdir)/interface.texi \
2636 $(docdir)/passes.texi $(docdir)/c-tree.texi \
2637 $(docdir)/rtl.texi $(docdir)/md.texi $(docdir)/tm.texi \
2638 $(docdir)/hostconfig.texi $(docdir)/fragments.texi \
2639 $(docdir)/configfiles.texi $(docdir)/collect2.texi \
2640 $(docdir)/headerdirs.texi $(docdir)/include/funding.texi \
2641 $(docdir)/gnu.texi $(docdir)/include/gpl.texi \
0a553c7e 2642 $(docdir)/include/fdl.texi $(docdir)/contrib.texi \
e2500fed 2643 $(docdir)/languages.texi $(docdir)/sourcebuild.texi \
91f07c9b 2644 $(docdir)/gty.texi $(docdir)/libgcc.texi
e2500fed 2645
d7f8491b
RO
2646TEXI_GCCINSTALL_FILES = $(docdir)/install.texi $(docdir)/install-old.texi \
2647 $(docdir)/include/fdl.texi
2648
e2500fed
GK
2649TEXI_CPPINT_FILES = $(docdir)/cppinternals.texi
2650
6280c439
MM
2651$(docobjdir)/cpp.info cpp.dvi: $(TEXI_CPP_FILES)
2652$(docobjdir)/gcc.info gcc.dvi: $(TEXI_GCC_FILES)
2653$(docobjdir)/gccint.info gccint.dvi: $(TEXI_GCCINT_FILES)
2654$(docobjdir)/gccinstall.info gccinstall.dvi: $(TEXI_GCCINSTALL_FILES)
2655$(docobjdir)/cppinternals.info cppinternals.dvi: $(TEXI_CPPINT_FILES)
d7f8491b 2656
6280c439 2657$(docobjdir)/%.info: $(docdir)/%.texi stmp-docobjdir
3859c32a 2658 $(MAKEINFO) $(MAKEINFOFLAGS) -I $(docdir) -I $(docdir)/include \
6280c439 2659 -o $@ $<
23de1fbf 2660
62b81e45 2661dvi:: gcc.dvi gccint.dvi gccinstall.dvi cpp.dvi cppinternals.dvi
8dbda01e 2662
6280c439 2663%.dvi: $(docdir)/%.texi
3983d33e 2664 $(TEXI2DVI) -I $(docdir) -I $(docdir)/include $<
95e30ecc 2665
6280c439 2666gccinstall.dvi:
8c90b13a 2667 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
c2727579 2668 $(TEXI2DVI) -I $$s/doc -I $$s/doc/include -o $@ $$s/doc/install.texi
d7f8491b 2669
62b81e45
MM
2670generated-manpages:: $(docobjdir)/gcov.1 $(docobjdir)/cpp.1 \
2671 $(docobjdir)/gcc.1 $(docobjdir)/gfdl.7 $(docobjdir)/gpl.7 \
2672 $(docobjdir)/fsf-funding.7
c01a508e 2673
6280c439 2674$(docobjdir)/gcov.1: $(docdir)/gcov.texi
3859c32a 2675$(docobjdir)/cpp.1: $(docdir)/cpp.texi $(docdir)/cppenv.texi \
6280c439 2676 $(docdir)/cppopts.texi
3859c32a 2677$(docobjdir)/gcc.1: $(docdir)/invoke.texi $(docdir)/cppenv.texi \
6280c439
MM
2678 $(docdir)/cppopts.texi
2679$(docobjdir)/gfdl.7: $(docdir)/include/fdl.texi
2680$(docobjdir)/gpl.7: $(docdir)/include/gpl.texi
2681$(docobjdir)/fsf-funding.7: $(docdir)/include/funding.texi
2682
2683$(docobjdir)/%.1: $(docdir)/%.texi stmp-docobjdir
2684 $(STAMP) $@
2685 -$(TEXI2POD) $< > $(basename $(notdir $@)).pod
2686 -($(POD2MAN) --section=1 \
2687 $(basename $(notdir $@)).pod > $(@).T$$$$ && \
2688 mv -f $(@).T$$$$ $@) || \
2689 (rm -f $(@).T$$$$ && exit 1)
2690 -rm -f $(basename $(notdir $@)).pod
2691
2692$(docobjdir)/%.7: $(docdir)/%.texi stmp-docobjdir
2693 $(STAMP) $@
2694 -$(TEXI2POD) $< > $(basename $(notdir $@)).pod
2695 -($(POD2MAN) --section=7 \
2696 $(basename $(notdir $@)).pod > $(@).T$$$$ && \
2697 mv -f $(@).T$$$$ $@) || \
2698 (rm -f $(@).T$$$$ && exit 1)
2699 -rm -f $(basename $(notdir $@)).pod
77bd67cb 2700
544eb21e 2701#\f
79d8453e
RS
2702# Deletion of files made during compilation.
2703# There are four levels of this:
f1908d70 2704# `mostlyclean', `clean', `distclean' and `maintainer-clean'.
79d8453e 2705# `mostlyclean' is useful while working on a particular type of machine.
2e494f70 2706# It deletes most, but not all, of the files made by compilation.
79d8453e 2707# It does not delete libgcc.a or its parts, so it won't have to be recompiled.
2e494f70 2708# `clean' deletes everything made by running `make all'.
47547081 2709# `distclean' also deletes the files made by config.
f1908d70 2710# `maintainer-clean' also deletes everything that could be regenerated
63d9b81c
RK
2711# automatically, except for `configure'.
2712# We remove as much from the language subdirectories as we can
013a2ee0 2713# (less duplicated code).
79d8453e 2714
6eb95e99 2715mostlyclean: lang.mostlyclean
79d8453e 2716 -rm -f $(STAGESTUFF)
22aa533e 2717 -rm -f *$(coverageexts)
4993ddc1 2718 -rm -rf libgcc
79d8453e 2719# Delete the temporary source copies for cross compilation.
5c35940c
NN
2720 -rm -f $(BUILD_PREFIX_1)rtl.c $(BUILD_PREFIX_1)print-rtl.c
2721 -rm -f $(BUILD_PREFIX_1)bitmap.c $(BUILD_PREFIX_1)errors.c
4977bab6 2722 -rm -f $(BUILD_PREFIX_1)ggc-none.c print-rtl1.c
79d8453e 2723# Delete the temp files made in the course of building libgcc.a.
7857f134 2724 -rm -f xlimits.h
e5e809f4 2725# Delete other built files.
d57a4b98 2726 -rm -f xsys-protos.hT
d2908a50 2727 -rm -f specs.h gencheck.h options.c options.h
e5e809f4
JL
2728# Delete the stamp and temporary files.
2729 -rm -f s-* tmp-* stamp-* stmp-*
013a2ee0 2730 -rm -f */stamp-* */tmp-*
2e494f70 2731# Delete debugging dump files.
61098249 2732 -rm -f *.[0-9][0-9].* */*.[0-9][0-9].*
2e494f70 2733# Delete some files made during installation.
3bd6d4c4 2734 -rm -f specs $(SPECS) SYSCALLS.c.X SYSCALLS.c
b548dffb 2735 -rm -f collect collect2 mips-tfile mips-tdump
ac1284f9 2736# Delete files generated for fixproto
d577781c 2737 -rm -rf fix-header$(build_exeext) xsys-protos.h deduced.h tmp-deduced.h \
193ad8c6 2738 gen-protos$(build_exeext) fixproto.list fixtmp.* fixhdr.ready
fa9c7493
ZW
2739# Delete files generated for fixincl
2740 -rm -rf fixincl fixinc.sh specs.ready
f0267a67 2741 (cd fixinc && $(MAKE) clean)
2e494f70
RS
2742# Delete unwanted output files from TeX.
2743 -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
013a2ee0 2744 -rm -f */*.toc */*.log */*.vr */*.fn */*.cp */*.tp */*.ky */*.pg
47547081
RS
2745# Delete sorted indices we don't actually use.
2746 -rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns
2e494f70 2747# Delete core dumps.
013a2ee0 2748 -rm -f core */core
8ac9d31f
TJ
2749# Delete file generated for gengtype.c
2750 -rm -f gtyp-gen.h
2751# Delete files generated by gengtype.c
2752 -rm -f gtype-*
2753 -rm -f gt-*
79d8453e 2754
47547081
RS
2755# Delete all files made by compilation
2756# that don't exist in the distribution.
6eb95e99 2757clean: mostlyclean lang.clean
23af32e6
NS
2758 -rm -f libgcc.a libgcc_eh.a libgcov.a
2759 -rm -f libgcc_s$(SHLIB_EXT) libgcc_s$(SHLIB_EXT).1
4977bab6 2760 -rm -f config.h tconfig.h bconfig.h tm_p.h tm.h
11642c3a 2761 -rm -f cs-*
97d81d66 2762 -rm -rf libgcc
be0d23ff 2763 -rm -f *.dvi
013a2ee0 2764 -rm -f */*.dvi
ba1811f1 2765# Delete the include directory.
e5e809f4 2766 -rm -rf include
75ed5d8b 2767# Delete files used by the "multilib" facility (including libgcc subdirs).
f6cdc7ea 2768 -rm -f multilib.h tmpmultilib*
75ed5d8b
DE
2769 -if [ "x$(MULTILIB_DIRNAMES)" != x ] ; then \
2770 rm -rf $(MULTILIB_DIRNAMES); \
2771 else if [ "x$(MULTILIB_OPTIONS)" != x ] ; then \
2772 rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \
2773 fi ; fi
8f231b5d 2774 -rm -fr stage1 stage2 stage3 stage4 stageprofile stagefeedback
204093e6 2775# Delete stamps of bootstrap stages
770861f3
DD
2776 -rm -f stage?_*
2777 -rm -f clean?_*
2778 -rm -f stage_last
79d8453e 2779
47547081
RS
2780# Delete all files that users would normally create
2781# while building and installing GCC.
6eb95e99 2782distclean: clean lang.distclean
11642c3a 2783 -rm -f auto-host.h auto-build.h
d1209685 2784 -rm -f cstamp-h
63d9b81c 2785 -rm -f config.status config.run config.cache config.bak
d232dfa4 2786 -rm -f Make-lang Make-hooks Make-host Make-target
ad854f24 2787 -rm -f Makefile *.oaux
f24af81b 2788 -rm -f gthr-default.h
8f231b5d 2789 -rm -f */stage1 */stage2 */stage3 */stage4 */include */stageprofile */stagefeedback
3dab45b7 2790 -rm -f c-parse.output
338023d4 2791 -rm -f *.asm
a051ad3a 2792 -rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak
ad854f24 2793 -rm -f testsuite/*.log testsuite/*.sum
1bb1f121 2794 -cd testsuite && rm -f x *.x *.x? *.exe *.rpo *.o *.s *.S *.c
4977bab6 2795 -cd testsuite && rm -f *.out *.gcov *$(coverageexts)
f362c762 2796 -rm -rf ${QMTEST_DIR} stamp-qmtest
06f0b04c 2797 -rm -f cxxmain.c
ad854f24 2798 -rm -f mklibgcc mkheaders gccbug .gdbinit configargs.h
c01a508e 2799 -rm -f gcov.pod
5fcee6f3 2800 -rm -f fixinc/Makefile
ad854f24
ZW
2801# Delete po/*.gmo only if we are not building in the source directory.
2802 -if [ ! -f po/exgettext ]; then rm -f po/*.gmo; fi
2803 -rmdir ada cp f java objc fixinc intl po testsuite 2>/dev/null
2e494f70
RS
2804
2805# Delete anything likely to be found in the source directory
2806# that shouldn't be in the distribution.
013a2ee0 2807extraclean: distclean lang.extraclean
fb92d909 2808 -rm -rf =* ./"#"* *~* config/=* config/"#"* config/*~*
be0d23ff 2809 -rm -f patch* *.orig *.rej config/patch* config/*.orig config/*.rej
3dab45b7
RS
2810 -rm -f config/*/=* config/*/"#"* config/*/*~*
2811 -rm -f config/*/*.orig config/*/*.rej
d72a7857 2812 -rm -f *.dvi *.ps *.oaux *.d *.[zZ] *.gz
184be4bf 2813 -rm -f *.tar *.xtar *diff *.diff.* *.tar.* *.xtar.* *diffs
3dab45b7 2814 -rm -f *lose config/*lose config/*/*lose
e5e809f4 2815 -rm -f *.s *.s[0-9] *.i config/ChangeLog
ab87f8c8 2816 -rm -f y.tab.c yacc.*
013a2ee0
DE
2817 -rm -f */=* */"#"* */*~*
2818 -rm -f */patch* */*.orig */*.rej
2819 -rm -f */*.dvi */*.oaux */*.d */*.[zZ] */*.gz
2820 -rm -f */*.tar */*.xtar */*diff */*.diff.* */*.tar.* */*.xtar.* */*diffs
2821 -rm -f */*lose */*.s */*.s[0-9] */*.i
79d8453e 2822
63d9b81c 2823# Get rid of every file that's generated from some other file, except for `configure'.
79d8453e 2824# Most of these files ARE PRESENT in the GCC distribution.
63d9b81c
RK
2825maintainer-clean:
2826 @echo 'This command is intended for maintainers to use; it'
2827 @echo 'deletes files that may need special tools to rebuild.'
6eb95e99 2828 $(MAKE) lang.maintainer-clean distclean
0e5921e8 2829 -rm -f c-parse.y c-parse.c c-parse.output TAGS
17db6582
JM
2830 -rm -f cpp.??s cpp.*aux
2831 -rm -f gcc.??s gcc.*aux
3859c32a
GK
2832 -rm -f $(docobjdir)/cpp.info* $(docobjdir)/gcc.info* $(docobjdir)/gccint.info*
2833 -rm -f $(docobjdir)/cppinternals.info*
2834 -rm -f $(docobjdir)/gcov.1 $(docobjdir)/cpp.1 $(docobjdir)/gcc.1
2835 -rm -f $(docobjdir)/fsf-funding.7 $(docobjdir)/gfdl.7 $(docobjdir)/gpl.7
544eb21e 2836#\f
79d8453e 2837# Entry points `install' and `uninstall'.
2e494f70 2838# Also use `install-collect2' to install collect2 when the config files don't.
79d8453e 2839
ba1811f1 2840# Copy the compiler files into directories where they will be run.
aab26e16
RK
2841# Install the driver last so that the window when things are
2842# broken is small.
a078a589 2843install: install-common $(INSTALL_HEADERS) $(INSTALL_LIBGCC) \
6eb95e99 2844 install-cpp install-man install-info install-@POSUB@ \
09fa0705 2845 lang.install-normal install-driver
79d8453e 2846
587a4ba6 2847# Handle cpp installation.
4871239e 2848install-cpp: cpp$(exeext)
9799e470 2849 -if [ -f gcc-cross$(exeext) ] ; then \
90961eff
AJ
2850 rm -f $(DESTDIR)$(bindir)/$(CPP_CROSS_NAME)$(exeext); \
2851 $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(bindir)/$(CPP_CROSS_NAME)$(exeext); \
9799e470 2852 if [ x$(cpp_install_dir) != x ]; then \
90961eff
AJ
2853 rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \
2854 $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \
9799e470
AS
2855 else true; fi; \
2856 else \
90961eff
AJ
2857 rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext); \
2858 $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext); \
9799e470 2859 if [ x$(cpp_install_dir) != x ]; then \
90961eff
AJ
2860 rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
2861 $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
9799e470
AS
2862 else true; fi; \
2863 fi
587a4ba6 2864
69cbb85a 2865# Create the installation directories.
a8ee6e2d 2866# $(libdir)/gcc/include isn't currently searched by cpp.
69cbb85a 2867installdirs:
90961eff 2868 $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(libsubdir)
a8ee6e2d 2869 $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(libexecsubdir)
90961eff
AJ
2870 $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(bindir)
2871 $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(includedir)
2872 $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(infodir)
2873 $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(slibdir)
2874 $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(man1dir)
2875 $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(man7dir)
79d8453e
RS
2876
2877# Install the compiler executables built during cross compilation.
55de4f08 2878install-common: native $(EXTRA_PARTS) lang.install-common installdirs
79d8453e
RS
2879 for file in $(COMPILERS); do \
2880 if [ -f $$file ] ; then \
a8ee6e2d
GK
2881 rm -f $(DESTDIR)$(libexecsubdir)/$$file; \
2882 $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libexecsubdir)/$$file; \
79d8453e
RS
2883 else true; \
2884 fi; \
2885 done
2fe8d2d6 2886 for file in $(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2) ..; do \
79d8453e 2887 if [ x"$$file" != x.. ]; then \
a8ee6e2d
GK
2888 rm -f $(DESTDIR)$(libexecsubdir)/$$file; \
2889 $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libexecsubdir)/$$file; \
79d8453e
RS
2890 else true; fi; \
2891 done
2fe8d2d6
RK
2892 for file in $(EXTRA_PARTS) ..; do \
2893 if [ x"$$file" != x.. ]; then \
90961eff
AJ
2894 rm -f $(DESTDIR)$(libsubdir)/$$file; \
2895 $(INSTALL_DATA) $$file $(DESTDIR)$(libsubdir)/$$file; \
2896 chmod a-x $(DESTDIR)$(libsubdir)/$$file; \
2fe8d2d6
RK
2897 else true; fi; \
2898 done
f0ec1f64 2899# Don't mess with specs if it doesn't exist yet.
2a7bccbb 2900 -if [ -f specs ] ; then \
90961eff 2901 rm -f $(DESTDIR)$(libsubdir)/specs; \
3bd6d4c4 2902 $(INSTALL_DATA) $(SPECS) $(DESTDIR)$(libsubdir)/specs; \
90961eff 2903 chmod a-x $(DESTDIR)$(libsubdir)/specs; \
f0ec1f64 2904 fi
aab26e16
RK
2905# Install protoize if it was compiled.
2906 -if [ -f protoize$(exeext) ]; \
2907 then \
225695a4 2908 if [ -f gcc-cross$(exeext) ] ; then \
90961eff
AJ
2909 rm -f $(DESTDIR)$(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext); \
2910 $(INSTALL_PROGRAM) protoize$(exeext) $(DESTDIR)$(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext); \
2911 rm -f $(DESTDIR)$(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext); \
2912 $(INSTALL_PROGRAM) unprotoize$(exeext) $(DESTDIR)$(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext); \
225695a4 2913 else \
90961eff
AJ
2914 rm -f $(DESTDIR)$(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \
2915 $(INSTALL_PROGRAM) protoize$(exeext) $(DESTDIR)$(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \
2916 rm -f $(DESTDIR)$(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \
2917 $(INSTALL_PROGRAM) unprotoize$(exeext) $(DESTDIR)$(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \
225695a4 2918 fi ; \
90961eff
AJ
2919 rm -f $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \
2920 $(INSTALL_DATA) SYSCALLS.c.X $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \
2921 chmod a-x $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \
aab26e16 2922 fi
ca363bb6 2923# Install gcov if it was compiled.
59a64126
DE
2924 -if [ -f gcov$(exeext) ]; \
2925 then \
3743ea05 2926 rm -f $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext); \
90961eff 2927 $(INSTALL_PROGRAM) gcov$(exeext) $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext); \
59a64126 2928 fi
90961eff 2929 $(INSTALL_SCRIPT) gccbug $(DESTDIR)$(bindir)/$(GCCBUG_INSTALL_NAME)
aab26e16 2930
caa55b1e
NN
2931# Install the driver program as $(target_noncanonical)-gcc,
2932# $(target_noncanonical)-gcc-$(version)
91c7bd9b 2933# and also as either gcc (if native) or $(gcc_tooldir)/bin/gcc.
e658449e 2934install-driver: installdirs xgcc$(exeext)
173712fb 2935 -if [ -f gcc-cross$(exeext) ] ; then \
90961eff
AJ
2936 rm -f $(DESTDIR)$(bindir)/$(GCC_CROSS_NAME)$(exeext); \
2937 $(INSTALL_PROGRAM) gcc-cross$(exeext) $(DESTDIR)$(bindir)/$(GCC_CROSS_NAME)$(exeext); \
caa55b1e 2938 rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version); \
90961eff 2939 ( cd $(DESTDIR)$(bindir) && \
caa55b1e 2940 $(LN) $(GCC_CROSS_NAME)$(exeext) $(target_noncanonical)-gcc-$(version) ); \
90961eff
AJ
2941 if [ -d $(DESTDIR)$(gcc_tooldir)/bin/. ] ; then \
2942 rm -f $(DESTDIR)$(gcc_tooldir)/bin/gcc$(exeext); \
2943 $(INSTALL_PROGRAM) gcc-cross$(exeext) $(DESTDIR)$(gcc_tooldir)/bin/gcc$(exeext); \
79d8453e
RS
2944 else true; fi; \
2945 else \
90961eff
AJ
2946 rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext); \
2947 $(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext); \
caa55b1e 2948 rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version); \
90961eff 2949 ( cd $(DESTDIR)$(bindir) && \
caa55b1e
NN
2950 $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-$(version) ); \
2951 rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-tmp$(exeext); \
90961eff 2952 ( cd $(DESTDIR)$(bindir) && \
caa55b1e
NN
2953 $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-tmp$(exeext) && \
2954 mv -f $(target_noncanonical)-gcc-tmp$(exeext) $(GCC_TARGET_INSTALL_NAME)$(exeext) ); \
79d8453e 2955 fi
79d8453e 2956
0b2fbcb2 2957# Install the info files.
feb9ea1a 2958# $(INSTALL_DATA) might be a relative pathname, so we can't cd into srcdir
ee5b121e 2959# to do the install.
97ae108d
MM
2960install-info:: doc installdirs \
2961 $(DESTDIR)$(infodir)/cpp.info \
2962 $(DESTDIR)$(infodir)/gcc.info \
2963 $(DESTDIR)$(infodir)/cppinternals.info \
2964 $(DESTDIR)$(infodir)/gccint.info
2965
2966$(DESTDIR)$(infodir)/%.info: $(docobjdir)/%.info installdirs
2967 rm -f $@
2968 if [ -f $< ]; then \
2969 for f in $(<)*; do \
17db6582 2970 realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
90961eff 2971 $(INSTALL_DATA) $$f $(DESTDIR)$(infodir)/$$realfile; \
17db6582
JM
2972 done; \
2973 else true; fi
ee5b121e 2974 -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
90961eff 2975 if [ -f $(DESTDIR)$(infodir)/dir ] ; then \
97ae108d
MM
2976 if [ -f $@ ]; then \
2977 install-info --dir-file=$(DESTDIR)$(infodir)/dir $@ \
2978 else true; fi; \
f8c86b58 2979 else true; fi; \
265ce5bb 2980 else true; fi;
97ae108d 2981 chmod a-x $(@)*
0b2fbcb2 2982
79d8453e 2983# Install the man pages.
ad3b5aff 2984install-man: installdirs $(GENERATED_MANPAGES) lang.install-man
e9a25f70 2985 -if [ -f gcc-cross$(exeext) ] ; then \
90961eff 2986 rm -f $(DESTDIR)$(man1dir)/$(GCC_CROSS_NAME)$(man1ext); \
3859c32a 2987 $(INSTALL_DATA) $(docobjdir)/gcc.1 $(DESTDIR)$(man1dir)/$(GCC_CROSS_NAME)$(man1ext); \
90961eff 2988 chmod a-x $(DESTDIR)$(man1dir)/$(GCC_CROSS_NAME)$(man1ext); \
338023d4 2989 else \
90961eff 2990 rm -f $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext); \
3859c32a 2991 $(INSTALL_DATA) $(docobjdir)/gcc.1 $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext); \
90961eff 2992 chmod a-x $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext); \
338023d4 2993 fi
90961eff 2994 -rm -f $(DESTDIR)$(man1dir)/cpp$(man1ext)
3859c32a 2995 -$(INSTALL_DATA) $(docobjdir)/cpp.1 $(DESTDIR)$(man1dir)/cpp$(man1ext)
90961eff
AJ
2996 -chmod a-x $(DESTDIR)$(man1dir)/cpp$(man1ext)
2997 -rm -f $(DESTDIR)$(man1dir)/gcov$(man1ext)
3859c32a 2998 -$(INSTALL_DATA) $(docobjdir)/gcov.1 $(DESTDIR)$(man1dir)/gcov$(man1ext)
90961eff
AJ
2999 -chmod a-x $(DESTDIR)$(man1dir)/gcov$(man1ext)
3000 -rm -f $(DESTDIR)$(man7dir)/fsf-funding$(man7ext)
3859c32a 3001 -$(INSTALL_DATA) $(docobjdir)/fsf-funding.7 $(DESTDIR)$(man7dir)/fsf-funding$(man7ext)
90961eff
AJ
3002 -chmod a-x $(DESTDIR)$(man7dir)/fsf-funding$(man7ext)
3003 -rm -f $(DESTDIR)$(man7dir)/gfdl$(man7ext)
3859c32a 3004 -$(INSTALL_DATA) $(docobjdir)/gfdl.7 $(DESTDIR)$(man7dir)/gfdl$(man7ext)
90961eff
AJ
3005 -chmod a-x $(DESTDIR)$(man7dir)/gfdl$(man7ext)
3006 -rm -f $(DESTDIR)$(man7dir)/gpl$(man7ext)
3859c32a 3007 -$(INSTALL_DATA) $(docobjdir)/gpl.7 $(DESTDIR)$(man7dir)/gpl$(man7ext)
90961eff 3008 -chmod a-x $(DESTDIR)$(man7dir)/gpl$(man7ext)
79d8453e
RS
3009
3010# Install the library.
23af32e6 3011install-libgcc: libgcc.mk libgcc.a libgcov.a installdirs
e158a5fb 3012 $(MAKE) \
67680154 3013 CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \
e158a5fb 3014 CONFIG_H="$(TCONFIG_H)" \
67680154 3015 MAKEOVERRIDES= \
2bbea3a6 3016 -f libgcc.mk install
79d8453e 3017
23af32e6 3018# Install multiple versions of libgcc.a, libgcov.a.
69cbb85a 3019install-multilib: stmp-multilib installdirs
e158a5fb 3020 $(MAKE) \
67680154 3021 CFLAGS="$(CFLAGS) $(WARN_CFLAGS)" \
e158a5fb 3022 CONFIG_H="$(CONFIG_H)" \
67680154 3023 MAKEOVERRIDES= \
2bbea3a6 3024 -f libgcc.mk install
f6cdc7ea 3025
ba1811f1 3026# Install all the header files built in the include subdirectory.
fecd6201 3027install-headers: $(INSTALL_HEADERS_DIR)
ba1811f1
ILT
3028# Fix symlinks to absolute paths in the installed include directory to
3029# point to the installed directory, not the build directory.
ac64120e 3030# Don't need to use LN_S here since we really do need ln -s and no substitutes.
90961eff 3031 -files=`cd $(DESTDIR)$(libsubdir)/include; find . -type l -print 2>/dev/null`; \
ba1811f1 3032 if [ $$? -eq 0 ]; then \
8c90b13a 3033 dir=`cd include; ${PWD_COMMAND}`; \
ba1811f1 3034 for i in $$files; do \
90961eff 3035 dest=`ls -ld $(DESTDIR)$(libsubdir)/include/$$i | sed -n 's/.*-> //p'`; \
ba1811f1 3036 if expr "$$dest" : "$$dir.*" > /dev/null; then \
90961eff
AJ
3037 rm -f $(DESTDIR)$(libsubdir)/include/$$i; \
3038 ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(DESTDIR)$(libsubdir)/include/$$i; \
ba1811f1
ILT
3039 fi; \
3040 done; \
3041 fi
79d8453e 3042
ba1811f1 3043# Create or recreate the gcc private include file directory.
69cbb85a 3044install-include-dir: installdirs
90961eff
AJ
3045 -rm -rf $(DESTDIR)$(libsubdir)/include
3046 mkdir $(DESTDIR)$(libsubdir)/include
3047 -chmod a+rx $(DESTDIR)$(libsubdir)/include
ba1811f1
ILT
3048
3049# Install the include directory using tar.
f95e46b9 3050install-headers-tar: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir
965c3f43
AO
3051# We use `pwd`/include instead of just include to problems with CDPATH
3052# Unless a full pathname is provided, some shells would print the new CWD,
3053# found in CDPATH, corrupting the output. We could just redirect the
3054# output of `cd', but some shells lose on redirection within `()'s
8c90b13a 3055 (cd `${PWD_COMMAND}`/include ; \
90961eff 3056 tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include; tar xpf - )
e6431ec5
RS
3057# /bin/sh on some systems returns the status of the first tar,
3058# and that can lose with GNU tar which always writes a full block.
3059# So use `exit 0' to ignore its exit status.
ba1811f1
ILT
3060
3061# Install the include directory using cpio.
f95e46b9 3062install-headers-cpio: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir
965c3f43 3063# See discussion about the use of `pwd` above
8c90b13a 3064 cd `${PWD_COMMAND}`/include ; \
90961eff 3065 find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include
79d8453e 3066
ff3aaf17
DR
3067# Install the include directory using cp.
3068install-headers-cp: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir
90961eff 3069 cp -p -r include $(DESTDIR)$(libsubdir)
ff3aaf17 3070
a8ee6e2d
GK
3071itoolsdir = $(libexecsubdir)/install-tools
3072itoolsdatadir = $(libsubdir)/install-tools
e34a3d31
GK
3073# Don't install the headers. Instead, install appropriate scripts
3074# and supporting files for fixincludes to be run later.
3075install-mkheaders: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir \
3076 mkheaders xlimits.h
a8ee6e2d
GK
3077 -rm -rf $(DESTDIR)$(itoolsdir) $(DESTDIR)$(itoolsdatadir)
3078 $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(itoolsdatadir)/include
3079 $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(itoolsdir)
e34a3d31
GK
3080 for file in $(USER_H); do \
3081 realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
3082 $(INSTALL_DATA) $$file \
a8ee6e2d 3083 $(DESTDIR)$(itoolsdatadir)/include/$$realfile ; \
e34a3d31 3084 done
a8ee6e2d 3085 $(INSTALL_DATA) xlimits.h $(DESTDIR)$(itoolsdatadir)/include/limits.h
e34a3d31
GK
3086 if [ x$(STMP_FIXINC) != x ] ; then \
3087 $(INSTALL_DATA) $(srcdir)/README-fixinc \
a8ee6e2d 3088 $(DESTDIR)$(itoolsdatadir)/include/README ; \
f0c4fac7 3089 $(INSTALL_SCRIPT) fixinc.sh $(DESTDIR)$(itoolsdir)/fixinc.sh ; \
90961eff 3090 $(INSTALL_PROGRAM) fixinc/fixincl $(DESTDIR)$(itoolsdir)/fixincl ; \
a8ee6e2d
GK
3091 $(INSTALL_DATA) $(srcdir)/gsyslimits.h \
3092 $(DESTDIR)$(itoolsdatadir)/gsyslimits.h ; \
e34a3d31
GK
3093 else :; fi
3094 if [ x$(STMP_FIXPROTO) != x ] ; then \
f0c4fac7 3095 $(INSTALL_SCRIPT) $(srcdir)/mkinstalldirs \
90961eff 3096 $(DESTDIR)$(itoolsdir)/mkinstalldirs ; \
f0c4fac7 3097 $(INSTALL_SCRIPT) $(srcdir)/fixproto $(DESTDIR)$(itoolsdir)/fixproto ; \
e34a3d31 3098 $(INSTALL_PROGRAM) fix-header$(build_exeext) \
90961eff 3099 $(DESTDIR)$(itoolsdir)/fix-header$(build_exeext) ; \
e34a3d31 3100 else :; fi
f0c4fac7 3101 $(INSTALL_SCRIPT) mkheaders $(DESTDIR)$(itoolsdir)/mkheaders
4977bab6 3102 echo 'SYSTEM_HEADER_DIR="'"$(SYSTEM_HEADER_DIR)"'"' \
a8ee6e2d 3103 > $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
e34a3d31 3104 echo 'OTHER_FIXINCLUDES_DIRS="$(OTHER_FIXINCLUDES_DIRS)"' \
a8ee6e2d 3105 >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
e34a3d31 3106 echo 'FIXPROTO_DEFINES="$(FIXPROTO_DEFINES)"' \
a8ee6e2d
GK
3107 >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
3108 echo 'STMP_FIXPROTO="$(STMP_FIXPROTO)"' \
3109 >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
3110 echo 'STMP_FIXINC="$(STMP_FIXINC)"' \
3111 >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
e34a3d31 3112
10da1131 3113# Use this target to install the program `collect2' under the name `collect2'.
69cbb85a 3114install-collect2: collect2 installdirs
a8ee6e2d 3115 $(INSTALL_PROGRAM) collect2$(exeext) $(DESTDIR)$(libexecsubdir)/collect2$(exeext)
2e494f70 3116# Install the driver program as $(libsubdir)/gcc for collect2.
a8ee6e2d 3117 $(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(libexecsubdir)/gcc$(exeext)
2e494f70 3118
79d8453e 3119# Cancel installation by deleting the installed files.
6eb95e99 3120uninstall: lang.uninstall
90961eff 3121 -rm -rf $(DESTDIR)$(libsubdir)
a8ee6e2d 3122 -rm -rf $(DESTDIR)$(libexecsubdir)
90961eff
AJ
3123 -rm -rf $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
3124 -rm -rf $(DESTDIR)$(bindir)/$(GCC_CROSS_NAME)$(exeext)
3125 -rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext)
3126 -rm -f $(DESTDIR)$(bindir)/$(CPP_CROSS_NAME)$(exeext)
1e730c5c 3127 -if [ x$(cpp_install_dir) != x ]; then \
90961eff
AJ
3128 rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
3129 rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \
1e730c5c 3130 else true; fi
90961eff
AJ
3131 -rm -rf $(DESTDIR)$(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext)
3132 -rm -rf $(DESTDIR)$(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext)
3133 -rm -rf $(DESTDIR)$(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext)
3134 -rm -rf $(DESTDIR)$(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext)
3135 -rm -rf $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext)
3136 -rm -rf $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext)
3137 -rm -rf $(DESTDIR)$(man1dir)/$(GCC_CROSS_NAME)$(man1ext)
3138 -rm -rf $(DESTDIR)$(man1dir)/cpp$(man1ext)
3139 -rm -rf $(DESTDIR)$(man1dir)/protoize$(man1ext)
3140 -rm -rf $(DESTDIR)$(man1dir)/unprotoize$(man1ext)
3141 -rm -f $(DESTDIR)$(infodir)/cpp.info* $(DESTDIR)$(infodir)/gcc.info*
3142 -rm -f $(DESTDIR)$(infodir)/cppinternals.info* $(DESTDIR)$(infodir)/gccint.info*
544eb21e 3143#\f
4c457b6b 3144# These targets are for the dejagnu testsuites. The file site.exp
e933cbe0
JL
3145# contains global variables that all the testsuites will use.
3146
e933cbe0
JL
3147target_subdir = @target_subdir@
3148
3149site.exp: ./config.status Makefile
3150 @echo "Making a new config file..."
3151 -@rm -f ./tmp?
d9835ae8 3152 @$(STAMP) site.exp
e933cbe0
JL
3153 -@mv site.exp site.bak
3154 @echo "## these variables are automatically generated by make ##" > ./tmp0
3155 @echo "# Do not edit here. If you wish to override these values" >> ./tmp0
3156 @echo "# add them to the last section" >> ./tmp0
8c90b13a
L
3157 @echo "set rootme \"`${PWD_COMMAND}`\"" >> ./tmp0
3158 @echo "set srcdir \"`cd ${srcdir}; ${PWD_COMMAND}`\"" >> ./tmp0
4665e56c
NN
3159 @echo "set host_triplet $(host)" >> ./tmp0
3160 @echo "set build_triplet $(build)" >> ./tmp0
e933cbe0 3161 @echo "set target_triplet $(target)" >> ./tmp0
caa55b1e 3162 @echo "set target_alias $(target_noncanonical)" >> ./tmp0
e933cbe0
JL
3163# CFLAGS is set even though it's empty to show we reserve the right to set it.
3164 @echo "set CFLAGS \"\"" >> ./tmp0
76438597 3165 @echo "set CXXFLAGS \"\"" >> ./tmp0
4091fa5f 3166 @echo "set TESTING_IN_BUILD_TREE 1" >> ./tmp0
22fdd65e 3167 @echo "set HAVE_LIBSTDCXX_V3 1" >> ./tmp0
e933cbe0
JL
3168# If newlib has been configured, we need to pass -B to gcc so it can find
3169# newlib's crt0.o if it exists. This will cause a "path prefix not used"
3170# message if it doesn't, but the testsuite is supposed to ignore the message -
3171# it's too difficult to tell when to and when not to pass -B (not all targets
3172# have crt0's). We could only add the -B if ../newlib/crt0.o exists, but that
3173# seems like too selective a test.
3174# ??? Another way to solve this might be to rely on linker scripts. Then
3175# theoretically the -B won't be needed.
3176# We also need to pass -L ../ld so that the linker can find ldscripts.
6a1b7268 3177 @if [ -d $(objdir)/../$(target_subdir)/newlib ] \
4665e56c 3178 && [ "${host}" != "${target}" ]; then \
6a1b7268
NN
3179 echo "set newlib_cflags \"-I$(objdir)/../$(target_subdir)/newlib/targ-include -I\$$srcdir/../newlib/libc/include\"" >> ./tmp0; \
3180 echo "set newlib_ldflags \"-B$(objdir)/../$(target_subdir)/newlib/\"" >> ./tmp0; \
e933cbe0
JL
3181 echo "append CFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \
3182 echo "append CXXFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \
3183 echo "append LDFLAGS \" \$$newlib_ldflags\"" >> ./tmp0; \
3184 else true; \
3185 fi
3186 @if [ -d $(objdir)/../ld ] ; then \
3187 echo "append LDFLAGS \" -L$(objdir)/../ld\"" >> ./tmp0; \
3188 else true; \
3189 fi
ccdb9251 3190 echo "set tmpdir $(objdir)/testsuite" >> ./tmp0
e933cbe0 3191 @echo "set srcdir \"\$${srcdir}/testsuite\"" >> ./tmp0
6ccfe27c
JJ
3192 @if [ "X$(ALT_CC_UNDER_TEST)" != "X" ] ; then \
3193 echo "set ALT_CC_UNDER_TEST \"$(ALT_CC_UNDER_TEST)\"" >> ./tmp0; \
3194 else true; \
3195 fi
fa870451 3196 @if [ "X$(ALT_CXX_UNDER_TEST)" != "X" ] ; then \
6ccfe27c 3197 echo "set ALT_CXX_UNDER_TEST \"$(ALT_CXX_UNDER_TEST)\"" >> ./tmp0; \
fa870451
JJ
3198 else true; \
3199 fi
3200 @if [ "X$(COMPAT_OPTIONS)" != "X" ] ; then \
6ccfe27c 3201 echo "set COMPAT_OPTIONS \"$(COMPAT_OPTIONS)\"" >> ./tmp0; \
fa870451
JJ
3202 else true; \
3203 fi
e933cbe0
JL
3204 @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
3205 @cat ./tmp0 > site.exp
3206 @cat site.bak | sed \
3207 -e '1,/^## All variables above are.*##/ d' >> site.exp
3208 -@rm -f ./tmp?
3209
71a94577 3210CHECK_TARGETS = check-gcc @check_languages@
cbc59f01
DD
3211
3212check-c++ : check-g++
3213check-f77 : check-g77
5262d6b6 3214check-java :
e933cbe0
JL
3215
3216check: $(CHECK_TARGETS)
3217
a738a85c 3218# The idea is to parallelize testing of multilibs, for example:
7dd232a8 3219# make -j3 check-gcc//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}
a738a85c
AO
3220# will run 3 concurrent sessions of check-gcc, eventually testing
3221# all 10 combinations. GNU make is required, as is a shell that expands
3222# alternations within braces.
7dd232a8
AO
3223check-gcc//% check-g++//% check-g77//% check-objc//%: site.exp
3224 target=`echo "$@" | sed 's,//.*,,'`; \
3225 variant=`echo "$@" | sed 's,^[^/]*//,,'`; \
a738a85c
AO
3226 vardots=`echo "$$variant" | sed 's,/,.,g'`; \
3227 $(MAKE) TESTSUITEDIR="testsuite.$$vardots" \
3228 RUNTESTFLAGS="--target_board=$$variant $(RUNTESTFLAGS)" \
3229 "$$target"
3230
3231TESTSUITEDIR = testsuite
3232
3233$(TESTSUITEDIR)/site.exp: site.exp
3234 test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR)
3235 -rm -f $@
3236 sed '/set tmpdir/ s|testsuite|$(TESTSUITEDIR)|' < site.exp > $@
3237
4b09846b 3238check-g++ check-gcc check-g77 check-objc: check-% : $(TESTSUITEDIR)/site.exp
8c90b13a
L
3239 -(rootme=`${PWD_COMMAND}`; export rootme; \
3240 srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
a738a85c 3241 cd $(TESTSUITEDIR); \
d8bb17c8
OP
3242 EXPECT=${EXPECT} ; export EXPECT ; \
3243 if [ -f $${rootme}/../expect/expect ] ; then \
8c90b13a 3244 TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
d8bb17c8 3245 export TCL_LIBRARY ; fi ; \
4b09846b 3246 $(RUNTEST) --tool $* $(RUNTESTFLAGS))
d8bb17c8 3247
c36ae96c 3248check-consistency: testsuite/site.exp
8c90b13a
L
3249 -rootme=`${PWD_COMMAND}`; export rootme; \
3250 srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
c36ae96c
GK
3251 cd testsuite; \
3252 EXPECT=${EXPECT} ; export EXPECT ; \
3253 if [ -f $${rootme}/../expect/expect ] ; then \
8c90b13a 3254 TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
c36ae96c
GK
3255 export TCL_LIBRARY ; fi ; \
3256 $(RUNTEST) --tool consistency $(RUNTESTFLAGS)
3257
f362c762
MM
3258# QMTest targets
3259
3260# The path to qmtest.
3261QMTEST_PATH=qmtest
3262
3263# The flags to pass to qmtest.
3264QMTESTFLAGS=
3265
3266# The flags to pass to "qmtest run".
d7068b3d 3267QMTESTRUNFLAGS=-f none --result-stream dejagnu_stream.DejaGNUStream
f362c762
MM
3268
3269# The command to use to invoke qmtest.
3270QMTEST=${QMTEST_PATH} ${QMTESTFLAGS}
3271
3272# The tests (or suites) to run.
d7068b3d 3273QMTEST_GPP_TESTS=g++
f362c762
MM
3274
3275# The subdirectory of the OBJDIR that will be used to store the QMTest
3276# test database configuration and that will be used for temporary
3277# scratch space during QMTest's execution.
62363d99 3278QMTEST_DIR=qmtestsuite
f362c762
MM
3279
3280# Create the QMTest database configuration.
3281${QMTEST_DIR} stamp-qmtest:
d7068b3d
MM
3282 ${QMTEST} -D ${QMTEST_DIR} create-tdb \
3283 -c gcc_database.GCCDatabase \
5f08e44f 3284 -a srcdir=`cd ${srcdir}/testsuite && ${PWD_COMMAND}` && \
d7068b3d 3285 $(STAMP) stamp-qmtest
f362c762
MM
3286
3287# Create the QMTest context file.
3288${QMTEST_DIR}/context: stamp-qmtest
d7068b3d
MM
3289 rm -f $@
3290 echo "CompilerTable.languages=c cplusplus" >> $@
3291 echo "CompilerTable.c_kind=GCC" >> $@
3292 echo "CompilerTable.c_path=${objdir}/xgcc" >> $@
3293 echo "CompilerTable.c_options=-B${objdir}/" >> $@
3294 echo "CompilerTable.cplusplus_kind=GCC" >> $@
3295 echo "CompilerTable.cplusplus_path=${objdir}/g++" >> $@
3296 echo "CompilerTable.cplusplus_options=-B${objdir}/" >> $@
caa55b1e 3297 echo "DejaGNUTest.target=${target_noncanonical}" >> $@
f362c762
MM
3298
3299# Run the G++ testsuite using QMTest.
d7068b3d 3300qmtest-g++: ${QMTEST_DIR}/context
f362c762 3301 cd ${QMTEST_DIR} && ${QMTEST} run ${QMTESTRUNFLAGS} -C context \
d7068b3d 3302 -o g++.qmr ${QMTEST_GPP_TESTS}
f362c762
MM
3303
3304# Use the QMTest GUI.
3305qmtest-gui: ${QMTEST_DIR}/context
3306 cd ${QMTEST_DIR} && ${QMTEST} gui -C context
3307
f362c762
MM
3308.PHONY: qmtest-g++
3309
efdc7e19
RH
3310# Run Paranoia on real.c.
3311
3312paranoia.o: $(srcdir)/../contrib/paranoia.cc $(CONFIG_H) $(SYSTEM_H) \
3313 real.h $(TREE_H)
3314 g++ -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
3315
3316paranoia: paranoia.o real.o $(LIBIBERTY)
3317 g++ -o $@ paranoia.o real.o $(LIBIBERTY)
3318
79d8453e
RS
3319# These exist for maintenance purposes.
3320
3321# Update the tags table.
65ebbf81
TT
3322TAGS: lang.tags
3323 (cd $(srcdir); \
3324 incs= ; \
3325 list='$(SUBDIRS)'; for dir in $$list; do \
3326 if test -f $$dir/TAGS; then \
3327 incs="$$incs --include $$dir/TAGS"; \
3328 fi; \
3329 done; \
3330 mkdir tmp-tags; \
30492adf 3331 mv -f c-parse.[ch] tmp-tags; \
65ebbf81
TT
3332 etags *.y *.h *.c $$incs; \
3333 mv tmp-tags/* .; \
b8dad04b 3334 rmdir tmp-tags)
79d8453e 3335
39e73137
NN
3336# ------------------------------------------------------
3337# Bootstrap-related targets (not used during 'make all')
3338# ------------------------------------------------------
3339
87a8affe 3340# A list of files to be destroyed during "lean" builds.
a36556a8 3341VOL_FILES=`echo $(BACKEND) $(OBJS) $(C_OBJS) $(LIBCPP_OBJS) *.c *.h gen*`
87a8affe 3342
b8dad04b
ZW
3343# Flags to pass to stage2 and later recursive makes. Note that the
3344# WARN_CFLAGS setting can't be to the expansion of GCC_WARN_CFLAGS in
3345# the context of the stage_x rule.
8f231b5d
JH
3346
3347POSTSTAGE1_FLAGS_TO_PASS = \
7d600178 3348 ADAC="\$$(CC)" \
b8dad04b
ZW
3349 CFLAGS="$(BOOT_CFLAGS)" \
3350 LDFLAGS="$(BOOT_LDFLAGS)" \
3351 WARN_CFLAGS="\$$(GCC_WARN_CFLAGS)" \
3352 STRICT_WARN="$(STRICT2_WARN)" \
3353 libdir=$(libdir) \
3354 LANGUAGES="$(LANGUAGES)" \
fca086c1
KC
3355 MAKEINFO="$(MAKEINFO)" \
3356 MAKEINFOFLAGS="$(MAKEINFOFLAGS)" \
03bbd83f 3357 MAKEOVERRIDES= \
b8dad04b
ZW
3358 OUTPUT_OPTION="-o \$$@"
3359
8f231b5d
JH
3360STAGE2_FLAGS_TO_PASS = \
3361 CFLAGS="$(BOOT_CFLAGS)" \
3362 WERROR="@WERROR@" \
3363
3364STAGEPROFILE_FLAGS_TO_PASS = \
3365 CFLAGS="$(BOOT_CFLAGS) -fprofile-arcs"
3366
3367# Files never linked into the final executable produces warnings about missing
3368# profile.
3369STAGEFEEDBACK_FLAGS_TO_PASS = \
3370 CFLAGS="$(BOOT_CFLAGS) -fbranch-probabilities"
3371
9c4614c3
TW
3372# Only build the C compiler for stage1, because that is the only one that
3373# we can guarantee will build with the native compiler, and also it is the
78faa32d
FS
3374# only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS),
3375# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them
3376# overrideable (for a bootstrap build stage1 also builds gcc.info).
770861f3 3377stage1_build:
78faa32d
FS
3378 $(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" \
3379 CFLAGS="$(STAGE1_CFLAGS)" MAKEINFO="$(MAKEINFO)" \
ed2d8944
RH
3380 MAKEINFOFLAGS="$(MAKEINFOFLAGS)" COVERAGE_FLAGS= \
3381 OBJS-onestep="$(OBJS)"
d9835ae8 3382 $(STAMP) stage1_build
770861f3 3383 echo stage1_build > stage_last
204093e6 3384
770861f3 3385stage1_copy: stage1_build
79d8453e 3386 $(MAKE) stage1
d9835ae8 3387 $(STAMP) stage1_copy
770861f3 3388 echo stage2_build > stage_last
204093e6 3389
770861f3 3390stage2_build: stage1_copy
eaf9f3b2 3391 $(MAKE) CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CC_FOR_BUILD="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \
b8dad04b 3392 STAGE_PREFIX=stage1/ \
8f231b5d 3393 $(POSTSTAGE1_FLAGS_TO_PASS) \
b8dad04b 3394 $(STAGE2_FLAGS_TO_PASS)
d9835ae8 3395 $(STAMP) stage2_build
770861f3 3396 echo stage2_build > stage_last
204093e6 3397
770861f3 3398stage2_copy: stage2_build
3d84f80f 3399 $(MAKE) stage2
d9835ae8 3400 $(STAMP) stage2_copy
770861f3 3401 echo stage3_build > stage_last
b8dad04b 3402
8f231b5d 3403stageprofile_build: stage1_copy
eaf9f3b2 3404 $(MAKE) CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CC_FOR_BUILD="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \
8f231b5d
JH
3405 STAGE_PREFIX=stage1/ \
3406 $(POSTSTAGE1_FLAGS_TO_PASS) \
3407 $(STAGEPROFILE_FLAGS_TO_PASS)
3408 $(STAMP) stageprofile_build
3409 echo stageprofile_build > stage_last
3410
3411stageprofile_copy: stageprofile_build
3412 $(MAKE) stageprofile
3413 $(STAMP) stageprofile_copy
3414 echo stagefeedback_build > stage_last
3415
770861f3 3416stage3_build: stage2_copy
eaf9f3b2 3417 $(MAKE) CC="$(STAGE_CC_WRAPPER) stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" CC_FOR_BUILD="$(STAGE_CC_WRAPPER) stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" \
b8dad04b 3418 STAGE_PREFIX=stage2/ \
8f231b5d 3419 $(POSTSTAGE1_FLAGS_TO_PASS) \
b8dad04b 3420 $(STAGE2_FLAGS_TO_PASS)
d9835ae8 3421 $(STAMP) stage3_build
770861f3 3422 echo stage3_build > stage_last
204093e6 3423
8f231b5d 3424stagefeedback_build: stageprofile_copy stage1_copy
eaf9f3b2 3425 $(MAKE) CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" CC_FOR_BUILD="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \
8f231b5d
JH
3426 STAGE_PREFIX=stage1/ \
3427 $(POSTSTAGE1_FLAGS_TO_PASS) \
3428 $(STAGEFEEDBACK_FLAGS_TO_PASS)
3429 $(STAMP) stagefeedback_build
3430 echo stagefeedback_build > stage_last
3431
3432stagefeedback_copy: stagefeedback_build
3433 $(MAKE) stagefeedback
3434 $(STAMP) stagefeedback_copy
3435 echo stagefeedback2_build > stage_last
3436
204093e6 3437# For bootstrap4:
770861f3 3438stage3_copy: stage3_build
3d84f80f 3439 $(MAKE) stage3
d9835ae8 3440 $(STAMP) stage3_copy
770861f3
DD
3441 echo stage4_build > stage_last
3442
3443stage4_build: stage3_copy
eaf9f3b2 3444 $(MAKE) CC="$(STAGE_CC_WRAPPER) stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" CC_FOR_BUILD="$(STAGE_CC_WRAPPER) stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" \
b8dad04b 3445 STAGE_PREFIX=stage3/ \
8f231b5d 3446 $(POSTSTAGE1_FLAGS_TO_PASS) \
b8dad04b 3447 $(STAGE2_FLAGS_TO_PASS)
d9835ae8 3448 $(STAMP) stage4_build
770861f3 3449 echo stage4_build > stage_last
204093e6
DT
3450
3451# Additional steps for *-lean targets:
770861f3 3452clean_s1: stage1_copy
b8dad04b 3453 -(cd stage1 && rm -f $(VOL_FILES))
d9835ae8 3454 $(STAMP) clean_s1
204093e6 3455
770861f3 3456clean_s2: stage2_copy
204093e6 3457 -rm -rf stage1
d9835ae8 3458 $(STAMP) clean_s2
204093e6 3459
770861f3
DD
3460# The various entry points for bootstrapping.
3461
3462bootstrap: stage3_build
3463 @echo
3464 @echo Bootstrap complete - make \"quickstrap\" to redo last build,
3465 @echo \"restage1\" through \"restage3\" to rebuild specific stages,
9c8d079c
JM
3466 @echo \"restrap\" to redo the bootstrap from stage1, or
3467 @echo \"cleanstrap\" to redo the bootstrap from scratch.
770861f3
DD
3468
3469bootstrap-lean : clean_s1 clean_s2 stage3_build
3470 @echo
3471 @echo Bootstrap complete - make \"quickstrap\" to redo last build,
3472 @echo or \"cleanstrap\" to redo the bootstrap from scratch.
3473
3474bootstrap2: bootstrap
3475
4f92461a 3476bootstrap2-lean : bootstrap-lean
770861f3
DD
3477
3478bootstrap3 bootstrap3-lean: bootstrap
4f92461a 3479
770861f3
DD
3480bootstrap4 bootstrap4-lean: stage4_build
3481
8f231b5d 3482unstage1 unstage2 unstage3 unstage4 unstageprofile unstagefeedback:
770861f3 3483 -set -vx; stage=`echo $@ | sed -e 's/un//'`; \
4992fc7f
RH
3484 rm -f $$stage/as$(exeext); \
3485 rm -f $$stage/ld$(exeext); \
3486 rm -f $$stage/collect-ld$(exeext); \
770861f3 3487 if test -d $$stage; then \
ff3d4e83 3488 mv $$stage/specs $(SPECS) 2>/dev/null || :; \
770861f3
DD
3489 mv $$stage/* . 2>/dev/null; \
3490 for i in `cd $$stage; echo *` ; do \
3491 if test -d $$stage/$$i; then \
3492 mv $$stage/$$i/* $$i/. 2>/dev/null; \
3493 else \
3494 mv $$stage/$$i .; \
20266bb1 3495 fi; \
770861f3
DD
3496 done \
3497 fi ; \
3498 rm -f $${stage}_build $${stage}_copy ;\
3499 echo $${stage}_build > stage_last
3500
3501restage1: unstage1
7f5cc0f3 3502 $(MAKE) $(REMAKEFLAGS) stage1_build
770861f3
DD
3503
3504restage2: unstage2
7f5cc0f3 3505 $(MAKE) $(REMAKEFLAGS) stage2_build
770861f3
DD
3506
3507restage3: unstage3
7f5cc0f3 3508 $(MAKE) $(REMAKEFLAGS) stage3_build
770861f3
DD
3509
3510restage4: unstage4
7f5cc0f3 3511 $(MAKE) $(REMAKEFLAGS) stage4_build
770861f3 3512
8f231b5d 3513restageprofile: unstageprofile
7f5cc0f3 3514 $(MAKE) $(REMAKEFLAGS) stageprofile_build
8f231b5d
JH
3515
3516restagefeedback: unstagefeedback
7f5cc0f3 3517 $(MAKE) $(REMAKEFLAGS) stagefeedback_build
8f231b5d 3518
40209195
JM
3519# Bubble up a bugfix through all the stages. Primarily useful for fixing
3520# bugs that cause the compiler to crash while building stage 2.
770861f3 3521bubblestrap:
40209195 3522 if test -f stage_last; then \
57ac311f 3523 LAST=`sed -e 's/_build//' < stage_last`; \
40209195 3524 if test "$$LAST" != "stage1"; then \
7f5cc0f3 3525 $(MAKE) $(REMAKEFLAGS) $$LAST; \
40209195
JM
3526 $(STAMP) $${LAST}_copy; \
3527 fi; \
3528 fi
3529 if test -f stage1_copy; then $(MAKE) unstage1; fi
7f5cc0f3 3530 $(MAKE) $(REMAKEFLAGS) stage1_copy
40209195 3531 if test -f stage2_copy; then $(MAKE) unstage2; fi
7f5cc0f3 3532 $(MAKE) $(REMAKEFLAGS) stage2_copy
40209195 3533 if test -f stage3_copy; then $(MAKE) unstage3; fi
7f5cc0f3 3534 $(MAKE) $(REMAKEFLAGS) stage3_build
40209195 3535 if test -f stage4_copy; then \
7f5cc0f3
KC
3536 $(MAKE) $(REMAKEFLAGS) stage3_copy; $(MAKE) unstage4; \
3537 $(MAKE) $(REMAKEFLAGS) stage4_build || exit 1; \
770861f3 3538 fi
770861f3
DD
3539
3540quickstrap:
3541 if test -f stage_last ; then \
7f5cc0f3 3542 LAST=`cat stage_last`; rm $$LAST; $(MAKE) $(REMAKEFLAGS) $$LAST; \
770861f3 3543 else \
7f5cc0f3 3544 $(MAKE) $(REMAKEFLAGS) stage1_build; \
770861f3
DD
3545 fi
3546
3547cleanstrap:
3548 -$(MAKE) clean
7f5cc0f3 3549 $(MAKE) $(REMAKEFLAGS) bootstrap
361e618f 3550
9c8d079c 3551unstrap:
a7db751a 3552 -rm -rf stage[234]*
9c8d079c 3553 $(MAKE) unstage1
a7db751a 3554 -rm -f stage_last
9c8d079c
JM
3555
3556# Differs from cleanstrap in that it starts from the earlier stage1 build,
3557# not from scratch.
3558restrap:
3559 $(MAKE) unstrap
7f5cc0f3 3560 $(MAKE) $(REMAKEFLAGS) bootstrap
9c8d079c 3561
269a7343
KG
3562# These targets compare the object files in the current directory with
3563# those in a stage directory. We need to skip the first N bytes of
3564# each object file. The "slow" mechanism assumes nothing special
3565# about cmp and uses the tail command to skip. ./ avoids a bug in
3566# some versions of tail. The "gnu" targets use gnu cmp (diffutils
3567# v2.4 or later), to avoid running tail and the overhead of twice
3568# copying each object file. Likewise, the "fast" targets use the skip
3569# parameter of cmp available on some systems to accomplish the same
3570# thing. An exit status of 1 is precisely the result we're looking
3571# for (other values mean other problems).
3572slowcompare slowcompare3 slowcompare4 slowcompare-lean slowcompare3-lean slowcompare4-lean \
3573fastcompare fastcompare3 fastcompare4 fastcompare-lean fastcompare3-lean fastcompare4-lean \
3574 gnucompare gnucompare3 gnucompare4 gnucompare-lean gnucompare3-lean gnucompare4-lean: force
3fb2f401 3575 -rm -f .bad_compare
269a7343 3576 case "$@" in *compare | *compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^[a-z]*compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
aab26e16 3577 for file in *$(objext); do \
269a7343
KG
3578 case "$@" in \
3579 slowcompare* ) \
013a2ee0 3580 tail +16c ./$$file > tmp-foo1; \
e85988b5 3581 tail +16c stage$$stage/$$file > tmp-foo2 \
3fb2f401 3582 && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
269a7343
KG
3583 ;; \
3584 fastcompare* ) \
3585 cmp $$file stage$$stage/$$file 16 16 > /dev/null 2>&1; \
3586 test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \
3587 ;; \
3588 gnucompare* ) \
3589 cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1; \
3590 test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \
3591 ;; \
3592 esac ; \
b1e3ddfd 3593 done
269a7343 3594 case "$@" in *compare | *compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^[a-z]*compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
6eb95e99 3595 for dir in tmp-foo $(SUBDIRS); do \
b1e3ddfd
AJ
3596 if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
3597 for file in $$dir/*$(objext); do \
269a7343
KG
3598 case "$@" in \
3599 slowcompare* ) \
3600 tail +16c ./$$file > tmp-foo1; \
3601 tail +16c stage$$stage/$$file > tmp-foo2 \
3602 && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
3603 ;; \
3604 fastcompare* ) \
3605 cmp $$file stage$$stage/$$file 16 16 > /dev/null 2>&1; \
3606 test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \
3607 ;; \
3608 gnucompare* ) \
3609 cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1; \
3610 test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \
3611 ;; \
3612 esac ; \
b1e3ddfd 3613 done; \
7ce1e6c8 3614 else true; fi; \
b1e3ddfd 3615 done
269a7343
KG
3616 -rm -f tmp-foo*
3617 case "$@" in *compare | *compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^[a-z]*compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
b1e3ddfd
AJ
3618 if [ -f .bad_compare ]; then \
3619 echo "Bootstrap comparison failure!"; \
3620 cat .bad_compare; \
3621 exit 1; \
e85988b5
MH
3622 else \
3623 case "$@" in \
3624 *-lean ) rm -rf stage$$stage ;; \
269a7343 3625 *) ;; \
e85988b5 3626 esac; true; \
b1e3ddfd
AJ
3627 fi
3628
c7a5cf61
PE
3629# Forwarding wrappers to the most appropriate version.
3630compare: @make_compare_target@
3631compare3: @make_compare_target@3
3632compare4: @make_compare_target@4
3633compare-lean: @make_compare_target@-lean
3634compare3-lean: @make_compare_target@3-lean
3635compare4-lean: @make_compare_target@4-lean
3636
79d8453e 3637# Copy the object files from a particular stage into a subdirectory.
013a2ee0 3638stage1-start:
2e494f70 3639 -if [ -d stage1 ] ; then true ; else mkdir stage1 ; fi
f472a17c 3640 $(MAKE) -f libgcc.mk libgcc-stage-start stage=stage1
6f3fcc0b 3641 -subdirs="$(SUBDIRS)"; for dir in $$subdirs; \
013a2ee0 3642 do \
9a517e7b 3643 if [ -d stage1/$$dir ] ; then true ; else mkdir stage1/$$dir ; fi ; \
013a2ee0 3644 done
ff3d4e83
AO
3645# If SPECS is overridden, make sure it is `installed' as specs.
3646 -mv $(SPECS) stage1/specs
79d8453e 3647 -mv $(STAGESTUFF) stage1
338023d4
DE
3648# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
3649# dir will work properly.
c926f674
DR
3650 -if [ -f as$(exeext) ] ; then (cd stage1 && $(LN_S) ../as$(exeext) .) ; else true ; fi
3651 -if [ -f ld$(exeext) ] ; then (cd stage1 && $(LN_S) ../ld$(exeext) .) ; else true ; fi
3652 -if [ -f collect-ld$(exeext) ] ; then (cd stage1 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
23af32e6 3653 -rm -f stage1/libgcc.a stage1/libgcc_eh.a stage1/libgcov.a
79d8453e 3654 -cp libgcc.a stage1
6dd05d08 3655 -$(RANLIB_FOR_TARGET) stage1/libgcc.a
23af32e6
NS
3656 -cp libgcov.a stage1
3657 -$(RANLIB_FOR_TARGET) stage1/libgcov.a
275b60d6 3658 -if [ -f libgcc_eh.a ] ; then cp libgcc_eh.a stage1; \
275b60d6 3659 $(RANLIB_FOR_TARGET) stage1/libgcc_eh.a; \
6dd05d08 3660 fi
04e95620
JM
3661 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
3662 cp stage1/$${f} . ; \
db814993 3663 else true; \
04e95620 3664 fi; done
013a2ee0 3665stage1: force stage1-start lang.stage1
4977bab6
ZW
3666 -for dir in . $(SUBDIRS) ; \
3667 do \
3668 rm -f $$dir/*$(coverageexts) ; \
3669 done
79d8453e 3670
013a2ee0 3671stage2-start:
2e494f70 3672 -if [ -d stage2 ] ; then true ; else mkdir stage2 ; fi
f472a17c 3673 $(MAKE) -f libgcc.mk libgcc-stage-start stage=stage2
56694dd9 3674 -subdirs="$(SUBDIRS)"; for dir in $$subdirs; \
013a2ee0 3675 do \
9a517e7b 3676 if [ -d stage2/$$dir ] ; then true ; else mkdir stage2/$$dir ; fi ; \
013a2ee0 3677 done
ff3d4e83
AO
3678# If SPECS is overridden, make sure it is `installed' as specs.
3679 -mv $(SPECS) stage2/specs
79d8453e 3680 -mv $(STAGESTUFF) stage2
338023d4
DE
3681# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
3682# dir will work properly.
c926f674
DR
3683 -if [ -f as$(exeext) ] ; then (cd stage2 && $(LN_S) ../as$(exeext) .) ; else true ; fi
3684 -if [ -f ld$(exeext) ] ; then (cd stage2 && $(LN_S) ../ld$(exeext) .) ; else true ; fi
3685 -if [ -f collect-ld$(exeext) ] ; then (cd stage2 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
23af32e6 3686 -rm -f stage2/libgcc.a stage2/libgcov.a stage2/libgcc_eh.a
79d8453e 3687 -cp libgcc.a stage2
6dd05d08 3688 -$(RANLIB_FOR_TARGET) stage2/libgcc.a
23af32e6
NS
3689 -cp libgcov.a stage2
3690 -$(RANLIB_FOR_TARGET) stage2/libgcov.a
275b60d6 3691 -if [ -f libgcc_eh.a ] ; then cp libgcc_eh.a stage2; \
275b60d6 3692 $(RANLIB_FOR_TARGET) stage2/libgcc_eh.a; \
6dd05d08 3693 fi
04e95620
JM
3694 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
3695 cp stage2/$${f} . ; \
db814993 3696 else true; \
04e95620 3697 fi; done
013a2ee0 3698stage2: force stage2-start lang.stage2
79d8453e 3699
013a2ee0 3700stage3-start:
935e11b0 3701 -if [ -d stage3 ] ; then true ; else mkdir stage3 ; fi
f472a17c 3702 $(MAKE) -f libgcc.mk libgcc-stage-start stage=stage3
56694dd9 3703 -subdirs="$(SUBDIRS)"; for dir in $$subdirs; \
013a2ee0 3704 do \
9a517e7b 3705 if [ -d stage3/$$dir ] ; then true ; else mkdir stage3/$$dir ; fi ; \
013a2ee0 3706 done
ff3d4e83
AO
3707# If SPECS is overridden, make sure it is `installed' as specs.
3708 -mv $(SPECS) stage3/specs
79d8453e 3709 -mv $(STAGESTUFF) stage3
338023d4
DE
3710# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
3711# dir will work properly.
c926f674
DR
3712 -if [ -f as$(exeext) ] ; then (cd stage3 && $(LN_S) ../as$(exeext) .) ; else true ; fi
3713 -if [ -f ld$(exeext) ] ; then (cd stage3 && $(LN_S) ../ld$(exeext) .) ; else true ; fi
3714 -if [ -f collect-ld$(exeext) ] ; then (cd stage3 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
23af32e6 3715 -rm -f stage3/libgcc.a stage3/libgcov.a stage3/libgcc_eh.a
79d8453e 3716 -cp libgcc.a stage3
6dd05d08 3717 -$(RANLIB_FOR_TARGET) stage3/libgcc.a
23af32e6
NS
3718 -cp libgcov.a stage3
3719 -$(RANLIB_FOR_TARGET) stage3/libgcov.a
275b60d6 3720 -if [ -f libgcc_eh.a ] ; then cp libgcc_eh.a stage3; \
275b60d6 3721 $(RANLIB_FOR_TARGET) stage3/libgcc_eh.a; \
6dd05d08 3722 fi
04e95620
JM
3723 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
3724 cp stage3/$${f} . ; \
db814993 3725 else true; \
04e95620 3726 fi; done
013a2ee0 3727stage3: force stage3-start lang.stage3
79d8453e 3728
013a2ee0 3729stage4-start:
935e11b0 3730 -if [ -d stage4 ] ; then true ; else mkdir stage4 ; fi
f472a17c 3731 $(MAKE) -f libgcc.mk libgcc-stage-start stage=stage4
56694dd9 3732 -subdirs="$(SUBDIRS)"; for dir in $$subdirs; \
013a2ee0 3733 do \
9a517e7b 3734 if [ -d stage4/$$dir ] ; then true ; else mkdir stage4/$$dir ; fi ; \
013a2ee0 3735 done
ff3d4e83
AO
3736# If SPECS is overridden, make sure it is `installed' as specs.
3737 -mv $(SPECS) stage4/specs
79d8453e 3738 -mv $(STAGESTUFF) stage4
338023d4
DE
3739# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
3740# dir will work properly.
c926f674
DR
3741 -if [ -f as$(exeext) ] ; then (cd stage4 && $(LN_S) ../as$(exeext) .) ; else true ; fi
3742 -if [ -f ld$(exeext) ] ; then (cd stage4 && $(LN_S) ../ld$(exeext) .) ; else true ; fi
3743 -if [ -f collect-ld$(exeext) ] ; then (cd stage4 && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
23af32e6 3744 -rm -f stage4/libgcc.a stage4/libgcov.a stage4/libgcc_eh.a
79d8453e 3745 -cp libgcc.a stage4
6dd05d08 3746 -$(RANLIB_FOR_TARGET) stage4/libgcc.a
23af32e6
NS
3747 -cp libgcov.a stage4
3748 -$(RANLIB_FOR_TARGET) stage4/libgcov.a
275b60d6 3749 -if [ -f libgcc_eh.a ] ; then cp libgcc_eh.a stage4; \
275b60d6 3750 $(RANLIB_FOR_TARGET) stage4/libgcc_eh.a; \
6dd05d08 3751 fi
04e95620
JM
3752 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
3753 cp stage4/$${f} . ; \
db814993 3754 else true; \
04e95620 3755 fi; done
013a2ee0 3756stage4: force stage4-start lang.stage4
79d8453e 3757
8f231b5d
JH
3758stageprofile-start:
3759 -if [ -d stageprofile ] ; then true ; else mkdir stageprofile ; fi
3760 $(MAKE) -f libgcc.mk libgcc-stage-start stage=stageprofile
56694dd9 3761 -subdirs="$(SUBDIRS)"; for dir in $$subdirs; \
8f231b5d
JH
3762 do \
3763 if [ -d stageprofile/$$dir ] ; then true ; else mkdir stageprofile/$$dir ; fi ; \
3764 done
3765 -mv $(STAGESTUFF) stageprofile
8f231b5d
JH
3766# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
3767# dir will work properly.
3768 -if [ -f as$(exeext) ] ; then (cd stageprofile && $(LN_S) ../as$(exeext) .) ; else true ; fi
3769 -if [ -f ld$(exeext) ] ; then (cd stageprofile && $(LN_S) ../ld$(exeext) .) ; else true ; fi
3770 -if [ -f collect-ld$(exeext) ] ; then (cd stageprofile && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
3771 -rm -f stageprofile/libgcc.a stageprofile/libgcov.a stageprofile/libgcc_eh.a
3772 -cp libgcc.a stageprofile
3773 -$(RANLIB_FOR_TARGET) stageprofile/libgcc.a
3774 -cp libgcov.a stageprofile
3775 -$(RANLIB_FOR_TARGET) stageprofile/libgcov.a
3776 -if [ -f libgcc_eh.a ] ; then cp libgcc_eh.a stageprofile; \
3777 $(RANLIB_FOR_TARGET) stageprofile/libgcc_eh.a; \
3778 fi
3779 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
3780 cp stageprofile/$${f} . ; \
3781 else true; \
3782 fi; done
3783stageprofile: force stageprofile-start lang.stageprofile
3784
3785stagefeedback-start:
3786 -if [ -d stagefeedback ] ; then true ; else mkdir stagefeedback ; fi
3787 $(MAKE) -f libgcc.mk libgcc-stage-start stage=stagefeedback
56694dd9 3788 -subdirs="$(SUBDIRS)"; for dir in $$subdirs; \
8f231b5d
JH
3789 do \
3790 if [ -d stagefeedback/$$dir ] ; then true ; else mkdir stagefeedback/$$dir ; fi ; \
3791 done
3792 -mv $(STAGESTUFF) stagefeedback
8f231b5d
JH
3793# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
3794# dir will work properly.
3795 -if [ -f as$(exeext) ] ; then (cd stagefeedback && $(LN_S) ../as$(exeext) .) ; else true ; fi
3796 -if [ -f ld$(exeext) ] ; then (cd stagefeedback && $(LN_S) ../ld$(exeext) .) ; else true ; fi
3797 -if [ -f collect-ld$(exeext) ] ; then (cd stagefeedback && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
3798 -rm -f stagefeedback/libgcc.a stagefeedback/libgcov.a stagefeedback/libgcc_eh.a
84fb2019 3799 -rm -f *.da
6eb95e99 3800 -for dir in fixinc po testsuite $(SUBDIRS); \
84fb2019
RK
3801 do \
3802 rm -f $$dir/*.da ; \
3803 done
8f231b5d
JH
3804 -cp libgcc.a stagefeedback
3805 -$(RANLIB_FOR_TARGET) stagefeedback/libgcc.a
3806 -cp libgcov.a stagefeedback
3807 -$(RANLIB_FOR_TARGET) stagefeedback/libgcov.a
3808 -if [ -f libgcc_eh.a ] ; then cp libgcc_eh.a stagefeedback; \
3809 $(RANLIB_FOR_TARGET) stagefeedback/libgcc_eh.a; \
3810 fi
3811 -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
3812 cp stagefeedback/$${f} . ; \
3813 else true; \
3814 fi; done
3815stagefeedback: force stagefeedback-start lang.stagefeedback
3816
79d8453e
RS
3817# Copy just the executable files from a particular stage into a subdirectory,
3818# and delete the object files. Use this if you're just verifying a version
3819# that is pretty sure to work, and you are short of disk space.
aab26e16 3820risky-stage1: stage1
e108653c 3821 -$(MAKE) clean
79d8453e 3822
aab26e16 3823risky-stage2: stage2
e108653c 3824 -$(MAKE) clean
79d8453e 3825
aab26e16 3826risky-stage3: stage3
e108653c 3827 -$(MAKE) clean
79d8453e 3828
aab26e16 3829risky-stage4: stage4
e108653c 3830 -$(MAKE) clean
79d8453e
RS
3831
3832#In GNU Make, ignore whether `stage*' exists.
f1908d70 3833.PHONY: stage1 stage2 stage3 stage4 clean maintainer-clean TAGS bootstrap
79d8453e 3834.PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
8f231b5d 3835.PHONY: stagefeedback stageprofile
79d8453e 3836
39e73137 3837# -----------------------------------------------------
5b7874aa
ZW
3838# Rules for generating translated message descriptions.
3839# Disabled by autoconf if the tools are not available.
39e73137 3840# -----------------------------------------------------
5b7874aa
ZW
3841
3842XGETTEXT = @XGETTEXT@
3843GMSGFMT = @GMSGFMT@
3844MSGMERGE = msgmerge
3845
3846PACKAGE = @PACKAGE@
3847CATALOGS = @CATALOGS@
3848
0f81faf6 3849.PHONY: build- install- build-po install-po update-po
5b7874aa
ZW
3850
3851# Dummy rules to deal with dependencies produced by use of
3852# "build-@POSUB@" and "install-@POSUB@" above, when NLS is disabled.
3853build-: ; @true
3854install-: ; @true
3855
3856build-po: $(CATALOGS)
3857
3858# This notation should be acceptable to all Make implementations used
3859# by people who are interested in updating .po files.
3860update-po: $(CATALOGS:.gmo=.pox)
3861
9f6682b7
ZW
3862# N.B. We do not attempt to copy these into $(srcdir). The snapshot
3863# script does that.
5b7874aa 3864.po.gmo:
7227d624 3865 -test -d po || mkdir po
bc524dd0 3866 $(GMSGFMT) --statistics -o $@ $<
5b7874aa 3867
9f6682b7
ZW
3868# The new .po has to be gone over by hand, so we deposit it into
3869# build/po with a different extension.
359cd11e
ZW
3870# If build/po/$(PACKAGE).pot exists, use it (it was just created),
3871# else use the one in srcdir.
5b7874aa 3872.po.pox:
7227d624 3873 -test -d po || mkdir po
359cd11e
ZW
3874 $(MSGMERGE) $< `if test -f po/$(PACKAGE).pot; \
3875 then echo po/$(PACKAGE).pot; \
3876 else echo $(srcdir)/po/$(PACKAGE).pot; fi` -o $@
5b7874aa 3877
9f6682b7
ZW
3878# This rule has to look for .gmo modules in both srcdir and
3879# the cwd, and has to check that we actually have a catalog
3880# for each language, in case they weren't built or included
3881# with the distribution.
5b7874aa
ZW
3882install-po:
3883 $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(datadir)
318b7749 3884 cats="$(CATALOGS)"; for cat in $$cats; do \
9f6682b7
ZW
3885 lang=`basename $$cat | sed 's/\.gmo$$//'`; \
3886 if [ -f $$cat ]; then :; \
3887 elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \
3888 else continue; \
3889 fi; \
5b7874aa
ZW
3890 dir=$(localedir)/$$lang/LC_MESSAGES; \
3891 echo $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$$dir; \
3892 $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$$dir || exit 1; \
9f6682b7
ZW
3893 echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
3894 $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
5b7874aa
ZW
3895 done
3896
3897# Rule for regenerating the message template (gcc.pot).
3898# Instead of forcing everyone to edit POTFILES.in, which proved impractical,
3899# this rule has no dependencies and always regenerates gcc.pot. This is
3900# relatively harmless since the .po files do not directly depend on it.
3901# Note that exgettext has an awk script embedded in it which requires a
3902# fairly modern (POSIX-compliant) awk.
359cd11e 3903# The .pot file is left in the build directory.
5b7874aa
ZW
3904$(PACKAGE).pot: po/$(PACKAGE).pot
3905po/$(PACKAGE).pot: force
7227d624 3906 -test -d po || mkdir po
5b7874aa
ZW
3907 $(MAKE) po-generated
3908 AWK=$(AWK) $(SHELL) $(srcdir)/po/exgettext \
3909 $(XGETTEXT) $(PACKAGE) $(srcdir)