]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/Makefile.in
ipa-utils.h (subbinfo_with_vtable_at_offset, [...]): Declare.
[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
23a5b65a 4# Copyright (C) 1987-2014 Free Software Foundation, Inc.
79d8453e 5
1322177d 6#This file is part of GCC.
79d8453e 7
1322177d 8#GCC is free software; you can redistribute it and/or modify
79d8453e 9#it under the terms of the GNU General Public License as published by
9dcd6f09 10#the Free Software Foundation; either version 3, or (at your option)
79d8453e
RS
11#any later version.
12
1322177d 13#GCC is distributed in the hope that it will be useful,
79d8453e
RS
14#but WITHOUT ANY WARRANTY; without even the implied warranty of
15#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16#GNU General Public License for more details.
17
18#You should have received a copy of the GNU General Public License
9dcd6f09
NC
19#along with GCC; see the file COPYING3. If not see
20#<http://www.gnu.org/licenses/>.
79d8453e
RS
21
22# The targets for external use include:
455c8f48 23# all, doc, install, install-cross, install-cross-rest, install-strip,
8b1f719a 24# uninstall, TAGS, mostlyclean, clean, distclean, maintainer-clean.
79d8453e 25
6c80a645 26# This is the default target.
73458fb7
NN
27# Set by autoconf to "all.internal" for a native build, or
28# "all.cross" to build a cross compiler.
29all: @ALL@
30
31# Depend on this to specify a phony target portably.
32force:
33
34# This tells GNU make version 3 not to export the variables
35# defined in this file into the environment (and thus recursive makes).
36.NOEXPORT:
37# And this tells it not to automatically pass command-line variables
38# to recursive makes.
39MAKEOVERRIDES =
6c80a645 40
03787dfd 41# Suppress smart makes who think they know how to automake yacc and flex file
2e494f70 42.y.c:
03787dfd 43.l.c:
2e494f70 44
73458fb7
NN
45# The only suffixes we want for implicit rules are .c and .o, so clear
46# the list and add them. This speeds up GNU Make, and allows -r to work.
47# For i18n support, we also need .gmo, .po, .pox.
48# This must come before the language makefile fragments to allow them to
49# add suffixes and rules of their own.
50.SUFFIXES:
9469b9b2 51.SUFFIXES: .c .cc .o .po .pox .gmo
73458fb7
NN
52
53# -------------------------------
54# Standard autoconf-set variables
55# -------------------------------
56
4665e56c
NN
57build=@build@
58host=@host@
73458fb7 59target=@target@
e165d61b 60target_noncanonical:=@target_noncanonical@
73458fb7
NN
61
62# Sed command to transform gcc to installed name.
e165d61b 63program_transform_name := @program_transform_name@
73458fb7
NN
64
65# -----------------------------
66# Directories used during build
67# -----------------------------
68
69# Directory where sources are, from where we are.
70srcdir = @srcdir@
ad3a7ce3 71gcc_docdir = @srcdir@/doc
71cbe2c1
KC
72
73# Directory where sources are, absolute.
74abs_srcdir = @abs_srcdir@
75abs_docdir = @abs_srcdir@/doc
3859c32a 76
5da9128a
PB
77# Top build directory for this package, relative to here.
78top_builddir = .
3bbd5a19 79
da0f6381
PB
80# The absolute path to the current directory.
81objdir := $(shell pwd)
73458fb7 82
215c351a 83host_subdir=@host_subdir@
71b5d516 84build_subdir=@build_subdir@
3bbd5a19 85target_subdir=@target_subdir@
57255173 86build_libsubdir=@build_libsubdir@
71b5d516 87
3bbd5a19 88# Top build directory for the "Cygnus tree", relative to $(top_builddir).
215c351a 89ifeq ($(host_subdir),.)
3bbd5a19 90toplevel_builddir := ..
215c351a 91else
3bbd5a19 92toplevel_builddir := ../..
215c351a
PB
93endif
94
3bbd5a19
PB
95build_objdir := $(toplevel_builddir)/$(build_subdir)
96build_libobjdir := $(toplevel_builddir)/$(build_libsubdir)
97target_objdir := $(toplevel_builddir)/$(target_subdir)
98
65455962
KC
99# --------
100# Defined vpaths
101# --------
102
103# Directory where sources are, from where we are.
104VPATH = @srcdir@
105
5340bbea 106# We define a vpath for the sources of the .texi files here because they
65455962
KC
107# are split between multiple directories and we would rather use one implicit
108# pattern rule for everything.
109# This vpath could be extended within the Make-lang fragments.
110
d683ec81
PB
111vpath %.texi $(gcc_docdir)
112vpath %.texi $(gcc_docdir)/include
65455962 113
73458fb7
NN
114# --------
115# UNSORTED
116# --------
117
79d8453e
RS
118# Variables that exist for you to override.
119# See below for how to change them for certain systems.
120
013a2ee0 121# List of language subdirectories.
19361834 122SUBDIRS =@subdirs@ build
013a2ee0 123
79d8453e 124# Selection of languages to be made.
cc11cc9b 125CONFIG_LANGUAGES = @all_selected_languages@
c77556a5
RX
126LANGUAGES = c gcov$(exeext) gcov-dump$(exeext) gcov-tool$(exeext) \
127 $(CONFIG_LANGUAGES)
79d8453e 128
00afcaa0 129# Default values for variables overridden in Makefile fragments.
78faa32d 130# CFLAGS is for the user to override to, e.g., do a cross build with -O2.
b8dad04b 131# TCFLAGS is used for compilations with the GCC just built.
00afcaa0
PB
132# T_CFLAGS is used for all compilations and is overridden by t-* files.
133T_CFLAGS =
b8dad04b 134TCFLAGS =
ec6c7392 135CFLAGS = @CFLAGS@
00020c16 136CXXFLAGS = @CXXFLAGS@
cc11cc9b 137LDFLAGS = @LDFLAGS@
b8dad04b 138
459260ec
DM
139# Should we build position-independent host code?
140PICFLAG = @PICFLAG@
141
22aa533e
NS
142# Flags to determine code coverage. When coverage is disabled, this will
143# contain the optimization flags, as you normally want code coverage
e61a2eb7 144# without optimization.
22aa533e 145COVERAGE_FLAGS = @coverage_flags@
160e2e4f 146coverageexts = .{gcda,gcno}
22aa533e 147
8b1f719a 148# The warning flags are separate from CFLAGS because people tend to
5b67ad6f
DA
149# override optimization flags and we'd like them to still have warnings
150# turned on. These flags are also used to pass other stage dependent
151# flags from configure. The user is free to explicitly turn these flags
152# off if they wish.
b8dad04b 153# LOOSE_WARN are the warning flags to use when compiling something
8dd9a120 154# which is only compiled with gcc, such as libgcc.
00020c16 155# C_LOOSE_WARN is similar, but with C-only warnings.
8b1f719a 156# STRICT_WARN are the additional warning flags to
8dd9a120 157# apply to the back end and some front ends, which may be compiled
8b1f719a 158# with other compilers.
00020c16 159# C_STRICT_WARN is similar, with C-only warnings.
3bbd5a19 160LOOSE_WARN = @loose_warn@
00020c16 161C_LOOSE_WARN = @c_loose_warn@
8b1f719a 162STRICT_WARN = @strict_warn@
00020c16 163C_STRICT_WARN = @c_strict_warn@
b8dad04b 164
204250d2
RH
165# This is set by --enable-checking. The idea is to catch forgotten
166# "extern" tags in header files.
167NOCOMMON_FLAG = @nocommon_flag@
168
e9411247
MM
169NOEXCEPTION_FLAGS = @noexception_flags@
170
73e232f0 171# This is set by --disable-maintainer-mode (default) to "#"
a88fdc2a
NP
172# FIXME: 'MAINT' will always be set to an empty string, no matter if
173# --disable-maintainer-mode is used or not. This is because the
174# following will expand to "MAINT := " in maintainer mode, and to
175# "MAINT := #" in non-maintainer mode, but because '#' starts a comment,
176# they mean exactly the same thing for make.
e9c4897b 177MAINT := @MAINT@
73e232f0 178
a88fdc2a
NP
179# The following provides the variable ENABLE_MAINTAINER_RULES that can
180# be used in language Make-lang.in makefile fragments to enable
181# maintainer rules. So, ENABLE_MAINTAINER_RULES is 'true' in
182# maintainer mode, and '' otherwise.
183@MAINT@ ENABLE_MAINTAINER_RULES = true
184
414d23ae
HPN
185# These are set by --enable-checking=valgrind.
186RUN_GEN = @valgrind_command@
187VALGRIND_DRIVER_DEFINES = @valgrind_path_defines@
188
b8dad04b
ZW
189# This is how we control whether or not the additional warnings are applied.
190.-warn = $(STRICT_WARN)
9a43b902 191build-warn = $(STRICT_WARN)
00020c16
ILT
192GCC_WARN_CFLAGS = $(LOOSE_WARN) $(C_LOOSE_WARN) $($(@D)-warn) $(if $(filter-out $(STRICT_WARN),$($(@D)-warn)),,$(C_STRICT_WARN)) $(NOCOMMON_FLAG) $($@-warn)
193GCC_WARN_CXXFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $($@-warn)
dd859b8a 194
89a42ac8
ZW
195# These files are to have specific diagnostics suppressed, or are not to
196# be subject to -Werror:
87f85ea0 197# flex output may yield harmless "no previous prototype" warnings
406176be 198build/gengtype-lex.o-warn = -Wno-error
f142b5bc 199gengtype-lex.o-warn = -Wno-error
c77556a5
RX
200libgcov-util.o-warn = -Wno-error
201libgcov-driver-tool.o-warn = -Wno-error
202libgcov-merge-tool.o-warn = -Wno-error
b8dad04b
ZW
203
204# All warnings have to be shut off in stage1 if the compiler used then
205# isn't gcc; configure determines that. WARN_CFLAGS will be either
00020c16
ILT
206# $(GCC_WARN_CFLAGS), or nothing. Similarly, WARN_CXXFLAGS will be
207# either $(GCC_WARN_CXXFLAGS), or nothing.
b8dad04b 208WARN_CFLAGS = @warn_cflags@
00020c16 209WARN_CXXFLAGS = @warn_cxxflags@
b8dad04b 210
f5d394a6
DB
211CPPFLAGS = @CPPFLAGS@
212
ab87f8c8 213AWK = @AWK@
b614ee64 214CC = @CC@
00020c16 215CXX = @CXX@
1e608388 216BISON = @BISON@
0777e4c6 217BISONFLAGS =
1e608388
ZW
218FLEX = @FLEX@
219FLEXFLAGS =
f6a874ac 220AR = @AR@
79d8453e 221AR_FLAGS = rc
f6a874ac 222NM = @NM@
6822468a 223RANLIB = @RANLIB@
343a6100 224RANLIB_FLAGS = @ranlib_flags@
73458fb7 225
ed2eaa9f
ILT
226# Libraries to use on the host.
227HOST_LIBS = @HOST_LIBS@
228
00020c16 229# The name of the compiler to use.
00020c16
ILT
230COMPILER = $(CXX)
231COMPILER_FLAGS = $(CXXFLAGS)
ed2eaa9f
ILT
232# If HOST_LIBS is set, then the user is controlling the libraries to
233# link against. In that case, link with $(CC) so that the -lstdc++
234# library is not introduced. If HOST_LIBS is not set, link with
235# $(CXX) to pick up -lstdc++.
236ifeq ($(HOST_LIBS),)
00020c16
ILT
237LINKER = $(CXX)
238LINKER_FLAGS = $(CXXFLAGS)
ed2eaa9f
ILT
239else
240LINKER = $(CC)
241LINKER_FLAGS = $(CFLAGS)
242endif
7980bfb8 243
427b248d
JM
244# Like LINKER, but use a mutex for serializing front end links.
245ifeq (@DO_LINK_MUTEX@,true)
246LLINKER = $(SHELL) $(srcdir)/lock-and-run.sh linkfe.lck $(LINKER)
247else
248LLINKER = $(LINKER)
249endif
250
73458fb7
NN
251# -------------------------------------------
252# Programs which operate on the build machine
253# -------------------------------------------
254
b41e09a7 255SHELL = @SHELL@
1e6347d8
RO
256# pwd command to use. Allow user to override default by setting PWDCMD in
257# the environment to account for automounters. The make variable must not
258# be called PWDCMD, otherwise the value set here is passed to make
259# subprocesses and overrides the setting from the user's environment.
8c90b13a
L
260# Don't use PWD since it is a common shell environment variable and we
261# don't want to corrupt it.
262PWD_COMMAND = $${PWDCMD-pwd}
79d8453e 263# on sysV, define this as cp.
3c18ea24 264INSTALL = @INSTALL@
ac64120e
JW
265# Some systems may be missing symbolic links, regular links, or both.
266# Allow configure to check this and use "ln -s", "ln", or "cp" as appropriate.
267LN=@LN@
268LN_S=@LN_S@
79d8453e 269# These permit overriding just for certain files.
fca9d4b0
MH
270INSTALL_PROGRAM = @INSTALL_PROGRAM@
271INSTALL_DATA = @INSTALL_DATA@
7c1e8336 272INSTALL_SCRIPT = @INSTALL@
455c8f48
RW
273install_sh = $(SHELL) $(srcdir)/../install-sh
274INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
09fa0705 275MAKEINFO = @MAKEINFO@
a541f69d 276MAKEINFOFLAGS = --no-split
d8984b6e 277TEXI2DVI = texi2dvi
b5422ad7 278TEXI2PDF = texi2pdf
9d65c5cb 279TEXI2HTML = $(MAKEINFO) --html
fd939e46 280TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl
b361b153 281POD2MAN = pod2man --center="GNU" --release="gcc-$(version)" --date=$(shell sed 's/\(....\)\(..\)\(..\)/\1-\2-\3/' <$(DATESTAMP))
5262d6b6 282# Some versions of `touch' (such as the version on Solaris 2.8)
d9835ae8 283# do not correctly set the timestamp due to buggy versions of `utime'
5262d6b6 284# in the kernel. So, we use `echo' instead.
d9835ae8 285STAMP = echo timestamp >
703fdf5a
RW
286# If necessary (e.g., when using the MSYS shell on Microsoft Windows)
287# translate the shell's notion of absolute pathnames to the native
288# spelling.
a0e527e3 289build_file_translate = @build_file_translate@
d9835ae8 290
73458fb7
NN
291# Make sure the $(MAKE) variable is defined.
292@SET_MAKE@
293
947c6b00
NN
294# Locate mkinstalldirs.
295mkinstalldirs=$(SHELL) $(srcdir)/../mkinstalldirs
296
a4e4a2d6
RW
297# write_entries_to_file - writes each entry in a list
298# to the specified file. Entries are written in chunks of
073a8998 299# $(write_entries_to_file_split) to accommodate systems with
a4e4a2d6
RW
300# severe command-line-length limitations.
301# Parameters:
302# $(1): variable containing entries to iterate over
303# $(2): output file
304write_entries_to_file_split = 50
305write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) \
306 $(foreach range, \
307 $(shell i=1; while test $$i -le $(words $(1)); do \
308 echo $$i; i=`expr $$i + $(write_entries_to_file_split)`; done), \
1b77ee03
MM
309 $(shell echo "$(wordlist $(range), \
310 $(shell expr $(range) + $(write_entries_to_file_split) - 1), $(1))" \
2fdb618d 311 | tr ' ' '\012' >> $(2)))
a4e4a2d6 312
73458fb7
NN
313# --------
314# UNSORTED
315# --------
316
043378c3 317# Dependency tracking stuff.
54c09437 318CXXDEPMODE = @CXXDEPMODE@
043378c3
TT
319DEPDIR = @DEPDIR@
320depcomp = $(SHELL) $(srcdir)/../depcomp
321
c11c795e
TT
322# In the past we used AC_PROG_CC_C_O and set this properly, but
323# it was discovered that this hadn't worked in a long time, so now
324# we just hard-code.
325OUTPUT_OPTION = -o $@
73458fb7 326
b8dad04b
ZW
327# This is where we get zlib from. zlibdir is -L../zlib and zlibinc is
328# -I../zlib, unless we were configured with --with-system-zlib, in which
329# case both are empty.
330ZLIB = @zlibdir@ -lz
331ZLIBINC = @zlibinc@
79d8453e 332
6de9cd9a
DN
333# How to find GMP
334GMPLIBS = @GMPLIBS@
335GMPINC = @GMPINC@
336
33ad93b9 337# How to find ISL
eae1a5d4 338ISLLIBS = @ISLLIBS@
33ad93b9 339ISLINC = @ISLINC@
f8bf9252
SP
340
341# How to find CLOOG
342CLOOGLIBS = @CLOOGLIBS@
343CLOOGINC = @CLOOGINC@
344
d7f09764
DN
345# Set to 'yes' if the LTO front end is enabled.
346enable_lto = @enable_lto@
347
de3f621b 348# Compiler and flags needed for plugin support
de3f621b
JR
349PLUGINCC = @CXX@
350PLUGINCFLAGS = @CXXFLAGS@
eeb971c9
EB
351
352# Libs and linker options needed for plugin support
68a607d8
DN
353PLUGINLIBS = @pluginlibs@
354
bf016de8
RAE
355enable_plugin = @enable_plugin@
356
459260ec
DM
357enable_host_shared = @enable_host_shared@
358
6046b0ed 359CPPLIB = ../libcpp/libcpp.a
4f4e53dd
PB
360CPPINC = -I$(srcdir)/../libcpp/include
361
909e2256 362# Where to find decNumber
79b87c74 363enable_decimal_float = @enable_decimal_float@
909e2256 364DECNUM = $(srcdir)/../libdecnumber
79b87c74
MM
365DECNUMFMT = $(srcdir)/../libdecnumber/$(enable_decimal_float)
366DECNUMINC = -I$(DECNUM) -I$(DECNUMFMT) -I../libdecnumber
909e2256
JG
367LIBDECNUMBER = ../libdecnumber/libdecnumber.a
368
d83697f4
ILT
369# The backtrace library.
370BACKTRACE = $(srcdir)/../libbacktrace
371BACKTRACEINC = -I$(BACKTRACE)
372LIBBACKTRACE = ../libbacktrace/.libs/libbacktrace.a
373
ba1811f1 374# Target to use when installing include directory. Either
ff3aaf17 375# install-headers-tar, install-headers-cpio or install-headers-cp.
3c18ea24 376INSTALL_HEADERS_DIR = @build_install_headers_dir@
ba1811f1 377
d7371761
RK
378# Header files that are made available under the same name
379# to programs compiled with GCC.
b7f0fff2 380USER_H = $(srcdir)/ginclude/float.h \
d57a4b98
RH
381 $(srcdir)/ginclude/iso646.h \
382 $(srcdir)/ginclude/stdarg.h \
383 $(srcdir)/ginclude/stdbool.h \
384 $(srcdir)/ginclude/stddef.h \
385 $(srcdir)/ginclude/varargs.h \
0f996086 386 $(srcdir)/ginclude/stdfix.h \
bbceee64 387 $(srcdir)/ginclude/stdnoreturn.h \
d19fa6b5 388 $(srcdir)/ginclude/stdalign.h \
39b2468c 389 $(srcdir)/ginclude/stdatomic.h \
d57a4b98 390 $(EXTRA_HEADERS)
d7371761 391
9b91e436
KT
392USER_H_INC_NEXT_PRE = @user_headers_inc_next_pre@
393USER_H_INC_NEXT_POST = @user_headers_inc_next_post@
394
fa958513 395# The GCC to use for compiling crt*.o.
bf428f48 396# Usually the one we just built.
fa958513 397# Don't use this as a dependency--use $(GCC_PASSES).
4977bab6 398GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include -L$(objdir)/../ld
79d8453e 399
c875f596
DN
400# Set if the compiler was configured with --with-build-sysroot.
401SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
402
79d8453e 403# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
da0f6381 404# It specifies -B./.
3c9a2b55 405# It also specifies -isystem ./include to find, e.g., stddef.h.
00020c16 406GCC_CFLAGS=$(CFLAGS_FOR_TARGET) $(INTERNAL_CFLAGS) $(T_CFLAGS) $(LOOSE_WARN) $(C_LOOSE_WARN) -Wold-style-definition $($@-warn) -isystem ./include $(TCFLAGS)
79d8453e 407
73458fb7
NN
408# ---------------------------------------------------
409# Programs which produce files for the target machine
410# ---------------------------------------------------
7e717196 411
4ac29b33 412AR_FOR_TARGET := $(shell \
7e717196
JL
413 if [ -f $(objdir)/../binutils/ar ] ; then \
414 echo $(objdir)/../binutils/ar ; \
415 else \
4665e56c 416 if [ "$(host)" = "$(target)" ] ; then \
f6a874ac 417 echo $(AR); \
7e717196 418 else \
455c8f48 419 t='$(program_transform_name)'; echo ar | sed -e "$$t" ; \
7e717196 420 fi; \
4ac29b33 421 fi)
5262d6b6 422AR_FLAGS_FOR_TARGET =
7bde2862
GK
423AR_CREATE_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) rc
424AR_EXTRACT_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) x
ed0db39f 425LIPO_FOR_TARGET = lipo
9f18db39 426ORIGINAL_AS_FOR_TARGET = @ORIGINAL_AS_FOR_TARGET@
4ac29b33 427RANLIB_FOR_TARGET := $(shell \
7e717196
JL
428 if [ -f $(objdir)/../binutils/ranlib ] ; then \
429 echo $(objdir)/../binutils/ranlib ; \
430 else \
4665e56c 431 if [ "$(host)" = "$(target)" ] ; then \
6dd05d08 432 echo $(RANLIB); \
7e717196 433 else \
455c8f48 434 t='$(program_transform_name)'; echo ranlib | sed -e "$$t" ; \
7e717196 435 fi; \
4ac29b33 436 fi)
9f18db39
PB
437ORIGINAL_LD_FOR_TARGET = @ORIGINAL_LD_FOR_TARGET@
438ORIGINAL_NM_FOR_TARGET = @ORIGINAL_NM_FOR_TARGET@
439NM_FOR_TARGET = ./nm
ed0db39f 440STRIP_FOR_TARGET := $(shell \
455c8f48
RW
441 if [ -f $(objdir)/../binutils/strip-new ] ; then \
442 echo $(objdir)/../binutils/strip-new ; \
ed0db39f
GK
443 else \
444 if [ "$(host)" = "$(target)" ] ; then \
445 echo strip; \
446 else \
455c8f48 447 t='$(program_transform_name)'; echo strip | sed -e "$$t" ; \
ed0db39f
GK
448 fi; \
449 fi)
7e717196 450
73458fb7
NN
451# --------
452# UNSORTED
453# --------
454
4e872036
AS
455# Where to find some libiberty headers.
456HASHTAB_H = $(srcdir)/../include/hashtab.h
e980df8e 457OBSTACK_H = $(srcdir)/../include/obstack.h
5193cc6d 458SPLAY_TREE_H= $(srcdir)/../include/splay-tree.h
e980df8e 459MD5_H = $(srcdir)/../include/md5.h
ee666c25 460XREGEX_H = $(srcdir)/../include/xregex.h
f9bf5a8e 461FNMATCH_H = $(srcdir)/../include/fnmatch.h
4e872036 462
d7f09764
DN
463# Linker plugin API headers
464LINKER_PLUGIN_API_H = $(srcdir)/../include/plugin-api.h
d7f09764 465
a078a589 466# Default native SYSTEM_HEADER_DIR, to be overridden by targets.
08b2bad2 467NATIVE_SYSTEM_HEADER_DIR = @NATIVE_SYSTEM_HEADER_DIR@
512b62fb 468# Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
4977bab6 469CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
512b62fb 470
a078a589 471# autoconf sets SYSTEM_HEADER_DIR to one of the above.
073a8998 472# Purge it of unnecessary internal relative paths
be448346
BS
473# to directories that might not exist yet.
474# The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta.
70d0631e
RW
475# Use single quotes here to avoid nested double- and backquotes, this
476# macro is also used in a double-quoted context.
477SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta`
a078a589 478
52c0e446 479# Control whether to run fixincludes.
0df47f66 480STMP_FIXINC = @STMP_FIXINC@
ac1284f9 481
40dc28fc
ILT
482# Test to see whether <limits.h> exists in the system header files.
483LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
484
4977bab6
ZW
485# Directory for prefix to system directories, for
486# each of $(system_prefix)/usr/include, $(system_prefix)/usr/lib, etc.
487TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
ce86ad58 488TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@
4977bab6 489
2ed26f6b
ZW
490xmake_file=@xmake_file@
491tmake_file=@tmake_file@
aca600aa
AS
492TM_ENDIAN_CONFIG=@TM_ENDIAN_CONFIG@
493TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@
494TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@
3c18ea24
RK
495out_file=$(srcdir)/config/@out_file@
496out_object_file=@out_object_file@
c49a6962
JM
497common_out_file=$(srcdir)/common/config/@common_out_file@
498common_out_object_file=@common_out_object_file@
8677664e 499md_file=$(srcdir)/common.md $(srcdir)/config/@md_file@
4977bab6 500tm_file_list=@tm_file_list@
e22340b0 501tm_include_list=@tm_include_list@
d5355cb2 502tm_defines=@tm_defines@
11642c3a 503tm_p_file_list=@tm_p_file_list@
e22340b0 504tm_p_include_list=@tm_p_include_list@
11642c3a 505build_xm_file_list=@build_xm_file_list@
e22340b0 506build_xm_include_list=@build_xm_include_list@
11642c3a
ZW
507build_xm_defines=@build_xm_defines@
508host_xm_file_list=@host_xm_file_list@
e22340b0 509host_xm_include_list=@host_xm_include_list@
11642c3a 510host_xm_defines=@host_xm_defines@
e22340b0
ZW
511xm_file_list=@xm_file_list@
512xm_include_list=@xm_include_list@
3d9d2476 513xm_defines=@xm_defines@
d4a10d0a
SB
514lang_checks=
515lang_checks_parallelized=
717c4789
JJ
516# Upper limit to which it is useful to parallelize this lang target.
517# It doesn't make sense to try e.g. 128 goals for small testsuites
518# like objc or go.
519check_gcc_parallelize=10000
39dabefd 520lang_opt_files=@lang_opt_files@ $(srcdir)/c-family/c.opt $(srcdir)/common.opt
3c18ea24 521lang_specs_files=@lang_specs_files@
3103b7db 522lang_tree_files=@lang_tree_files@
11642c3a 523target_cpu_default=@target_cpu_default@
d8bb17c8 524OBJC_BOEHM_GC=@objc_boehm_gc@
0974c7d7 525extra_modes_file=@extra_modes_file@
75685792 526extra_opt_files=@extra_opt_files@
476d9098 527host_hook_obj=@out_host_hook_obj@
79d8453e 528
e0cdc09f
MK
529# Multiarch support
530enable_multiarch = @enable_multiarch@
d757eae9 531with_cpu = @with_cpu@
e0cdc09f
MK
532with_float = @with_float@
533ifeq ($(enable_multiarch),yes)
534 if_multiarch = $(1)
e0cdc09f 535else
9eae3904
MK
536 ifeq ($(enable_multiarch),auto)
537 # SYSTEM_HEADER_DIR is makefile syntax, cannot be evaluated in configure.ac
538 if_multiarch = $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib/*/crti.o),$(1))
539 else
540 if_multiarch =
541 endif
e0cdc09f
MK
542endif
543
73458fb7
NN
544# ------------------------
545# Installation directories
546# ------------------------
547
79d8453e
RS
548# Common prefix for installation directories.
549# NOTE: This directory must exist when you start installation.
3c18ea24 550prefix = @prefix@
c844ddda
RS
551# Directory in which to put localized header files. On the systems with
552# gcc as the native cc, `local_prefix' may not be `prefix' which is
553# `/usr'.
0b2fbcb2 554# NOTE: local_prefix *should not* default from prefix.
3c18ea24 555local_prefix = @local_prefix@
2e494f70 556# Directory in which to put host dependent programs and libraries
3c18ea24 557exec_prefix = @exec_prefix@
79d8453e 558# Directory in which to put the executable for the command `gcc'
3c18ea24 559bindir = @bindir@
79d8453e 560# Directory in which to put the directories used by the compiler.
3c18ea24 561libdir = @libdir@
a8ee6e2d
GK
562# Directory in which GCC puts its executables.
563libexecdir = @libexecdir@
73458fb7
NN
564
565# --------
566# UNSORTED
567# --------
568
a8ee6e2d 569# Directory in which the compiler finds libraries etc.
caa55b1e 570libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(version)
a8ee6e2d 571# Directory in which the compiler finds executables
caa55b1e 572libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(version)
f142b5bc
RG
573# Directory in which all plugin resources are installed
574plugin_resourcesdir = $(libsubdir)/plugin
575 # Directory in which plugin headers are installed
576plugin_includedir = $(plugin_resourcesdir)/include
577# Directory in which plugin specific executables are installed
578plugin_bindir = $(libexecsubdir)/plugin
91c7bd9b 579# Used to produce a relative $(gcc_tooldir) in gcc.o
1f72bfca 580unlibsubdir = ../../..
15c723f3
RS
581# $(prefix), expressed as a path relative to $(libsubdir).
582#
583# An explanation of the sed strings:
584# -e 's|^$(prefix)||' matches and eliminates 'prefix' from 'exec_prefix'
585# -e 's|/$$||' match a trailing forward slash and eliminates it
586# -e 's|^[^/]|/|' forces the string to start with a forward slash (*)
587# -e 's|/[^/]*|../|g' replaces each occurrence of /<directory> with ../
588#
589# (*) Note this pattern overwrites the first character of the string
590# with a forward slash if one is not already present. This is not a
591# problem because the exact names of the sub-directories concerned is
592# unimportant, just the number of them matters.
593#
594# The practical upshot of these patterns is like this:
595#
596# prefix exec_prefix result
597# ------ ----------- ------
598# /foo /foo/bar ../
599# /foo/ /foo/bar ../
600# /foo /foo/bar/ ../
601# /foo/ /foo/bar/ ../
602# /foo /foo/bar/ugg ../../
603libsubdir_to_prefix := \
604 $(unlibsubdir)/$(shell echo "$(libdir)" | \
605 sed -e 's|^$(prefix)||' -e 's|/$$||' -e 's|^[^/]|/|' \
606 -e 's|/[^/]*|../|g')
607# $(exec_prefix), expressed as a path relative to $(prefix).
608prefix_to_exec_prefix := \
609 $(shell echo "$(exec_prefix)" | \
610 sed -e 's|^$(prefix)||' -e 's|^/||' -e '/./s|$$|/|')
d062c304 611# Directory in which to find other cross-compilation tools and headers.
4c112cda 612dollar = @dollar@
d062c304
JL
613# Used in install-cross.
614gcc_tooldir = @gcc_tooldir@
f098ead2 615# Since gcc_tooldir does not exist at build-time, use -B$(build_tooldir)/bin/
caa55b1e 616build_tooldir = $(exec_prefix)/$(target_noncanonical)
e2187d3b
BK
617# Directory in which the compiler finds target-independent g++ includes.
618gcc_gxx_include_dir = @gcc_gxx_include_dir@
17719d09 619gcc_gxx_include_dir_add_sysroot = @gcc_gxx_include_dir_add_sysroot@
49ba557e 620# Directory to search for site-specific includes.
793e9558
PB
621local_includedir = $(local_prefix)/include
622includedir = $(prefix)/include
0b2fbcb2 623# where the info files go
3c18ea24 624infodir = @infodir@
587a4ba6
L
625# Where cpp should go besides $prefix/bin if necessary
626cpp_install_dir = @cpp_install_dir@
ab87f8c8 627# where the locale files go
191bf464 628datadir = @datadir@
ab87f8c8 629localedir = $(datadir)/locale
79d8453e 630# Extension (if any) to put in installed man-page filename.
77bd67cb
JM
631man1ext = .1
632man7ext = .7
173712fb 633objext = .o
6e26218f
ILT
634exeext = @host_exeext@
635build_exeext = @build_exeext@
173712fb 636
79d8453e 637# Directory in which to put man pages.
a76b6b40
MH
638mandir = @mandir@
639man1dir = $(mandir)/man1
77bd67cb 640man7dir = $(mandir)/man7
62c13b81
RS
641# Dir for temp files.
642tmpdir = /tmp
79d8453e 643
22482f74
MS
644datarootdir = @datarootdir@
645docdir = @docdir@
9288b845 646# Directory in which to build HTML
22482f74 647build_htmldir = $(objdir)/HTML/gcc-$(version)
9d65c5cb 648# Directory in which to put HTML
22482f74 649htmldir = @htmldir@
9d65c5cb 650
ab87f8c8
JL
651# Whether we were configured with NLS.
652USE_NLS = @USE_NLS@
653
654# Internationalization library.
56694dd9
ZW
655LIBINTL = @LIBINTL@
656LIBINTL_DEP = @LIBINTL_DEP@
ab87f8c8 657
62c62a4f
RO
658# Character encoding conversion library.
659LIBICONV = @LIBICONV@
56694dd9 660LIBICONV_DEP = @LIBICONV_DEP@
62c62a4f 661
0a25f1f5
RH
662# If a supplementary library is being used for the GC.
663GGC_LIB=
664
160633c6
MM
665# "true" if the target C library headers are unavailable; "false"
666# otherwise.
667inhibit_libc = @inhibit_libc@
668ifeq ($(inhibit_libc),true)
669INHIBIT_LIBC_CFLAGS = -Dinhibit_libc
670endif
671
79d8453e 672# List of extra executables that should be compiled for this target machine
d82c57a8 673# that are used when linking.
79d8453e 674# The rules for compiling them should be in the t-* file for the machine.
3c18ea24 675EXTRA_PROGRAMS = @extra_programs@
2e494f70 676
2e494f70
RS
677# List of extra object files that should be compiled and linked with
678# compiler proper (cc1, cc1obj, cc1plus).
3c18ea24 679EXTRA_OBJS = @extra_objs@
2e494f70 680
43554690
RK
681# List of extra object files that should be compiled and linked with
682# the gcc driver.
30500d84 683EXTRA_GCC_OBJS =@extra_gcc_objs@
43554690 684
e3b3fa45
RO
685# List of extra libraries that should be linked with the gcc driver.
686EXTRA_GCC_LIBS = @EXTRA_GCC_LIBS@
687
f780d21b 688# List of additional header files to install.
3c18ea24 689EXTRA_HEADERS =@extra_headers_list@
f780d21b 690
207bf79d
JM
691# How to handle <stdint.h>.
692USE_GCC_STDINT = @use_gcc_stdint@
693
c38f02df
ILT
694# The configure script will set this to collect2$(exeext), except on a
695# (non-Unix) host which can not build collect2, for which it will be
696# set to empty.
697COLLECT2 = @collect2@
47547081 698
79d8453e 699# Program to convert libraries.
4c457b6b 700LIBCONVERT =
79d8453e
RS
701
702# Control whether header files are installed.
e34a3d31 703INSTALL_HEADERS=install-headers install-mkheaders
79d8453e 704
09fa0705
ZW
705# Control whether Info documentation is built and installed.
706BUILD_INFO = @BUILD_INFO@
09fa0705 707
fd939e46
JM
708# Control whether manpages generated by texi2pod.pl can be rebuilt.
709GENERATED_MANPAGES = @GENERATED_MANPAGES@
710
66d7ffbf 711# Additional directories of header files to run fixincludes on.
4ab08223
RS
712# These should be directories searched automatically by default
713# just as /usr/include is.
4c457b6b 714# *Do not* use this for directories that happen to contain
4ab08223 715# header files, but are not searched automatically by default.
66d7ffbf
RS
716# On most systems, this is empty.
717OTHER_FIXINCLUDES_DIRS=
718
7c27f801 719# A list of all the language-specific executables.
d4a10d0a 720COMPILERS = @all_compilers@
7c27f801 721
acbbf3d9 722# List of things which should already be built whenever we try to use xgcc
79d8453e 723# to compile anything (without linking).
d4a10d0a 724GCC_PASSES=xgcc$(exeext) specs
79d8453e 725
79d8453e
RS
726# Directory to link to, when using the target `maketest'.
727DIR = ../gcc
728
a078a589 729# Native compiler for the build machine and its switches.
eaf9f3b2 730CC_FOR_BUILD = @CC_FOR_BUILD@
bdd5dc28 731CXX_FOR_BUILD = @CXX_FOR_BUILD@
4977bab6 732BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE
bdd5dc28 733BUILD_CXXFLAGS = @BUILD_CXXFLAGS@ -DGENERATOR_FILE
a078a589 734
7980bfb8 735# Native compiler that we use. This may be C++ some day.
bdd5dc28
DN
736COMPILER_FOR_BUILD = $(CXX_FOR_BUILD)
737BUILD_COMPILERFLAGS = $(BUILD_CXXFLAGS)
7980bfb8 738
c607156f 739# Native linker that we use.
bdd5dc28
DN
740LINKER_FOR_BUILD = $(CXX_FOR_BUILD)
741BUILD_LINKERFLAGS = $(BUILD_CXXFLAGS)
c607156f 742
a078a589 743# Native linker and preprocessor flags. For x-fragment overrides.
f8c33439 744BUILD_LDFLAGS=@BUILD_LDFLAGS@
2ceb362d
AM
745BUILD_CPPFLAGS= -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
746 -I$(srcdir)/../include @INCINTL@ $(CPPINC) $(CPPFLAGS)
79d8453e 747
338023d4 748# Actual name to use when installing a native compiler.
e165d61b
KC
749GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)')
750GCC_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo gcc|sed '$(program_transform_name)')
751CPP_INSTALL_NAME := $(shell echo cpp|sed '$(program_transform_name)')
e165d61b 752GCOV_INSTALL_NAME := $(shell echo gcov|sed '$(program_transform_name)')
c77556a5 753GCOV_TOOL_INSTALL_NAME := $(shell echo gcov-tool|sed '$(program_transform_name)')
338023d4 754
e933cbe0
JL
755# Setup the testing framework, if you have one
756EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
757 echo $${rootme}/../expect/expect ; \
758 else echo expect ; fi`
759
760RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
761 echo $${srcdir}/../dejagnu/runtest ; \
762 else echo runtest; fi`
763RUNTESTFLAGS =
764
3bd6d4c4
AO
765# This should name the specs file that we're going to install. Target
766# Makefiles may override it and name another file to be generated from
767# the built-in specs and installed as the default spec, as long as
768# they also introduce a rule to generate a file name specs, to be used
769# at build time.
770SPECS = specs
771
fd438373
MM
772# Extra include files that are defined by HeaderInclude directives in
773# the .opt files
774OPTIONS_H_EXTRA =
775
776# Extra include files that are defined by SourceInclude directives in
777# the .opt files
6f4185d7 778OPTIONS_C_EXTRA = $(PRETTY_PRINT_H)
fd438373
MM
779
780@option_includes@
781
79d8453e
RS
782# End of variables for you to override.
783
4977bab6
ZW
784# GTM_H lists the config files that the generator files depend on,
785# while TM_H lists the ones ordinary gcc files depend on, which
786# includes several files generated by those generators.
e980df8e 787BCONFIG_H = bconfig.h $(build_xm_file_list)
4977bab6 788CONFIG_H = config.h $(host_xm_file_list)
1b0c37d7 789TCONFIG_H = tconfig.h $(xm_file_list)
4977bab6 790TM_P_H = tm_p.h $(tm_p_file_list)
c513ce77 791GTM_H = tm.h $(tm_file_list) insn-constants.h
852b75ed 792TM_H = $(GTM_H) insn-flags.h $(OPTIONS_H)
4977bab6 793
a1286ef5 794# Variables for version information.
f08dd1f8
ZW
795BASEVER := $(srcdir)/BASE-VER # 4.x.y
796DEVPHASE := $(srcdir)/DEV-PHASE # experimental, prerelease, ""
797DATESTAMP := $(srcdir)/DATESTAMP # YYYYMMDD or empty
db5b4110 798REVISION := $(srcdir)/REVISION # [BRANCH revision XXXXXX]
a1286ef5 799
f08dd1f8
ZW
800BASEVER_c := $(shell cat $(BASEVER))
801DEVPHASE_c := $(shell cat $(DEVPHASE))
802DATESTAMP_c := $(shell cat $(DATESTAMP))
a1286ef5 803
db5b4110
L
804ifeq (,$(wildcard $(REVISION)))
805REVISION_c :=
f8ed6dc5 806REVISION :=
db5b4110
L
807else
808REVISION_c := $(shell cat $(REVISION))
809endif
810
f08dd1f8 811version := $(BASEVER_c)
a1286ef5
ZW
812
813# For use in version.c - double quoted strings, with appropriate
814# surrounding punctuation and spaces, and with the datestamp and
815# development phase collapsed to the empty string in release mode
816# (i.e. if DEVPHASE_c is empty). The space immediately after the
817# comma in the $(if ...) constructs is significant - do not remove it.
f08dd1f8
ZW
818BASEVER_s := "\"$(BASEVER_c)\""
819DEVPHASE_s := "\"$(if $(DEVPHASE_c), ($(DEVPHASE_c)))\""
820DATESTAMP_s := "\"$(if $(DEVPHASE_c), $(DATESTAMP_c))\""
2f41c1d6
PB
821PKGVERSION_s:= "\"@PKGVERSION@\""
822BUGURL_s := "\"@REPORT_BUGS_TO@\""
823
824PKGVERSION := @PKGVERSION@
825BUGURL_TEXI := @REPORT_BUGS_TEXI@
a1286ef5 826
db5b4110
L
827ifdef REVISION_c
828REVISION_s := "\"$(if $(DEVPHASE_c), $(REVISION_c))\""
829else
cf8aba7f 830REVISION_s := "\"\""
db5b4110
L
831endif
832
e980df8e 833# Shorthand variables for dependency lists.
7b3b6ae4 834DUMPFILE_H = $(srcdir)/../libcpp/include/line-map.h dumpfile.h
9771b263 835VEC_H = vec.h statistics.h $(GGC_H)
0823efed 836HASH_TABLE_H = $(HASHTAB_H) hash-table.h
9771b263 837EXCEPT_H = except.h $(HASHTAB_H)
acce4e77
JM
838TARGET_DEF = target.def target-hooks-macros.h
839C_TARGET_DEF = c-family/c-target.def target-hooks-macros.h
c49a6962 840COMMON_TARGET_DEF = common/common-target.def target-hooks-macros.h
f5273574 841TARGET_H = $(TM_H) target.h $(TARGET_DEF) insn-modes.h insn-codes.h
acce4e77 842C_TARGET_H = c-family/c-target.h $(C_TARGET_DEF)
677f3fa8 843COMMON_TARGET_H = common/common-target.h $(INPUT_H) $(COMMON_TARGET_DEF)
e980df8e
TT
844MACHMODE_H = machmode.h mode-classes.def insn-modes.h
845HOOKS_H = hooks.h $(MACHMODE_H)
846HOSTHOOKS_DEF_H = hosthooks-def.h $(HOOKS_H)
847LANGHOOKS_DEF_H = langhooks-def.h $(HOOKS_H)
38f8b050 848TARGET_DEF_H = target-def.h target-hooks-def.h $(HOOKS_H) targhooks.h
acce4e77 849C_TARGET_DEF_H = c-family/c-target-def.h c-family/c-target-hooks-def.h \
677f3fa8 850 $(TREE_H) $(C_COMMON_H) $(HOOKS_H) common/common-targhooks.h
79bdca32
SB
851RTL_BASE_H = coretypes.h rtl.h rtl.def $(MACHMODE_H) reg-notes.def \
852 insn-notes.def $(INPUT_H) $(REAL_H) statistics.h $(VEC_H) \
853 $(FIXED_VALUE_H) alias.h $(HASHTAB_H)
e63ea00c 854FIXED_VALUE_H = fixed-value.h $(MACHMODE_H) double-int.h
9771b263 855RTL_H = $(RTL_BASE_H) $(FLAGS_H) genrtl.h
9f418533 856READ_MD_H = $(OBSTACK_H) $(HASHTAB_H) read-md.h
e980df8e 857PARAMS_H = params.h params.def
0a35513e 858BUILTINS_DEF = builtins.def sync-builtins.def omp-builtins.def \
939b37da 859 gtm-builtins.def sanitizer.def cilkplus.def cilk-builtins.def
25583c4f
RS
860INTERNAL_FN_DEF = internal-fn.def
861INTERNAL_FN_H = internal-fn.h $(INTERNAL_FN_DEF)
5e351e96
DN
862TREE_CORE_H = tree-core.h coretypes.h all-tree.def tree.def \
863 c-family/c-common.def $(lang_tree_files) $(MACHMODE_H) \
864 $(BUILTINS_DEF) $(INPUT_H) statistics.h \
865 $(VEC_H) treestruct.def $(HASHTAB_H) \
9771b263 866 double-int.h alias.h $(SYMTAB_H) $(FLAGS_H) \
39dabefd 867 $(REAL_H) $(FIXED_VALUE_H)
5e351e96 868TREE_H = tree.h $(TREE_CORE_H) tree-check.h
7a8cba34 869REGSET_H = regset.h $(BITMAP_H) hard-reg-set.h
6889a650
FW
870BASIC_BLOCK_H = basic-block.h $(PREDICT_H) $(VEC_H) $(FUNCTION_H) \
871 cfg-flags.def cfghooks.h
9f25a338 872GIMPLE_H = gimple.h gimple.def gsstruct.def $(VEC_H) \
9771b263 873 $(GGC_H) $(BASIC_BLOCK_H) $(TREE_H) tree-ssa-operands.h \
daa6e488 874 tree-ssa-alias.h $(INTERNAL_FN_H) $(HASH_TABLE_H) is-a.h
c77556a5 875GCOV_IO_H = gcov-io.h gcov-iov.h auto-host.h gcov-counter.def
e980df8e 876RECOG_H = recog.h
e980df8e 877EMIT_RTL_H = emit-rtl.h
79bdca32 878FLAGS_H = flags.h flag-types.h $(OPTIONS_H)
fd438373 879OPTIONS_H = options.h flag-types.h $(OPTIONS_H_EXTRA)
9771b263
DN
880FUNCTION_H = function.h $(HASHTAB_H) $(TM_H) hard-reg-set.h \
881 $(VEC_H) $(INPUT_H) $(MACHMODE_H)
e980df8e 882EXPR_H = expr.h insn-config.h $(FUNCTION_H) $(RTL_H) $(FLAGS_H) $(TREE_H) $(MACHMODE_H) $(EMIT_RTL_H)
cd1440b1 883OPTABS_H = optabs.h insn-codes.h insn-opinit.h
539bac37 884REGS_H = regs.h $(MACHMODE_H) hard-reg-set.h
9771b263 885CFGLOOP_H = cfgloop.h $(BASIC_BLOCK_H) double-int.h \
7a8cba34 886 $(BITMAP_H) sbitmap.h
e980df8e 887IPA_UTILS_H = ipa-utils.h $(TREE_H) $(CGRAPH_H)
e63ea00c 888IPA_REFERENCE_H = ipa-reference.h $(BITMAP_H) $(TREE_H)
3e097227 889CGRAPH_H = cgraph.h $(VEC_H) $(TREE_H) $(BASIC_BLOCK_H) $(FUNCTION_H) \
d122681a 890 cif-code.def ipa-ref.h $(LINKER_PLUGIN_API_H) is-a.h
7a8cba34
SB
891DF_H = df.h $(BITMAP_H) $(REGSET_H) sbitmap.h $(BASIC_BLOCK_H) \
892 alloc-pool.h $(TIMEVAR_H)
e980df8e 893RESOURCE_H = resource.h hard-reg-set.h $(DF_H)
6afbc885 894GCC_H = gcc.h version.h $(DIAGNOSTIC_CORE_H)
e63ea00c 895GGC_H = ggc.h gtype-desc.h statistics.h
e980df8e 896TIMEVAR_H = timevar.h timevar.def
88a00ef7 897INSN_ATTR_H = insn-attr.h insn-attr-common.h $(INSN_ADDR_H)
9771b263 898INSN_ADDR_H = $(srcdir)/insn-addr.h
532aafad 899C_COMMON_H = c-family/c-common.h c-family/c-common.def $(TREE_H) \
39dabefd
SB
900 $(SPLAY_TREE_H) $(CPPLIB_H) $(GGC_H) $(DIAGNOSTIC_CORE_H)
901C_PRAGMA_H = c-family/c-pragma.h $(CPPLIB_H)
0a6c2227 902C_TREE_H = c/c-tree.h $(C_COMMON_H) $(DIAGNOSTIC_H)
e63ea00c
RW
903SYSTEM_H = system.h hwint.h $(srcdir)/../include/libiberty.h \
904 $(srcdir)/../include/safe-ctype.h $(srcdir)/../include/filenames.h
e980df8e 905PREDICT_H = predict.h predict.def
d8044160
GK
906CPPLIB_H = $(srcdir)/../libcpp/include/line-map.h \
907 $(srcdir)/../libcpp/include/cpplib.h
e63ea00c 908INPUT_H = $(srcdir)/../libcpp/include/line-map.h input.h
dc357798 909OPTS_H = $(INPUT_H) $(VEC_H) opts.h $(OBSTACK_H)
e63ea00c 910SYMTAB_H = $(srcdir)/../libcpp/include/symtab.h $(OBSTACK_H)
d8044160 911CPP_ID_DATA_H = $(CPPLIB_H) $(srcdir)/../libcpp/include/cpp-id-data.h
e63ea00c 912CPP_INTERNAL_H = $(srcdir)/../libcpp/internal.h $(CPP_ID_DATA_H)
7b3b6ae4
LC
913TREE_DUMP_H = tree-dump.h $(SPLAY_TREE_H) $(DUMPFILE_H)
914TREE_PASS_H = tree-pass.h $(TIMEVAR_H) $(DUMPFILE_H)
3fadf78a 915TREE_SSA_H = tree-ssa.h tree-ssa-operands.h \
7a8cba34 916 $(BITMAP_H) sbitmap.h $(BASIC_BLOCK_H) $(GIMPLE_H) \
5006671f
RG
917 $(HASHTAB_H) $(CGRAPH_H) $(IPA_REFERENCE_H) \
918 tree-ssa-alias.h
e63ea00c 919PRETTY_PRINT_H = pretty-print.h $(INPUT_H) $(OBSTACK_H)
ee666c25
SB
920TREE_PRETTY_PRINT_H = tree-pretty-print.h $(PRETTY_PRINT_H)
921GIMPLE_PRETTY_PRINT_H = gimple-pretty-print.h $(TREE_PRETTY_PRINT_H)
7c475d11 922DIAGNOSTIC_CORE_H = diagnostic-core.h $(INPUT_H) bversion.h diagnostic.def
1da2ed5f 923DIAGNOSTIC_H = diagnostic.h $(DIAGNOSTIC_CORE_H) $(PRETTY_PRINT_H)
39dabefd
SB
924C_PRETTY_PRINT_H = c-family/c-pretty-print.h $(PRETTY_PRINT_H) \
925 $(C_COMMON_H) $(TREE_H)
9771b263 926TREE_INLINE_H = tree-inline.h
e980df8e 927REAL_H = real.h $(MACHMODE_H)
d7f09764 928LTO_STREAMER_H = lto-streamer.h $(LINKER_PLUGIN_API_H) $(TARGET_H) \
4a8fb1a1 929 $(CGRAPH_H) $(VEC_H) $(HASH_TABLE_H) $(TREE_H) $(GIMPLE_H) \
9f25a338 930 $(GCOV_IO_H) $(DIAGNOSTIC_H) alloc-pool.h
310bc633 931IPA_PROP_H = ipa-prop.h $(TREE_H) $(VEC_H) $(CGRAPH_H) $(GIMPLE_H) alloc-pool.h
e63ea00c 932BITMAP_H = bitmap.h $(HASHTAB_H) statistics.h
ee666c25
SB
933GCC_PLUGIN_H = gcc-plugin.h highlev-plugin-common.h plugin.def \
934 $(CONFIG_H) $(SYSTEM_H) $(HASHTAB_H)
3e17e31d 935PLUGIN_H = plugin.h $(GCC_PLUGIN_H)
0c463e16 936PLUGIN_VERSION_H = plugin-version.h configargs.h
8c5005ce 937CONTEXT_H = context.h
c4df8f8c 938
544eb21e 939#\f
79d8453e
RS
940# Now figure out from those variables how to compile and link.
941
a078a589
ZW
942# IN_GCC distinguishes between code compiled into GCC itself and other
943# programs built during a bootstrap.
2989d30c
GK
944# autoconf inserts -DCROSS_DIRECTORY_STRUCTURE if we are building a
945# cross compiler which does not use the native headers and libraries.
459260ec 946INTERNAL_CFLAGS = -DIN_GCC $(PICFLAG) @CROSS@
79d8453e 947
83599948 948# This is the variable actually used when we compile. If you change this,
a6a5e4c9 949# you probably want to update BUILD_CFLAGS in configure.ac
7a3b4887 950ALL_CFLAGS = $(T_CFLAGS) $(CFLAGS-$@) \
da0f6381 951 $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@
79d8453e 952
00020c16 953# The C++ version.
295409e1 954ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) $(INTERNAL_CFLAGS) \
e9411247 955 $(COVERAGE_FLAGS) $(NOEXCEPTION_FLAGS) $(WARN_CXXFLAGS) @DEFS@
00020c16 956
3a6ebcdc
PB
957# Likewise. Put INCLUDES at the beginning: this way, if some autoconf macro
958# puts -I options in CPPFLAGS, our include files in the srcdir will always
959# win against random include files in /usr/include.
da0f6381 960ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS)
79d8453e 961
7980bfb8 962# This is the variable to use when using $(COMPILER).
00020c16 963ALL_COMPILERFLAGS = $(ALL_CXXFLAGS)
7980bfb8 964
c607156f 965# This is the variable to use when using $(LINKER).
00020c16 966ALL_LINKERFLAGS = $(ALL_CXXFLAGS)
c607156f 967
71b5d516 968# Build and host support libraries.
459260ec
DM
969
970# Use the "pic" build of libiberty if --enable-host-shared.
971ifeq ($(enable_host_shared),yes)
972LIBIBERTY = ../libiberty/pic/libiberty.a
973BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/pic/libiberty.a
974else
06f0b04c 975LIBIBERTY = ../libiberty/libiberty.a
57255173 976BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
459260ec 977endif
79d8453e 978
935bfb44 979# Dependencies on the intl and portability libraries.
2691e6d7 980LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) \
d83697f4 981 $(LIBDECNUMBER) $(LIBBACKTRACE)
79d8453e
RS
982
983# Likewise, for use in the tools that must run on this machine
984# even if we are cross-building GCC.
4977bab6 985BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
79d8453e
RS
986
987# How to link with both our special library facilities
988# and the system's installed libraries.
d83697f4
ILT
989LIBS = @LIBS@ libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBBACKTRACE) \
990 $(LIBIBERTY) $(LIBDECNUMBER) $(HOST_LIBS)
eae1a5d4 991BACKENDLIBS = $(CLOOGLIBS) $(ISLLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
181e5ea4 992 $(ZLIB)
7d600178
RO
993# Any system libraries needed just for GNAT.
994SYSLIBS = @GNAT_LIBEXC@
995
96ee6e08 996# Used from ada/gcc-interface/Make-lang.in
3d4e720a
ST
997GNATBIND = @GNATBIND@
998GNATMAKE = @GNATMAKE@
999
62c9aa5f
ZW
1000# Libs needed (at present) just for jcf-dump.
1001LDEXP_LIB = @LDEXP_LIB@
1002
79d8453e
RS
1003# Likewise, for use in the tools that must run on this machine
1004# even if we are cross-building GCC.
4977bab6 1005BUILD_LIBS = $(BUILD_LIBIBERTY)
79d8453e 1006
9b68b6ea 1007BUILD_RTL = build/rtl.o build/read-rtl.o build/ggc-none.o \
10692477
RS
1008 build/vec.o build/min-insn-modes.o build/gensupport.o \
1009 build/print-rtl.o
9b68b6ea 1010BUILD_MD = build/read-md.o
3b620440 1011BUILD_ERRORS = build/errors.o
79d8453e
RS
1012
1013# Specify the directories to be searched for header files.
1014# Both . and srcdir are used, in that order,
eaf4e618 1015# so that *config.h will be found in the compilation
79d8453e 1016# subdirectory rather than in the source directory.
b8dad04b
ZW
1017# -I$(@D) and -I$(srcdir)/$(@D) cause the subdirectory of the file
1018# currently being compiled, in both source trees, to be examined as well.
6eb95e99 1019# libintl.h will be found in ../intl if we are using the included libintl.
b8dad04b 1020INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
6de9cd9a 1021 -I$(srcdir)/../include @INCINTL@ \
d83697f4 1022 $(CPPINC) $(GMPINC) $(DECNUMINC) $(BACKTRACEINC) \
33ad93b9 1023 $(CLOOGINC) $(ISLINC)
79d8453e 1024
043378c3 1025COMPILE.base = $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) -o $@
54c09437 1026ifeq ($(CXXDEPMODE),depmode=gcc3)
043378c3
TT
1027# Note a subtlety here: we use $(@D) for the directory part, to make
1028# things like the go/%.o rule work properly; but we use $(*F) for the
1029# file part, as we just want the file part of the stem, not the entire
1030# file name.
1031COMPILE = $(COMPILE.base) -MT $@ -MMD -MP -MF $(@D)/$(DEPDIR)/$(*F).TPo
1032POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(*F).TPo $(@D)/$(DEPDIR)/$(*F).Po
1033else
1034COMPILE = source='$<' object='$@' libtool=no \
54c09437 1035 DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) $(COMPILE.base)
043378c3
TT
1036POSTCOMPILE =
1037endif
1038
9469b9b2 1039.cc.o .c.o:
043378c3
TT
1040 $(COMPILE) $<
1041 $(POSTCOMPILE)
79d8453e 1042
544eb21e 1043#\f
73458fb7
NN
1044# Support for additional languages (other than C).
1045# C can be supported this way too (leave for later).
013a2ee0 1046
2ed26f6b 1047LANG_MAKEFRAGS = @all_lang_makefrags@
013a2ee0
DE
1048
1049# Flags to pass to recursive makes.
8b1f719a 1050# CC is set by configure.
013a2ee0 1051# ??? The choices here will need some experimenting with.
e158a5fb
MM
1052
1053export AR_FOR_TARGET
1054export AR_CREATE_FOR_TARGET
1055export AR_FLAGS_FOR_TARGET
1056export AR_EXTRACT_FOR_TARGET
1057export AWK
e158a5fb
MM
1058export DESTDIR
1059export GCC_FOR_TARGET
1060export INCLUDES
1061export INSTALL_DATA
040b1c5a 1062export LIPO_FOR_TARGET
e158a5fb
MM
1063export MACHMODE_H
1064export NM_FOR_TARGET
040b1c5a 1065export STRIP_FOR_TARGET
e158a5fb
MM
1066export RANLIB_FOR_TARGET
1067export libsubdir
e158a5fb 1068
8b1f719a 1069FLAGS_TO_PASS = \
da0f6381 1070 "ADA_CFLAGS=$(ADA_CFLAGS)" \
013a2ee0
DE
1071 "BISON=$(BISON)" \
1072 "BISONFLAGS=$(BISONFLAGS)" \
5b67ad6f 1073 "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
013a2ee0 1074 "LDFLAGS=$(LDFLAGS)" \
1e608388
ZW
1075 "FLEX=$(FLEX)" \
1076 "FLEXFLAGS=$(FLEXFLAGS)" \
6a810ff4
OH
1077 "INSTALL=$(INSTALL)" \
1078 "INSTALL_DATA=$(INSTALL_DATA)" \
1079 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
1080 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
ac64120e
JW
1081 "LN=$(LN)" \
1082 "LN_S=$(LN_S)" \
013a2ee0
DE
1083 "MAKEINFO=$(MAKEINFO)" \
1084 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
03bbd83f 1085 "MAKEOVERRIDES=" \
013a2ee0 1086 "SHELL=$(SHELL)" \
aab26e16 1087 "exeext=$(exeext)" \
6e26218f 1088 "build_exeext=$(build_exeext)" \
aab26e16 1089 "objext=$(objext)" \
013a2ee0
DE
1090 "exec_prefix=$(exec_prefix)" \
1091 "prefix=$(prefix)" \
3bf810d8 1092 "local_prefix=$(local_prefix)" \
8f8d3278 1093 "gxx_include_dir=$(gcc_gxx_include_dir)" \
f098ead2 1094 "build_tooldir=$(build_tooldir)" \
91c7bd9b 1095 "gcc_tooldir=$(gcc_tooldir)" \
013a2ee0 1096 "bindir=$(bindir)" \
0ac3cb2a 1097 "libexecsubdir=$(libexecsubdir)" \
2d09b640 1098 "datarootdir=$(datarootdir)" \
ab87f8c8 1099 "datadir=$(datadir)" \
ab87f8c8 1100 "localedir=$(localedir)"
544eb21e 1101#\f
79d8453e
RS
1102# Lists of files for various purposes.
1103
75685792
RS
1104# All option source files
1105ALL_OPT_FILES=$(lang_opt_files) $(extra_opt_files)
1106
aac69a49
NC
1107# Target specific, C specific object file
1108C_TARGET_OBJS=@c_target_objs@
1109
1110# Target specific, C++ specific object file
1111CXX_TARGET_OBJS=@cxx_target_objs@
1112
c776a6d0
DF
1113# Target specific, Fortran specific object file
1114FORTRAN_TARGET_OBJS=@fortran_target_objs@
1115
d4a10d0a 1116# Object files for gcc many-languages driver.
677f3fa8 1117GCC_OBJS = gcc.o ggc-none.o
14c7833c 1118
e6ac0270
GS
1119c-family-warn = $(STRICT_WARN)
1120
39dabefd
SB
1121# Language-specific object files shared by all C-family front ends.
1122C_COMMON_OBJS = c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o \
1123 c-family/c-format.o c-family/c-gimplify.o c-family/c-lex.o \
1124 c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o \
1125 c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o \
98906124 1126 c-family/c-semantics.o c-family/c-ada-spec.o \
c02065fc 1127 c-family/c-cilkplus.o \
939b37da 1128 c-family/array-notation-common.o c-family/cilk.o c-family/c-ubsan.o
e8066a5d 1129
79d8453e 1130# Language-independent object files.
d5dc6bad
ILT
1131# We put the insn-*.o files first so that a parallel make will build
1132# them sooner, because they are large and otherwise tend to be the
1133# last objects to finish building.
252b3e8c 1134OBJS = \
d5dc6bad
ILT
1135 insn-attrtab.o \
1136 insn-automata.o \
41723253 1137 insn-dfatab.o \
d5dc6bad
ILT
1138 insn-emit.o \
1139 insn-extract.o \
41723253 1140 insn-latencytab.o \
d5dc6bad
ILT
1141 insn-modes.o \
1142 insn-opinit.o \
1143 insn-output.o \
1144 insn-peep.o \
1145 insn-preds.o \
1146 insn-recog.o \
0fe60a1b 1147 insn-enums.o \
cd030c07 1148 ggc-page.o \
d5dc6bad
ILT
1149 alias.o \
1150 alloc-pool.o \
6fb5fa3c 1151 auto-inc-dec.o \
d5dc6bad
ILT
1152 bb-reorder.o \
1153 bitmap.o \
1154 bt-load.o \
1155 builtins.o \
1156 caller-save.o \
1157 calls.o \
1158 cfg.o \
1159 cfganal.o \
1160 cfgbuild.o \
1161 cfgcleanup.o \
1162 cfgexpand.o \
1163 cfghooks.o \
d5dc6bad
ILT
1164 cfgloop.o \
1165 cfgloopanal.o \
1166 cfgloopmanip.o \
1167 cfgrtl.o \
2aae7680 1168 symtab.o \
252b3e8c
MM
1169 cgraph.o \
1170 cgraphbuild.o \
1171 cgraphunit.o \
66a20fc2 1172 cgraphclones.o \
939b37da 1173 cilk-common.o \
d5dc6bad 1174 combine.o \
c7a0240a 1175 combine-stack-adj.o \
e692f276 1176 compare-elim.o \
8c5005ce 1177 context.o \
d5dc6bad
ILT
1178 convert.o \
1179 coverage.o \
252b3e8c
MM
1180 cppbuiltin.o \
1181 cppdefault.o \
e45425ec 1182 cprop.o \
d5dc6bad
ILT
1183 cse.o \
1184 cselib.o \
f0efc7aa
DN
1185 data-streamer.o \
1186 data-streamer-in.o \
1187 data-streamer-out.o \
d5dc6bad 1188 dbxout.o \
6fb5fa3c
DB
1189 dbgcnt.o \
1190 dce.o \
d5dc6bad
ILT
1191 ddg.o \
1192 debug.o \
1193 df-core.o \
1194 df-problems.o \
1195 df-scan.o \
1196 dfp.o \
d5dc6bad
ILT
1197 dojump.o \
1198 dominance.o \
1199 domwalk.o \
1200 double-int.o \
6fb5fa3c 1201 dse.o \
78c60e3d 1202 dumpfile.o \
d5dc6bad 1203 dwarf2asm.o \
647a1567 1204 dwarf2cfi.o \
d5dc6bad
ILT
1205 dwarf2out.o \
1206 emit-rtl.o \
1207 et-forest.o \
1208 except.o \
1209 explow.o \
1210 expmed.o \
1211 expr.o \
1212 final.o \
1e1ba002 1213 fixed-value.o \
d5dc6bad
ILT
1214 fold-const.o \
1215 function.o \
1216 fwprop.o \
1217 gcse.o \
d5dc6bad 1218 ggc-common.o \
726a989a 1219 gimple.o \
ff2a63a7 1220 gimple-builder.o \
2a0603f1 1221 gimple-expr.o \
726a989a 1222 gimple-iterator.o \
cbdd87d4 1223 gimple-fold.o \
d5dc6bad 1224 gimple-low.o \
726a989a 1225 gimple-pretty-print.o \
8fdc414d 1226 gimple-ssa-isolate-paths.o \
f9453c07 1227 gimple-ssa-strength-reduction.o \
f0efc7aa
DN
1228 gimple-streamer-in.o \
1229 gimple-streamer-out.o \
5be5c238 1230 gimple-walk.o \
d5dc6bad 1231 gimplify.o \
18f429e2 1232 gimplify-me.o \
c6a13190 1233 godump.o \
d5dc6bad 1234 graph.o \
66f97d31 1235 graphds.o \
f8bf9252 1236 graphite.o \
204b560f
SP
1237 graphite-blocking.o \
1238 graphite-clast-to-gimple.o \
f6cc3103 1239 graphite-isl-ast-to-gimple.o \
204b560f
SP
1240 graphite-dependences.o \
1241 graphite-interchange.o \
b60cc080 1242 graphite-optimize-isl.o \
204b560f 1243 graphite-poly.o \
204b560f
SP
1244 graphite-scop-detection.o \
1245 graphite-sese-to-poly.o \
d5dc6bad
ILT
1246 gtype-desc.o \
1247 haifa-sched.o \
9d9c740d 1248 hw-doloop.o \
c59ffc41 1249 hwint.o \
d5dc6bad 1250 ifcvt.o \
26cd9add 1251 ree.o \
6d8eb96b 1252 inchash.o \
252b3e8c 1253 incpath.o \
6fb5fa3c 1254 init-regs.o \
25583c4f 1255 internal-fn.o \
252b3e8c 1256 ipa-cp.o \
eefe9a99 1257 ipa-devirt.o \
aa803cc7 1258 ipa-polymorphic-call.o \
252b3e8c
MM
1259 ipa-split.o \
1260 ipa-inline.o \
a04d9035 1261 ipa-comdats.o \
7f7beb3f 1262 ipa-visibility.o \
252b3e8c
MM
1263 ipa-inline-analysis.o \
1264 ipa-inline-transform.o \
08f835dc 1265 ipa-profile.o \
252b3e8c
MM
1266 ipa-prop.o \
1267 ipa-pure-const.o \
1268 ipa-reference.o \
1269 ipa-ref.o \
1270 ipa-utils.o \
1271 ipa.o \
058e97ec
VM
1272 ira.o \
1273 ira-build.o \
1274 ira-costs.o \
1275 ira-conflicts.o \
1276 ira-color.o \
1277 ira-emit.o \
1278 ira-lives.o \
d5dc6bad 1279 jump.o \
d5dc6bad
ILT
1280 langhooks.o \
1281 lcm.o \
1282 lists.o \
d5dc6bad
ILT
1283 loop-doloop.o \
1284 loop-init.o \
1285 loop-invariant.o \
1286 loop-iv.o \
1287 loop-unroll.o \
e53a16e7 1288 lower-subreg.o \
55a2c322
VM
1289 lra.o \
1290 lra-assigns.o \
1291 lra-coalesce.o \
1292 lra-constraints.o \
1293 lra-eliminations.o \
1294 lra-lives.o \
1295 lra-spills.o \
d7f09764 1296 lto-cgraph.o \
f0efc7aa 1297 lto-streamer.o \
d7f09764
DN
1298 lto-streamer-in.o \
1299 lto-streamer-out.o \
1300 lto-section-in.o \
1301 lto-section-out.o \
d7f09764 1302 lto-opts.o \
d7f09764 1303 lto-compress.o \
52c76998 1304 mcf.o \
d5dc6bad
ILT
1305 mode-switching.o \
1306 modulo-sched.o \
3d8864c0 1307 omega.o \
d5dc6bad
ILT
1308 omp-low.o \
1309 optabs.o \
57dfdff0 1310 options-save.o \
21bf1558 1311 opts-global.o \
d5dc6bad 1312 passes.o \
68a607d8 1313 plugin.o \
d5dc6bad
ILT
1314 postreload-gcse.o \
1315 postreload.o \
1316 predict.o \
d5dc6bad
ILT
1317 print-rtl.o \
1318 print-tree.o \
1319 profile.o \
1320 real.o \
d49b6e1e 1321 realmpfr.o \
d5dc6bad
ILT
1322 recog.o \
1323 reg-stack.o \
fac41238 1324 regcprop.o \
2af2dbdc 1325 reginfo.o \
d5dc6bad 1326 regrename.o \
6fb5fa3c 1327 regstat.o \
d5dc6bad
ILT
1328 reload.o \
1329 reload1.o \
1330 reorg.o \
1331 resource.o \
1332 rtl-error.o \
d5dc6bad 1333 rtl.o \
f768061c 1334 rtlhash.o \
d5dc6bad
ILT
1335 rtlanal.o \
1336 rtlhooks.o \
1337 sbitmap.o \
1338 sched-deps.o \
1339 sched-ebb.o \
1340 sched-rgn.o \
1341 sched-vis.o \
1342 sdbout.o \
e855c69d
AB
1343 sel-sched-ir.o \
1344 sel-sched-dump.o \
1345 sel-sched.o \
204b560f 1346 sese.o \
f30e25a3 1347 shrink-wrap.o \
d5dc6bad 1348 simplify-rtx.o \
b4da855a 1349 sparseset.o \
d5dc6bad 1350 sreal.o \
6fb5fa3c 1351 stack-ptr-mod.o \
9fe0cb7d 1352 statistics.o \
d5dc6bad
ILT
1353 stmt.o \
1354 stor-layout.o \
df35c271 1355 store-motion.o \
f0efc7aa 1356 streamer-hooks.o \
d5dc6bad 1357 stringpool.o \
3bd36029 1358 target-globals.o \
d5dc6bad
ILT
1359 targhooks.o \
1360 timevar.o \
1361 toplev.o \
1362 tracer.o \
0a35513e 1363 trans-mem.o \
d5dc6bad 1364 tree-affine.o \
37d6f666 1365 asan.o \
32b4b7f5 1366 tsan.o \
de5a5fa1 1367 ubsan.o \
c2699190 1368 tree-call-cdce.o \
d5dc6bad
ILT
1369 tree-cfg.o \
1370 tree-cfgcleanup.o \
1371 tree-chrec.o \
1372 tree-complex.o \
1373 tree-data-ref.o \
1374 tree-dfa.o \
cf835838 1375 tree-diagnostic.o \
d5dc6bad
ILT
1376 tree-dump.o \
1377 tree-eh.o \
8b84c596 1378 tree-emutls.o \
d5dc6bad 1379 tree-if-conv.o \
252b3e8c 1380 tree-inline.o \
d5dc6bad
ILT
1381 tree-into-ssa.o \
1382 tree-iterator.o \
dea61d92 1383 tree-loop-distribution.o \
d5dc6bad
ILT
1384 tree-nested.o \
1385 tree-nrv.o \
1386 tree-object-size.o \
d5dc6bad 1387 tree-outof-ssa.o \
5f40b3cb 1388 tree-parloops.o \
d5dc6bad 1389 tree-phinodes.o \
bbc8a8dc 1390 tree-predcom.o \
d5dc6bad
ILT
1391 tree-pretty-print.o \
1392 tree-profile.o \
1393 tree-scalar-evolution.o \
1394 tree-sra.o \
b6e99746 1395 tree-switch-conversion.o \
d5dc6bad
ILT
1396 tree-ssa-address.o \
1397 tree-ssa-alias.o \
1398 tree-ssa-ccp.o \
1399 tree-ssa-coalesce.o \
1400 tree-ssa-copy.o \
1401 tree-ssa-copyrename.o \
1402 tree-ssa-dce.o \
1403 tree-ssa-dom.o \
1404 tree-ssa-dse.o \
1405 tree-ssa-forwprop.o \
18d08014 1406 tree-ssa-ifcombine.o \
d5dc6bad
ILT
1407 tree-ssa-live.o \
1408 tree-ssa-loop-ch.o \
1409 tree-ssa-loop-im.o \
1410 tree-ssa-loop-ivcanon.o \
1411 tree-ssa-loop-ivopts.o \
1412 tree-ssa-loop-manip.o \
1413 tree-ssa-loop-niter.o \
1414 tree-ssa-loop-prefetch.o \
1415 tree-ssa-loop-unswitch.o \
1416 tree-ssa-loop.o \
1417 tree-ssa-math-opts.o \
1418 tree-ssa-operands.o \
1419 tree-ssa-phiopt.o \
67514449 1420 tree-ssa-phiprop.o \
d5dc6bad
ILT
1421 tree-ssa-pre.o \
1422 tree-ssa-propagate.o \
1423 tree-ssa-reassoc.o \
89fb70a3 1424 tree-ssa-sccvn.o \
d5dc6bad 1425 tree-ssa-sink.o \
8b57bfeb 1426 tree-ssa-strlen.o \
d5dc6bad 1427 tree-ssa-structalias.o \
c9e93168 1428 tree-ssa-tail-merge.o \
d5dc6bad
ILT
1429 tree-ssa-ter.o \
1430 tree-ssa-threadedge.o \
1431 tree-ssa-threadupdate.o \
1432 tree-ssa-uncprop.o \
34f97b94 1433 tree-ssa-uninit.o \
d5dc6bad
ILT
1434 tree-ssa.o \
1435 tree-ssanames.o \
1436 tree-stdarg.o \
f0efc7aa
DN
1437 tree-streamer.o \
1438 tree-streamer-in.o \
1439 tree-streamer-out.o \
d5dc6bad 1440 tree-tailcall.o \
d5dc6bad
ILT
1441 tree-vect-generic.o \
1442 tree-vect-patterns.o \
252b3e8c
MM
1443 tree-vect-data-refs.o \
1444 tree-vect-stmts.o \
1445 tree-vect-loop.o \
1446 tree-vect-loop-manip.o \
1447 tree-vect-slp.o \
d5dc6bad 1448 tree-vectorizer.o \
d5dc6bad
ILT
1449 tree-vrp.o \
1450 tree.o \
08df6c0d 1451 valtrack.o \
d5dc6bad
ILT
1452 value-prof.o \
1453 var-tracking.o \
1454 varasm.o \
252b3e8c 1455 varpool.o \
d5dc6bad 1456 vmsdbgout.o \
2077db1b 1457 vtable-verify.o \
d5dc6bad 1458 web.o \
807e902e
KZ
1459 wide-int.o \
1460 wide-int-print.o \
252b3e8c
MM
1461 xcoffout.o \
1462 $(out_object_file) \
d5dc6bad 1463 $(EXTRA_OBJS) \
252b3e8c 1464 $(host_hook_obj)
d1bd0ded 1465
2691e6d7
JM
1466# Objects in libcommon.a, potentially used by all host binaries and with
1467# no target dependencies.
7ecc3eb9
DS
1468OBJS-libcommon = diagnostic.o diagnostic-color.o pretty-print.o intl.o \
1469 vec.o input.o version.o
2691e6d7 1470
1ed1641d
JM
1471# Objects in libcommon-target.a, used by drivers and by the core
1472# compiler and containing target-dependent code.
4c77620d 1473OBJS-libcommon-target = $(common_out_object_file) prefix.o params.o \
0823efed 1474 opts.o opts-common.o options.o vec.o hooks.o common/common-targhooks.o \
c2a73de2 1475 hash-table.o file-find.o
1ed1641d 1476
7a3b4887 1477# This lists all host objects for the front ends.
d4a10d0a 1478ALL_HOST_FRONTEND_OBJS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS))
7a3b4887 1479
2691e6d7 1480ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) $(OBJS-libcommon) \
d4a10d0a 1481 $(OBJS-libcommon-target) @TREEBROWSER@ main.o c-family/cppspec.o \
eab34643 1482 $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) $(GCOV_OBJS) $(GCOV_DUMP_OBJS) \
c77556a5 1483 $(GCOV_TOOL_OBJS) lto-wrapper.o collect-utils.o
6cba282a 1484
7a3b4887
SB
1485# This lists all host object files, whether they are included in this
1486# compilation or not.
1487ALL_HOST_OBJS = $(ALL_HOST_FRONTEND_OBJS) $(ALL_HOST_BACKEND_OBJS)
1488
41723253 1489BACKEND = libbackend.a main.o @TREEBROWSER@ libcommon-target.a libcommon.a \
1ed1641d 1490 $(CPPLIB) $(LIBDECNUMBER)
a36556a8 1491
7cb9fd07
EB
1492# This is defined to "yes" if Tree checking is enabled, which roughly means
1493# front-end checking.
1494TREECHECKING = @TREECHECKING@
1495
8b1f719a 1496MOSTLYCLEANFILES = insn-flags.h insn-config.h insn-codes.h \
79d8453e 1497 insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
41723253 1498 insn-attr.h insn-attr-common.h insn-attrtab.c insn-dfatab.c \
cd1440b1 1499 insn-latencytab.c insn-opinit.c insn-opinit.h insn-preds.c insn-constants.h \
d6d5951a 1500 tm-preds.h tm-constrs.h checksum-options \
1c7352cd 1501 tree-check.h min-insn-modes.c insn-modes.c insn-modes.h \
6ac9d3a3 1502 genrtl.h gt-*.h gtype-*.h gtype-desc.c gtyp-input.list \
d4a10d0a 1503 xgcc$(exeext) cpp$(exeext) \
5f73c6cc 1504 $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
b6b89215
AK
1505 $(SPECS) collect2$(exeext) gcc-ar$(exeext) gcc-nm$(exeext) \
1506 gcc-ranlib$(exeext) \
4977bab6 1507 gcov-iov$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \
c77556a5 1508 gcov-tool$(exeect) \
f142b5bc
RG
1509 gengtype$(exeext) *.[0-9][0-9].* *.[si] *-checksum.c libbackend.a \
1510 libcommon-target.a libcommon.a libgcc.mk
79d8453e 1511
544eb21e 1512#\f
013a2ee0
DE
1513# Language makefile fragments.
1514
1515# The following targets define the interface between us and the languages.
1516#
a078a589 1517# all.cross, start.encap, rest.encap,
bd97af06 1518# install-common, install-info, install-man,
436a88a6 1519# uninstall,
a03ad584 1520# mostlyclean, clean, distclean, maintainer-clean,
013a2ee0 1521#
62b81e45
MM
1522# Each language is linked in with a series of hooks. The name of each
1523# hooked is "lang.${target_name}" (eg: lang.info). Configure computes
1524# and adds these here. We use double-colon rules for some of the hooks;
1525# double-colon rules should be preferred for any new hooks.
013a2ee0 1526
2ed26f6b 1527# language hooks, generated by configure
3c18ea24 1528@language_hooks@
013a2ee0 1529
2ed26f6b
ZW
1530# per-language makefile fragments
1531ifneq ($(LANG_MAKEFRAGS),)
1532include $(LANG_MAKEFRAGS)
1533endif
013a2ee0 1534
7e63a64e
RO
1535# target and host overrides must follow the per-language makefile fragments
1536# so they can override or augment language-specific variables
1537
1538# target overrides
1539ifneq ($(tmake_file),)
1540include $(tmake_file)
1541endif
1542
1543# host overrides
1544ifneq ($(xmake_file),)
1545include $(xmake_file)
1546endif
1547
c0ed0531
ILT
1548# all-tree.def includes all the tree.def files.
1549all-tree.def: s-alltree; @true
1550s-alltree: Makefile
1551 rm -f tmp-all-tree.def
1552 echo '#include "tree.def"' > tmp-all-tree.def
1553 echo 'END_OF_BASE_TREE_CODES' >> tmp-all-tree.def
39dabefd 1554 echo '#include "c-family/c-common.def"' >> tmp-all-tree.def
c0ed0531
ILT
1555 ltf="$(lang_tree_files)"; for f in $$ltf; do \
1556 echo "#include \"$$f\""; \
1557 done | sed 's|$(srcdir)/||' >> tmp-all-tree.def
1558 $(SHELL) $(srcdir)/../move-if-change tmp-all-tree.def all-tree.def
1559 $(STAMP) s-alltree
1560
7a3b4887
SB
1561# Now that LANG_MAKEFRAGS are included, we can add special flags to the
1562# objects that belong to the front ends. We add an extra define that
1563# causes back-end specific include files to be poisoned, in the hope that
1564# we can avoid introducing dependencies of the front ends on things that
1565# no front end should ever look at (e.g. everything RTL related).
1566$(foreach file,$(ALL_HOST_FRONTEND_OBJS),$(eval CFLAGS-$(file) += -DIN_GCC_FRONTEND))
1567
544eb21e 1568#\f
79d8453e 1569
73458fb7
NN
1570# -----------------------------
1571# Rebuilding this configuration
1572# -----------------------------
1573
f637f072
RÁE
1574# On the use of stamps:
1575# Consider the example of tree-check.h. It is constructed with build/gencheck.
1576# A simple rule to build tree-check.h would be
1577# tree-check.h: build/gencheck$(build_exeext)
1578# $(RUN_GEN) build/gencheck$(build_exeext) > tree-check.h
1579#
1580# but tree-check.h doesn't change every time gencheck changes. It would the
e980df8e 1581# nice if targets that depend on tree-check.h wouldn't be rebuild
f637f072
RÁE
1582# unnecessarily when tree-check.h is unchanged. To make this, tree-check.h
1583# must not be overwritten with a identical copy. One solution is to use a
1584# temporary file
1585# tree-check.h: build/gencheck$(build_exeext)
f7ca46d6 1586# $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h
f637f072
RÁE
1587# $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h
1588#
1589# This solution has a different problem. Since the time stamp of tree-check.h
1590# is unchanged, make will try to update tree-check.h every time it runs.
1591# To prevent this, one can add a stamp
1592# tree-check.h: s-check
1593# s-check : build/gencheck$(build_exeext)
f7ca46d6 1594# $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h
f637f072
RÁE
1595# $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h
1596# $(STAMP) s-check
1597#
1598# The problem with this solution is that make thinks that tree-check.h is
1599# always unchanged. Make must be deceived into thinking that tree-check.h is
f7ca46d6 1600# rebuild by the "tree-check.h: s-check" rule. To do this, add a dummy command:
f637f072
RÁE
1601# tree-check.h: s-check; @true
1602# s-check : build/gencheck$(build_exeext)
f7ca46d6 1603# $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h
f637f072
RÁE
1604# $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h
1605# $(STAMP) s-check
1606#
1607# This is what is done in this makefile. Note that mkconfig.sh has a
1608# move-if-change built-in
1609
a1286ef5 1610Makefile: config.status $(srcdir)/Makefile.in $(LANG_MAKEFRAGS)
2ed26f6b
ZW
1611 LANGUAGES="$(CONFIG_LANGUAGES)" \
1612 CONFIG_HEADERS= \
e75f9147 1613 CONFIG_SHELL="$(SHELL)" \
2ed26f6b 1614 CONFIG_FILES=$@ $(SHELL) config.status
79d8453e 1615
11642c3a 1616config.h: cs-config.h ; @true
4977bab6 1617bconfig.h: cs-bconfig.h ; @true
11642c3a 1618tconfig.h: cs-tconfig.h ; @true
4977bab6 1619tm.h: cs-tm.h ; @true
11642c3a
ZW
1620tm_p.h: cs-tm_p.h ; @true
1621
1622cs-config.h: Makefile
4977bab6 1623 TARGET_CPU_DEFAULT="" \
e22340b0 1624 HEADERS="$(host_xm_include_list)" DEFINES="$(host_xm_defines)" \
11642c3a
ZW
1625 $(SHELL) $(srcdir)/mkconfig.sh config.h
1626
4977bab6
ZW
1627cs-bconfig.h: Makefile
1628 TARGET_CPU_DEFAULT="" \
e22340b0 1629 HEADERS="$(build_xm_include_list)" DEFINES="$(build_xm_defines)" \
4977bab6 1630 $(SHELL) $(srcdir)/mkconfig.sh bconfig.h
11642c3a 1631
0d24f4d1 1632cs-tconfig.h: Makefile
3d9d2476 1633 TARGET_CPU_DEFAULT="" \
232b67d9 1634 HEADERS="$(xm_include_list)" DEFINES="USED_FOR_TARGET $(xm_defines)" \
11642c3a
ZW
1635 $(SHELL) $(srcdir)/mkconfig.sh tconfig.h
1636
4977bab6
ZW
1637cs-tm.h: Makefile
1638 TARGET_CPU_DEFAULT="$(target_cpu_default)" \
e22340b0 1639 HEADERS="$(tm_include_list)" DEFINES="$(tm_defines)" \
4977bab6
ZW
1640 $(SHELL) $(srcdir)/mkconfig.sh tm.h
1641
11642c3a 1642cs-tm_p.h: Makefile
4977bab6 1643 TARGET_CPU_DEFAULT="" \
e22340b0 1644 HEADERS="$(tm_p_include_list)" DEFINES="" \
11642c3a
ZW
1645 $(SHELL) $(srcdir)/mkconfig.sh tm_p.h
1646
a6a5e4c9 1647# Don't automatically run autoconf, since configure.ac might be accidentally
e7f62dcf
NC
1648# newer than configure. Also, this writes into the source directory which
1649# might be on a read-only file system. If configured for maintainer mode
1650# then do allow autoconf to be run.
1651
6efbd53f
RW
1652AUTOCONF = autoconf
1653ACLOCAL = aclocal
1654ACLOCAL_AMFLAGS = -I ../config -I ..
1655aclocal_deps = \
1656 $(srcdir)/../libtool.m4 \
1657 $(srcdir)/../ltoptions.m4 \
1658 $(srcdir)/../ltsugar.m4 \
1659 $(srcdir)/../ltversion.m4 \
1660 $(srcdir)/../lt~obsolete.m4 \
1661 $(srcdir)/../config/acx.m4 \
1662 $(srcdir)/../config/codeset.m4 \
1663 $(srcdir)/../config/extensions.m4 \
1664 $(srcdir)/../config/gettext-sister.m4 \
1665 $(srcdir)/../config/iconv.m4 \
1666 $(srcdir)/../config/lcmessage.m4 \
1667 $(srcdir)/../config/lib-ld.m4 \
1668 $(srcdir)/../config/lib-link.m4 \
1669 $(srcdir)/../config/lib-prefix.m4 \
1670 $(srcdir)/../config/override.m4 \
1671 $(srcdir)/../config/progtest.m4 \
7c2a2dbf 1672 $(srcdir)/../config/stdint.m4 \
6efbd53f
RW
1673 $(srcdir)/../config/unwind_ipinfo.m4 \
1674 $(srcdir)/../config/warnings.m4 \
3c39bca6 1675 $(srcdir)/../config/dfp.m4 \
2f6935f4 1676 $(srcdir)/../config/mmap.m4 \
6efbd53f
RW
1677 $(srcdir)/acinclude.m4
1678
1679$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/aclocal.m4
1680 (cd $(srcdir) && $(AUTOCONF))
1681
1682$(srcdir)/aclocal.m4 : @MAINT@ $(aclocal_deps)
1683 (cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS))
3c18ea24 1684
da7ece9a 1685# cstamp-h.in controls rebuilding of config.in.
7c0ae5f1
DE
1686# It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't
1687# delete it. A stamp file is needed as autoheader won't update the file if
1688# nothing has changed.
da7ece9a
DE
1689# It remains in the source directory and is part of the distribution.
1690# This follows what is done in shellutils, fileutils, etc.
5408f8d0
DE
1691# "echo timestamp" is used instead of touch to be consistent with other
1692# packages that use autoconf (??? perhaps also to avoid problems with patch?).
da7ece9a 1693# ??? Newer versions have a maintainer mode that may be useful here.
e7f62dcf
NC
1694
1695# Don't run autoheader automatically either.
1696# Only run it if maintainer mode is enabled.
6efbd53f 1697@MAINT@ AUTOHEADER = autoheader
e7f62dcf 1698@MAINT@ $(srcdir)/config.in: $(srcdir)/cstamp-h.in
a6a5e4c9 1699@MAINT@ $(srcdir)/cstamp-h.in: $(srcdir)/configure.ac
6efbd53f 1700@MAINT@ (cd $(srcdir) && $(AUTOHEADER))
e7f62dcf
NC
1701@MAINT@ @rm -f $(srcdir)/cstamp-h.in
1702@MAINT@ echo timestamp > $(srcdir)/cstamp-h.in
b7cb92ad 1703auto-host.h: cstamp-h ; @true
da7ece9a 1704cstamp-h: config.in config.status
2ed26f6b
ZW
1705 CONFIG_HEADERS=auto-host.h:config.in \
1706 CONFIG_FILES= \
1707 LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status
d68b51ef 1708
7c0ae5f1
DE
1709# Really, really stupid make features, such as SUN's KEEP_STATE, may force
1710# a target to build even if it is up-to-date. So we must verify that
1711# config.status does not exist before failing.
a1286ef5 1712config.status: $(srcdir)/configure $(srcdir)/config.gcc
7c0ae5f1 1713 @if [ ! -f config.status ] ; then \
436a88a6 1714 echo You must configure gcc. Look at http://gcc.gnu.org/install/ for details.; \
7c0ae5f1
DE
1715 false; \
1716 else \
71205e0b 1717 LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status --recheck; \
7c0ae5f1
DE
1718 fi
1719
73458fb7
NN
1720# --------
1721# UNSORTED
1722# --------
1723
3bbd5a19
PB
1724# Provide quickstrap as a target that people can type into the gcc directory,
1725# and that fails if you're not into it.
1726quickstrap: all
1727 cd $(toplevel_builddir) && $(MAKE) all-target-libgcc
1728
43297964 1729all.internal: start.encap rest.encap doc
79d8453e 1730# This is what to compile if making a cross-compiler.
b3b2cbc4 1731all.cross: native gcc-cross$(exeext) cpp$(exeext) specs \
fa958513 1732 libgcc-support lang.all.cross doc @GENINSRC@ srcextra
79d8453e 1733# This is what must be made before installing GCC and converting libraries.
4871239e 1734start.encap: native xgcc$(exeext) cpp$(exeext) specs \
14da6073 1735 libgcc-support lang.start.encap @GENINSRC@ srcextra
eea77e5f 1736# These can't be made until after GCC can run.
52c0e446 1737rest.encap: lang.rest.encap
79d8453e
RS
1738# This is what is made with the host's compiler
1739# whether making a cross compiler or not.
6eb95e99 1740native: config.status auto-host.h build-@POSUB@ $(LANGUAGES) \
d82c57a8 1741 $(EXTRA_PROGRAMS) $(COLLECT2) lto-wrapper$(exeext) \
b6b89215 1742 gcc-ar$(exeext) gcc-nm$(exeext) gcc-ranlib$(exeext)
79d8453e 1743
f142b5bc
RG
1744ifeq ($(enable_plugin),yes)
1745native: gengtype$(exeext)
1746endif
1747
3aa072f2
RS
1748# On the target machine, finish building a cross compiler.
1749# This does the things that can't be done on the host machine.
fa958513 1750rest.cross: specs
3aa072f2 1751
3aa072f2
RS
1752# Recompile all the language-independent object files.
1753# This is used only if the user explicitly asks for it.
a36556a8 1754compilations: $(BACKEND)
79d8453e 1755
4f4e53dd 1756# This archive is strictly for the host.
de6ba7ae 1757libbackend.a: $(OBJS)
a36556a8 1758 -rm -rf libbackend.a
de6ba7ae 1759 $(AR) $(AR_FLAGS) libbackend.a $(OBJS)
343a6100 1760 -$(RANLIB) $(RANLIB_FLAGS) libbackend.a
6c1cc7fa 1761
1ed1641d
JM
1762libcommon-target.a: $(OBJS-libcommon-target)
1763 -rm -rf libcommon-target.a
1764 $(AR) $(AR_FLAGS) libcommon-target.a $(OBJS-libcommon-target)
1765 -$(RANLIB) $(RANLIB_FLAGS) libcommon-target.a
1766
2691e6d7
JM
1767libcommon.a: $(OBJS-libcommon)
1768 -rm -rf libcommon.a
1769 $(AR) $(AR_FLAGS) libcommon.a $(OBJS-libcommon)
1770 -$(RANLIB) $(RANLIB_FLAGS) libcommon.a
1771
acbbf3d9
RS
1772# We call this executable `xgcc' rather than `gcc'
1773# to avoid confusion if the current directory is in the path
1774# and CC is `gcc'. It is renamed to `gcc' when it is installed.
d4a10d0a 1775xgcc$(exeext): $(GCC_OBJS) c/gccspec.o libcommon-target.a $(LIBDEPS) \
1ed1641d 1776 $(EXTRA_GCC_OBJS)
a90163e9 1777 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
d4a10d0a 1778 c/gccspec.o $(EXTRA_GCC_OBJS) libcommon-target.a \
e3b3fa45 1779 $(EXTRA_GCC_LIBS) $(LIBS)
3aa072f2 1780
d4a10d0a
SB
1781# cpp is to cpp0 as e.g. g++ is to cc1plus: Just another driver.
1782# It is part of c-family because the handled extensions are hard-coded
1783# and only contain c-family extensions (see known_suffixes).
1784cpp$(exeext): $(GCC_OBJS) c-family/cppspec.o libcommon-target.a $(LIBDEPS) \
1ed1641d 1785 $(EXTRA_GCC_OBJS)
a90163e9 1786 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
d4a10d0a 1787 c-family/cppspec.o $(EXTRA_GCC_OBJS) libcommon-target.a \
e3b3fa45 1788 $(EXTRA_GCC_LIBS) $(LIBS)
922cf99e 1789
3aa072f2 1790# Dump a specs file to make -B./ read these specs over installed ones.
3bd6d4c4 1791$(SPECS): xgcc$(exeext)
d521a023 1792 $(GCC_FOR_TARGET) -dumpspecs > tmp-specs
3bd6d4c4 1793 mv tmp-specs $(SPECS)
79d8453e 1794
acbbf3d9 1795# We do want to create an executable named `xgcc', so we can use it to
79d8453e
RS
1796# compile libgcc2.a.
1797# Also create gcc-cross, so that install-common will install properly.
b3b2cbc4 1798gcc-cross$(exeext): xgcc$(exeext)
aab26e16 1799 cp xgcc$(exeext) gcc-cross$(exeext)
79d8453e 1800
d6d5951a
AK
1801checksum-options:
1802 echo "$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS)" > checksum-options.tmp \
1803 && $(srcdir)/../move-if-change checksum-options.tmp checksum-options
e980df8e 1804
544eb21e 1805#\f
79d8453e 1806# Build libgcc.a.
a2ab7f2b 1807
52c0e446 1808libgcc-support: libgcc.mvars stmp-int-hdrs $(TCONFIG_H) \
f9989b51 1809 $(MACHMODE_H) gcov-iov.h
fa958513 1810
f9989b51 1811libgcc.mvars: config.status Makefile specs xgcc$(exeext)
fa958513 1812 : > tmp-libgcc.mvars
5f73c6cc
RO
1813 echo GCC_CFLAGS = '$(GCC_CFLAGS)' >> tmp-libgcc.mvars
1814 echo INHIBIT_LIBC_CFLAGS = '$(INHIBIT_LIBC_CFLAGS)' >> tmp-libgcc.mvars
7f142d33 1815 echo TARGET_SYSTEM_ROOT = '$(TARGET_SYSTEM_ROOT)' >> tmp-libgcc.mvars
fa958513
DJ
1816
1817 mv tmp-libgcc.mvars libgcc.mvars
79d8453e 1818
f6cdc7ea
DE
1819# Use the genmultilib shell script to generate the information the gcc
1820# driver program needs to select the library directory based on the
1821# switches.
e5e809f4
JL
1822multilib.h: s-mlib; @true
1823s-mlib: $(srcdir)/genmultilib Makefile
c49d2df6
JJ
1824 if test @enable_multilib@ = yes \
1825 || test -n "$(MULTILIB_OSDIRNAMES)"; then \
4d2fb38b
JJ
1826 $(SHELL) $(srcdir)/genmultilib \
1827 "$(MULTILIB_OPTIONS)" \
1828 "$(MULTILIB_DIRNAMES)" \
1829 "$(MULTILIB_MATCHES)" \
1830 "$(MULTILIB_EXCEPTIONS)" \
1831 "$(MULTILIB_EXTRA_OPTS)" \
1832 "$(MULTILIB_EXCLUSIONS)" \
5bbcd587 1833 "$(MULTILIB_OSDIRNAMES)" \
43661dc4 1834 "$(MULTILIB_REQUIRED)" \
4973b0f9 1835 "$(if $(MULTILIB_OSDIRNAMES),,$(MULTIARCH_DIRNAME))" \
e7f49d92 1836 "$(MULTILIB_REUSE)" \
c49d2df6 1837 "@enable_multilib@" \
4d2fb38b
JJ
1838 > tmp-mlib.h; \
1839 else \
e7f49d92
TG
1840 $(SHELL) $(srcdir)/genmultilib '' '' '' '' '' '' '' '' \
1841 "$(MULTIARCH_DIRNAME)" '' no \
c49d2df6 1842 > tmp-mlib.h; \
4d2fb38b 1843 fi
88e3a2a3 1844 $(SHELL) $(srcdir)/../move-if-change tmp-mlib.h multilib.h
d9835ae8 1845 $(STAMP) s-mlib
544eb21e 1846#\f
79d8453e
RS
1847# Compiling object files from source files.
1848
e980df8e
TT
1849# Note that dependencies on obstack.h are not written
1850# because that file is not part of GCC.
1851
02ba6b22
KC
1852srcextra: gcc.srcextra lang.srcextra
1853
01d419ae 1854gcc.srcextra: gengtype-lex.c
03787dfd
KC
1855 -cp -p $^ $(srcdir)
1856
c2a73de2 1857AR_OBJS = file-find.o
b6b89215
AK
1858AR_LIBS = @COLLECT2_LIBS@
1859
c2a73de2 1860gcc-ar$(exeext): gcc-ar.o $(AR_OBJS) $(LIBDEPS)
b6b89215 1861 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) gcc-ar.o -o $@ \
c2a73de2 1862 $(AR_OBJS) $(LIBS) $(AR_LIBS)
b6b89215 1863
c2a73de2 1864gcc-nm$(exeext): gcc-nm.o $(AR_OBJS) $(LIBDEPS)
b6b89215 1865 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) gcc-nm.o -o $@ \
c2a73de2 1866 $(AR_OBJS) $(LIBS) $(AR_LIBS)
b6b89215 1867
c2a73de2 1868gcc-ranlib$(exeext): gcc-ranlib.o $(AR_OBJS) $(LIBDEPS)
b6b89215 1869 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) gcc-ranlib.o -o $@ \
c2a73de2 1870 $(AR_OBJS) $(LIBS) $(AR_LIBS)
b6b89215
AK
1871
1872CFLAGS-gcc-ar.o += $(DRIVER_DEFINES) \
1873 -DTARGET_MACHINE=\"$(target_noncanonical)\" \
1874 @TARGET_SYSTEM_ROOT_DEFINE@ -DPERSONALITY=\"ar\"
1875
b6b89215
AK
1876CFLAGS-gcc-ranlib.o += $(DRIVER_DEFINES) \
1877 -DTARGET_MACHINE=\"$(target_noncanonical)\" \
1878 @TARGET_SYSTEM_ROOT_DEFINE@ -DPERSONALITY=\"ranlib\"
1879
b6b89215
AK
1880CFLAGS-gcc-nm.o += $(DRIVER_DEFINES) \
1881 -DTARGET_MACHINE=\"$(target_noncanonical)\" \
1882 @TARGET_SYSTEM_ROOT_DEFINE@ -DPERSONALITY=\"nm\"
1883
b6b89215
AK
1884# ??? the implicit rules dont trigger if the source file has a different name
1885# so copy instead
1886gcc-ranlib.c: gcc-ar.c
1887 cp $^ $@
1888
1889gcc-nm.c: gcc-ar.c
1890 cp $^ $@
1891
5f0ad6a5
BS
1892COLLECT2_OBJS = collect2.o collect2-aix.o tlink.o vec.o ggc-none.o \
1893 collect-utils.o file-find.o
4e70264f 1894COLLECT2_LIBS = @COLLECT2_LIBS@
a2d25763 1895collect2$(exeext): $(COLLECT2_OBJS) $(LIBDEPS)
057f494b 1896# Don't try modifying collect2 (aka ld) in place--it might be linking this.
a90163e9 1897 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o T$@ \
4e70264f 1898 $(COLLECT2_OBJS) $(LIBS) $(COLLECT2_LIBS)
ff0a63e8 1899 mv -f T$@ $@
79d8453e 1900
c5bc3df6
JM
1901CFLAGS-collect2.o += -DTARGET_MACHINE=\"$(target_noncanonical)\" \
1902 @TARGET_SYSTEM_ROOT_DEFINE@
e980df8e 1903
a185856a
BS
1904LTO_WRAPPER_OBJS = lto-wrapper.o collect-utils.o ggc-none.o
1905lto-wrapper$(exeext): $(LTO_WRAPPER_OBJS) libcommon-target.a $(LIBDEPS)
f31c0018 1906 +$(LINKER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o T$@ \
a185856a 1907 $(LTO_WRAPPER_OBJS) libcommon-target.a $(LIBS)
d7f09764
DN
1908 mv -f T$@ $@
1909
d4a10d0a 1910# Files used by all variants of C or by the stand-alone pre-processor.
39dabefd 1911
c5bc3df6 1912CFLAGS-c-family/c-opts.o += @TARGET_SYSTEM_ROOT_DEFINE@
e980df8e 1913
c5bc3df6
JM
1914CFLAGS-c-family/c-pch.o += -DHOST_MACHINE=\"$(host)\" \
1915 -DTARGET_MACHINE=\"$(target)\"
8c796d19 1916
b6541edc
TT
1917default-c.o: config/default-c.c
1918 $(COMPILE) $<
1919 $(POSTCOMPILE)
e980df8e 1920
39dabefd
SB
1921# Files used by all variants of C and some other languages.
1922
c5bc3df6 1923CFLAGS-prefix.o += -DPREFIX=\"$(prefix)\" -DBASEVER=$(BASEVER_s)
2754b38f 1924prefix.o: $(BASEVER)
79d8453e 1925
e980df8e 1926# Language-independent files.
2fe3178b 1927
610c62ac 1928DRIVER_DEFINES = \
0deb20df 1929 -DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \
a8ee6e2d
GK
1930 -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
1931 -DSTANDARD_LIBEXEC_PREFIX=\"$(libexecdir)/gcc/\" \
964ceda1 1932 -DDEFAULT_TARGET_VERSION=\"$(version)\" \
caa55b1e 1933 -DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\" \
0deb20df 1934 -DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \
15c723f3 1935 -DTOOLDIR_BASE_PREFIX=\"$(libsubdir_to_prefix)$(prefix_to_exec_prefix)\" \
4977bab6 1936 @TARGET_SYSTEM_ROOT_DEFINE@ \
414d23ae 1937 $(VALGRIND_DRIVER_DEFINES) \
56e82b14 1938 $(if $(SHLIB),$(if $(filter yes,@enable_shared@),-DENABLE_SHARED_LIBGCC)) \
e11ddaf5 1939 -DCONFIGURE_SPECS="\"@CONFIGURE_SPECS@\""
e980df8e 1940
b6541edc 1941CFLAGS-gcc.o += $(DRIVER_DEFINES)
e980df8e 1942
0d24f4d1
ZW
1943specs.h : s-specs ; @true
1944s-specs : Makefile
766c7ad1
ZW
1945 lsf="$(lang_specs_files)"; for f in $$lsf; do \
1946 echo "#include \"$$f\""; \
0d24f4d1 1947 done | sed 's|$(srcdir)/||' > tmp-specs.h
88e3a2a3 1948 $(SHELL) $(srcdir)/../move-if-change tmp-specs.h specs.h
0d24f4d1
ZW
1949 $(STAMP) s-specs
1950
776dc15d 1951optionlist: s-options ; @true
75685792
RS
1952s-options: $(ALL_OPT_FILES) Makefile $(srcdir)/opt-gather.awk
1953 $(AWK) -f $(srcdir)/opt-gather.awk $(ALL_OPT_FILES) > tmp-optionlist
776dc15d 1954 $(SHELL) $(srcdir)/../move-if-change tmp-optionlist optionlist
469ef4a3
ILT
1955 $(STAMP) s-options
1956
86fa5de4
JM
1957options.c: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opt-read.awk \
1958 $(srcdir)/optc-gen.awk
1959 $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/opt-read.awk \
1960 -f $(srcdir)/optc-gen.awk \
6be4d3ac 1961 -v header_name="config.h system.h coretypes.h options.h tm.h" < $< > $@
776dc15d 1962
57dfdff0
JM
1963options-save.c: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opt-read.awk \
1964 $(srcdir)/optc-save-gen.awk
1965 $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/opt-read.awk \
1966 -f $(srcdir)/optc-save-gen.awk \
1967 -v header_name="config.h system.h coretypes.h tm.h" < $< > $@
1968
75685792 1969options.h: s-options-h ; @true
86fa5de4
JM
1970s-options-h: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opt-read.awk \
1971 $(srcdir)/opth-gen.awk
1972 $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/opt-read.awk \
1973 -f $(srcdir)/opth-gen.awk \
75685792
RS
1974 < $< > tmp-options.h
1975 $(SHELL) $(srcdir)/../move-if-change tmp-options.h options.h
1976 $(STAMP) $@
776dc15d 1977
79d8453e
RS
1978dumpvers: dumpvers.c
1979
c5bc3df6 1980CFLAGS-version.o += -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
e980df8e
TT
1981 -DREVISION=$(REVISION_s) \
1982 -DDEVPHASE=$(DEVPHASE_s) -DPKGVERSION=$(PKGVERSION_s) \
c5bc3df6 1983 -DBUGURL=$(BUGURL_s)
609458ae 1984version.o: $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE)
e980df8e 1985
d7f09764 1986# lto-compress.o needs $(ZLIBINC) added to the include flags.
c5bc3df6 1987CFLAGS-lto-compress.o += $(ZLIBINC)
e980df8e 1988
134ef638
BE
1989bversion.h: s-bversion; @true
1990s-bversion: BASE-VER
1991 echo "#define BUILDING_GCC_MAJOR `echo $(BASEVER_c) | sed -e 's/^\([0-9]*\).*$$/\1/'`" > bversion.h
1992 echo "#define BUILDING_GCC_MINOR `echo $(BASEVER_c) | sed -e 's/^[0-9]*\.\([0-9]*\).*$$/\1/'`" >> bversion.h
1993 echo "#define BUILDING_GCC_PATCHLEVEL `echo $(BASEVER_c) | sed -e 's/^[0-9]*\.[0-9]*\.\([0-9]*\)$$/\1/'`" >> bversion.h
1994 echo "#define BUILDING_GCC_VERSION (BUILDING_GCC_MAJOR * 1000 + BUILDING_GCC_MINOR)" >> bversion.h
1995 $(STAMP) s-bversion
1996
c5bc3df6 1997CFLAGS-toplev.o += -DTARGET_NAME=\"$(target_noncanonical)\"
c59ffc41 1998
a167b052
DM
1999pass-instances.def: $(srcdir)/passes.def $(srcdir)/gen-pass-instances.awk
2000 $(AWK) -f $(srcdir)/gen-pass-instances.awk \
2001 $(srcdir)/passes.def > pass-instances.def
2002
aefc31a1
TT
2003$(out_object_file): $(out_file)
2004 $(COMPILE) $<
2005 $(POSTCOMPILE)
e980df8e 2006
b6541edc
TT
2007$(common_out_object_file): $(common_out_file)
2008 $(COMPILE) $<
2009 $(POSTCOMPILE)
544eb21e 2010#\f
4c457b6b 2011# Generate header and source files from the machine description,
79d8453e
RS
2012# and compile them.
2013
1b0c37d7 2014.PRECIOUS: insn-config.h insn-flags.h insn-codes.h insn-constants.h \
79d8453e 2015 insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \
41723253
SB
2016 insn-attr.h insn-attr-common.h insn-attrtab.c insn-dfatab.c \
2017 insn-latencytab.c insn-preds.c
79d8453e 2018
26be549a
RH
2019# Dependencies for the md file. The first time through, we just assume
2020# the md file itself and the generated dependency file (in order to get
2021# it built). The second time through we have the dependency file.
2022-include mddeps.mk
2023MD_DEPS = s-mddeps $(md_file) $(MD_INCLUDES)
2024
2025s-mddeps: $(md_file) $(MD_INCLUDES) build/genmddeps$(build_exeext)
2026 $(RUN_GEN) build/genmddeps$(build_exeext) $(md_file) > tmp-mddeps
2027 $(SHELL) $(srcdir)/../move-if-change tmp-mddeps mddeps.mk
2028 $(STAMP) s-mddeps
2029
cbbbdc2c 2030# For each of the files generated by running a generator program over
9b68b6ea
RS
2031# the machine description, the following static pattern rules run the
2032# generator program only if the machine description has changed,
2033# but touch the target file only when its contents actually change.
2034# The "; @true" construct forces Make to recheck the timestamp on
2035# the target file.
cbbbdc2c 2036
88a00ef7
JM
2037simple_rtl_generated_h = insn-attr.h insn-attr-common.h insn-codes.h \
2038 insn-config.h insn-flags.h
cbbbdc2c 2039
41723253 2040simple_rtl_generated_c = insn-automata.c insn-emit.c \
cd1440b1 2041 insn-extract.c insn-output.c \
9b68b6ea
RS
2042 insn-peep.c insn-recog.c
2043
2044simple_generated_h = $(simple_rtl_generated_h) insn-constants.h
2045
0fe60a1b 2046simple_generated_c = $(simple_rtl_generated_c) insn-enums.c
9b68b6ea
RS
2047
2048$(simple_generated_h:insn-%.h=s-%) \
2049$(simple_generated_c:insn-%.c=s-%): s-%: $(MD_DEPS)
2050
2051$(simple_rtl_generated_h:insn-%.h=s-%) \
2052$(simple_rtl_generated_c:insn-%.c=s-%): s-%: insn-conditions.md
cbbbdc2c
ZW
2053
2054$(simple_generated_h): insn-%.h: s-%; @true
2055
9b68b6ea 2056$(simple_generated_h:insn-%.h=s-%): s-%: build/gen%$(build_exeext)
1c7352cd 2057 $(RUN_GEN) build/gen$*$(build_exeext) $(md_file) \
9b68b6ea 2058 $(filter insn-conditions.md,$^) > tmp-$*.h
cbbbdc2c
ZW
2059 $(SHELL) $(srcdir)/../move-if-change tmp-$*.h insn-$*.h
2060 $(STAMP) s-$*
2061
2062$(simple_generated_c): insn-%.c: s-%; @true
9b68b6ea 2063$(simple_generated_c:insn-%.c=s-%): s-%: build/gen%$(build_exeext)
1c7352cd 2064 $(RUN_GEN) build/gen$*$(build_exeext) $(md_file) \
9b68b6ea 2065 $(filter insn-conditions.md,$^) > tmp-$*.c
cbbbdc2c
ZW
2066 $(SHELL) $(srcdir)/../move-if-change tmp-$*.c insn-$*.c
2067 $(STAMP) s-$*
2068
2069# gencheck doesn't read the machine description, and the file produced
2070# doesn't use the insn-* convention.
2071tree-check.h: s-check ; @true
2072s-check : build/gencheck$(build_exeext)
2073 $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h
2074 $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h
2075 $(STAMP) s-check
2199e5fa 2076
41723253
SB
2077# genattrtab produces three files: tmp-{attrtab.c,dfatab.c,latencytab.c}
2078insn-attrtab.c insn-dfatab.c insn-latencytab.c: s-attrtab ; @true
2079s-attrtab : $(MD_DEPS) build/genattrtab$(build_exeext) \
2080 insn-conditions.md
2081 $(RUN_GEN) build/genattrtab$(build_exeext) $(md_file) insn-conditions.md \
2082 -Atmp-attrtab.c -Dtmp-dfatab.c -Ltmp-latencytab.c
2083 $(SHELL) $(srcdir)/../move-if-change tmp-attrtab.c insn-attrtab.c
2084 $(SHELL) $(srcdir)/../move-if-change tmp-dfatab.c insn-dfatab.c
2085 $(SHELL) $(srcdir)/../move-if-change tmp-latencytab.c insn-latencytab.c
2086 $(STAMP) s-attrtab
2087
cd1440b1
RH
2088# genopinit produces two files.
2089insn-opinit.c insn-opinit.h: s-opinit ; @true
2090s-opinit: $(MD_DEPS) build/genopinit$(build_exeext) insn-conditions.md
2091 $(RUN_GEN) build/genopinit$(build_exeext) $(md_file) \
2092 insn-conditions.md -htmp-opinit.h -ctmp-opinit.c
2093 $(SHELL) $(srcdir)/../move-if-change tmp-opinit.h insn-opinit.h
2094 $(SHELL) $(srcdir)/../move-if-change tmp-opinit.c insn-opinit.c
2095 $(STAMP) s-opinit
2096
1c7352cd 2097# gencondmd doesn't use the standard naming convention.
e980df8e 2098build/gencondmd.c: s-conditions; @true
1c7352cd
ZW
2099s-conditions: $(MD_DEPS) build/genconditions$(build_exeext)
2100 $(RUN_GEN) build/genconditions$(build_exeext) $(md_file) > tmp-condmd.c
e980df8e 2101 $(SHELL) $(srcdir)/../move-if-change tmp-condmd.c build/gencondmd.c
1c7352cd
ZW
2102 $(STAMP) s-conditions
2103
2104insn-conditions.md: s-condmd; @true
2105s-condmd: build/gencondmd$(build_exeext)
2106 $(RUN_GEN) build/gencondmd$(build_exeext) > tmp-cond.md
2107 $(SHELL) $(srcdir)/../move-if-change tmp-cond.md insn-conditions.md
2108 $(STAMP) s-condmd
2109
2110
cbbbdc2c
ZW
2111# These files are generated by running the same generator more than
2112# once with different options, so they have custom rules. The
2113# stampfile idiom is the same.
cbbbdc2c 2114genrtl.h: s-genrtl-h; @true
2199e5fa 2115
cbbbdc2c 2116s-genrtl-h: build/gengenrtl$(build_exeext)
6ac9d3a3 2117 $(RUN_GEN) build/gengenrtl$(build_exeext) > tmp-genrtl.h
cbbbdc2c
ZW
2118 $(SHELL) $(srcdir)/../move-if-change tmp-genrtl.h genrtl.h
2119 $(STAMP) s-genrtl-h
2120
2121insn-modes.c: s-modes; @true
2122insn-modes.h: s-modes-h; @true
2123min-insn-modes.c: s-modes-m; @true
0974c7d7 2124
3b620440 2125s-modes: build/genmodes$(build_exeext)
cbbbdc2c
ZW
2126 $(RUN_GEN) build/genmodes$(build_exeext) > tmp-modes.c
2127 $(SHELL) $(srcdir)/../move-if-change tmp-modes.c insn-modes.c
2128 $(STAMP) s-modes
2129
2130s-modes-h: build/genmodes$(build_exeext)
3b620440 2131 $(RUN_GEN) build/genmodes$(build_exeext) -h > tmp-modes.h
88e3a2a3 2132 $(SHELL) $(srcdir)/../move-if-change tmp-modes.h insn-modes.h
cbbbdc2c
ZW
2133 $(STAMP) s-modes-h
2134
2135s-modes-m: build/genmodes$(build_exeext)
3b620440 2136 $(RUN_GEN) build/genmodes$(build_exeext) -m > tmp-min-modes.c
88e3a2a3 2137 $(SHELL) $(srcdir)/../move-if-change tmp-min-modes.c min-insn-modes.c
cbbbdc2c 2138 $(STAMP) s-modes-m
0974c7d7 2139
cbbbdc2c
ZW
2140insn-preds.c: s-preds; @true
2141tm-preds.h: s-preds-h; @true
279bb624 2142tm-constrs.h: s-constrs-h; @true
1b0c37d7 2143
4a0639a2
MZ
2144.PHONY: mddump
2145mddump: $(BUILD_RTL) $(MD_DEPS) build/genmddump$(build_exeext)
2146 $(RUN_GEN) build/genmddump$(build_exeext) $(md_file) > tmp-mddump.md
2147
26be549a 2148s-preds: $(MD_DEPS) build/genpreds$(build_exeext)
3b620440 2149 $(RUN_GEN) build/genpreds$(build_exeext) $(md_file) > tmp-preds.c
e543e219 2150 $(SHELL) $(srcdir)/../move-if-change tmp-preds.c insn-preds.c
1b0c37d7
ZW
2151 $(STAMP) s-preds
2152
cbbbdc2c
ZW
2153s-preds-h: $(MD_DEPS) build/genpreds$(build_exeext)
2154 $(RUN_GEN) build/genpreds$(build_exeext) -h $(md_file) > tmp-preds.h
2155 $(SHELL) $(srcdir)/../move-if-change tmp-preds.h tm-preds.h
2156 $(STAMP) s-preds-h
e543e219 2157
279bb624
DE
2158s-constrs-h: $(MD_DEPS) build/genpreds$(build_exeext)
2159 $(RUN_GEN) build/genpreds$(build_exeext) -c $(md_file) > tmp-constrs.h
2160 $(SHELL) $(srcdir)/../move-if-change tmp-constrs.h tm-constrs.h
2161 $(STAMP) s-constrs-h
2162
38f8b050 2163target-hooks-def.h: s-target-hooks-def-h; @true
c18a9bc4
JR
2164# make sure that when we build info files, the used tm.texi is up to date.
2165$(srcdir)/doc/tm.texi: s-tm-texi; @true
38f8b050
JR
2166
2167s-target-hooks-def-h: build/genhooks$(build_exeext)
acce4e77
JM
2168 $(RUN_GEN) build/genhooks$(build_exeext) "Target Hook" \
2169 > tmp-target-hooks-def.h
38f8b050
JR
2170 $(SHELL) $(srcdir)/../move-if-change tmp-target-hooks-def.h \
2171 target-hooks-def.h
2172 $(STAMP) s-target-hooks-def-h
2173
acce4e77
JM
2174c-family/c-target-hooks-def.h: s-c-target-hooks-def-h; @true
2175
2176s-c-target-hooks-def-h: build/genhooks$(build_exeext)
2177 $(RUN_GEN) build/genhooks$(build_exeext) "C Target Hook" \
2178 > tmp-c-target-hooks-def.h
2179 $(SHELL) $(srcdir)/../move-if-change tmp-c-target-hooks-def.h \
2180 c-family/c-target-hooks-def.h
2181 $(STAMP) s-c-target-hooks-def-h
2182
c49a6962
JM
2183common/common-target-hooks-def.h: s-common-target-hooks-def-h; @true
2184
2185s-common-target-hooks-def-h: build/genhooks$(build_exeext)
2186 $(RUN_GEN) build/genhooks$(build_exeext) "Common Target Hook" \
2187 > tmp-common-target-hooks-def.h
2188 $(SHELL) $(srcdir)/../move-if-change tmp-common-target-hooks-def.h \
2189 common/common-target-hooks-def.h
2190 $(STAMP) s-common-target-hooks-def-h
2191
38f8b050 2192# check if someone mistakenly only changed tm.texi.
c18a9bc4
JR
2193# We use a different pathname here to avoid a circular dependency.
2194s-tm-texi: $(srcdir)/doc/../doc/tm.texi
e82a40fc 2195
459d4972
JR
2196# The tm.texi we want to compare against / check into svn should have
2197# unix-style line endings. To make this work on MinGW, remove \r.
2198# \r is not portable to Solaris tr, therefore we have a special
2199# case for ASCII. We use \r for other encodings like EBCDIC.
38f8b050 2200s-tm-texi: build/genhooks$(build_exeext) $(srcdir)/doc/tm.texi.in
acce4e77 2201 $(RUN_GEN) build/genhooks$(build_exeext) -d \
38f8b050 2202 $(srcdir)/doc/tm.texi.in > tmp-tm.texi
459d4972
JR
2203 case `echo X|tr X '\101'` in \
2204 A) tr -d '\015' < tmp-tm.texi > tmp2-tm.texi ;; \
93b39277 2205 *) tr -d '\r' < tmp-tm.texi > tmp2-tm.texi ;; \
459d4972
JR
2206 esac
2207 mv tmp2-tm.texi tmp-tm.texi
38f8b050
JR
2208 $(SHELL) $(srcdir)/../move-if-change tmp-tm.texi tm.texi
2209 @if cmp -s $(srcdir)/doc/tm.texi tm.texi; then \
2210 $(STAMP) $@; \
2211 elif test $(srcdir)/doc/tm.texi -nt $(srcdir)/doc/tm.texi.in \
acce4e77
JM
2212 && ( test $(srcdir)/doc/tm.texi -nt $(srcdir)/target.def \
2213 || test $(srcdir)/doc/tm.texi -nt $(srcdir)/c-family/c-target.def \
c49a6962 2214 || test $(srcdir)/doc/tm.texi -nt $(srcdir)/common/common-target.def \
acce4e77 2215 ); then \
38f8b050
JR
2216 echo >&2 ; \
2217 echo You should edit $(srcdir)/doc/tm.texi.in rather than $(srcdir)/doc/tm.texi . >&2 ; \
2218 false; \
2219 else \
2220 echo >&2 ; \
2221 echo Verify that you have permission to grant a GFDL license for all >&2 ; \
2222 echo new text in tm.texi, then copy it to $(srcdir)/doc/tm.texi. >&2 ; \
2223 false; \
2224 fi
2225
2d593c86
TT
2226GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
2227 $(host_xm_file_list) \
4f4e53dd 2228 $(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) $(srcdir)/bitmap.h \
807e902e 2229 $(srcdir)/wide-int.h $(srcdir)/alias.h $(srcdir)/coverage.c $(srcdir)/rtl.h \
5e351e96
DN
2230 $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/tree-core.h \
2231 $(srcdir)/libfuncs.h $(SYMTAB_H) \
69c32ec8 2232 $(srcdir)/real.h $(srcdir)/function.h $(srcdir)/insn-addr.h $(srcdir)/hwint.h \
1e1ba002 2233 $(srcdir)/fixed-value.h \
46c30019 2234 $(srcdir)/output.h $(srcdir)/cfgloop.h \
369451ec 2235 $(srcdir)/cselib.h $(srcdir)/basic-block.h $(srcdir)/ipa-ref.h $(srcdir)/cgraph.h \
1ab24192 2236 $(srcdir)/reload.h $(srcdir)/caller-save.c $(srcdir)/symtab.c \
988d1653 2237 $(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \
eefe9a99 2238 $(srcdir)/ipa-prop.c $(srcdir)/ipa-cp.c $(srcdir)/ipa-utils.h \
647a1567 2239 $(srcdir)/dbxout.c \
807e902e 2240 $(srcdir)/signop.h \
647a1567
RH
2241 $(srcdir)/dwarf2out.h \
2242 $(srcdir)/dwarf2asm.c \
2243 $(srcdir)/dwarf2cfi.c \
2244 $(srcdir)/dwarf2out.c \
726a989a 2245 $(srcdir)/tree-vect-generic.c \
11a67599 2246 $(srcdir)/dojump.c \
9994a182 2247 $(srcdir)/emit-rtl.c $(srcdir)/except.h $(srcdir)/explow.c $(srcdir)/expr.c \
aa331cc5 2248 $(srcdir)/expr.h \
9994a182 2249 $(srcdir)/function.c $(srcdir)/except.c \
c6a13190 2250 $(srcdir)/gcse.c $(srcdir)/godump.c \
6399c0ab 2251 $(srcdir)/lists.c $(srcdir)/optabs.c \
360d045b 2252 $(srcdir)/profile.c $(srcdir)/mcf.c \
78bde837 2253 $(srcdir)/reg-stack.c $(srcdir)/cfgrtl.c \
7efcb746 2254 $(srcdir)/sdbout.c $(srcdir)/stor-layout.c \
8a89dbd2 2255 $(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \
83fd5d11 2256 $(srcdir)/gimple.h \
98906124 2257 $(srcdir)/gimple-ssa.h \
ac182688 2258 $(srcdir)/tree-ssanames.c $(srcdir)/tree-eh.c $(srcdir)/tree-ssa-address.c \
726a989a
RB
2259 $(srcdir)/tree-cfg.c \
2260 $(srcdir)/tree-dfa.c \
45b0be94 2261 $(srcdir)/tree-iterator.c $(srcdir)/gimple-expr.c \
726a989a
RB
2262 $(srcdir)/tree-chrec.h \
2263 $(srcdir)/tree-scalar-evolution.c \
456cde30 2264 $(srcdir)/tree-ssa-operands.h \
8a76829c 2265 $(srcdir)/tree-profile.c $(srcdir)/tree-nested.c \
726a989a
RB
2266 $(srcdir)/tree-parloops.c \
2267 $(srcdir)/omp-low.c \
7be82279 2268 $(srcdir)/targhooks.c $(out_file) $(srcdir)/passes.c $(srcdir)/cgraphunit.c \
66a20fc2 2269 $(srcdir)/cgraphclones.c \
726a989a 2270 $(srcdir)/tree-phinodes.c \
5006671f 2271 $(srcdir)/tree-ssa-alias.h \
b12ebd96 2272 $(srcdir)/tree-ssanames.h \
fb3f88cc 2273 $(srcdir)/ipa-prop.h \
0a35513e 2274 $(srcdir)/trans-mem.c \
49ba8180 2275 $(srcdir)/lto-streamer.h \
3bd36029 2276 $(srcdir)/target-globals.h \
632b4f8e 2277 $(srcdir)/ipa-inline.h \
2077db1b 2278 $(srcdir)/vtable-verify.c \
f6d98484 2279 $(srcdir)/asan.c \
de5a5fa1 2280 $(srcdir)/ubsan.c \
b78475cf
YG
2281 $(srcdir)/tsan.c \
2282 $(srcdir)/ipa-devirt.c \
2283 $(srcdir)/internal-fn.h \
e2500fed
GK
2284 @all_gtfiles@
2285
8de8de02
OH
2286# Compute the list of GT header files from the corresponding C sources,
2287# possibly nested within config or language subdirectories. Match gengtype's
2288# behavior in this respect: gt-LANG-file.h for "file" anywhere within a LANG
2289# language subdir, gt-file.h otherwise (no subdir indication for config/
2290# related sources).
2291
2292GTFILES_H = $(subst /,-, \
2293 $(shell echo $(patsubst $(srcdir)/%,gt-%, \
2294 $(patsubst %.c,%.h, \
2295 $(filter %.c, $(GTFILES)))) \
5cff8550 2296 | sed -e "s|/[^ ]*/|/|g" -e "s|gt-config/|gt-|g"))
11a67599
ZW
2297
2298GTFILES_LANG_H = $(patsubst [%], gtype-%.h, $(filter [%], $(GTFILES)))
2299ALL_GTFILES_H := $(sort $(GTFILES_H) $(GTFILES_LANG_H))
2300
2301# $(GTFILES) may be too long to put on a command line, so we have to
2302# write it out to a file (taking care not to do that in a way that
2303# overflows a command line!) and then have gengtype read the file in.
2f035a33 2304
f142b5bc 2305$(ALL_GTFILES_H) gtype-desc.c gtype-desc.h gtype.state: s-gtype ; @true
11a67599 2306
92724e1d
BS
2307### Common flags to gengtype [e.g. -v or -B backupdir]
2308GENGTYPE_FLAGS=
2309
11a67599
ZW
2310gtyp-input.list: s-gtyp-input ; @true
2311s-gtyp-input: Makefile
a4e4a2d6 2312 @: $(call write_entries_to_file,$(GTFILES),tmp-gi.list)
11a67599
ZW
2313 $(SHELL) $(srcdir)/../move-if-change tmp-gi.list gtyp-input.list
2314 $(STAMP) s-gtyp-input
2315
2316s-gtype: build/gengtype$(build_exeext) $(filter-out [%], $(GTFILES)) \
2317 gtyp-input.list
92724e1d
BS
2318# First, parse all files and save a state file.
2319 $(RUN_GEN) build/gengtype$(build_exeext) $(GENGTYPE_FLAGS) \
f142b5bc 2320 -S $(srcdir) -I gtyp-input.list -w tmp-gtype.state
92724e1d
BS
2321# Second, read the state file and generate all files. This ensure that
2322# gtype.state is correctly read:
f142b5bc 2323 $(SHELL) $(srcdir)/../move-if-change tmp-gtype.state gtype.state
92724e1d
BS
2324 $(RUN_GEN) build/gengtype$(build_exeext) $(GENGTYPE_FLAGS) \
2325 -r gtype.state
e2500fed
GK
2326 $(STAMP) s-gtype
2327
39dabefd
SB
2328generated_files = config.h tm.h $(TM_P_H) $(TM_H) multilib.h \
2329 $(simple_generated_h) specs.h \
2330 tree-check.h genrtl.h insn-modes.h tm-preds.h tm-constrs.h \
d2db5e91
TT
2331 $(ALL_GTFILES_H) gtype-desc.c gtype-desc.h gcov-iov.h \
2332 options.h target-hooks-def.h insn-opinit.h \
2333 common/common-target-hooks-def.h pass-instances.def \
2334 c-family/c-target-hooks-def.h
39dabefd 2335
544eb21e 2336#\f
cbbbdc2c 2337# How to compile object files to run on the build machine.
4b09846b 2338
e980df8e 2339build/%.o : # dependencies provided by explicit rule later
7980bfb8
ILT
2340 $(COMPILER_FOR_BUILD) -c $(BUILD_COMPILERFLAGS) $(BUILD_CPPFLAGS) \
2341 -o $@ $<
e980df8e 2342
f8ed6dc5
JS
2343## build/version.o is compiled by the $(COMPILER_FOR_BUILD) but needs
2344## several C macro definitions, just like version.o
2345build/version.o: version.c version.h \
2346 $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE)
2347 $(COMPILER_FOR_BUILD) -c $(BUILD_COMPILERFLAGS) $(BUILD_CPPFLAGS) \
2348 -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
2349 -DREVISION=$(REVISION_s) \
2350 -DDEVPHASE=$(DEVPHASE_s) -DPKGVERSION=$(PKGVERSION_s) \
2351 -DBUGURL=$(BUGURL_s) -o $@ $<
2352
e980df8e
TT
2353# Header dependencies for the programs that generate source code.
2354# These are library modules...
2355build/errors.o : errors.c $(BCONFIG_H) $(SYSTEM_H) errors.h
2356build/gensupport.o: gensupport.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
2357 $(GTM_H) $(RTL_BASE_H) $(OBSTACK_H) errors.h $(HASHTAB_H) \
10692477 2358 $(READ_MD_H) gensupport.h
e980df8e
TT
2359build/ggc-none.o : ggc-none.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
2360 $(GGC_H)
2361build/min-insn-modes.o : min-insn-modes.c $(BCONFIG_H) $(SYSTEM_H) \
2362 $(MACHMODE_H)
2363build/print-rtl.o: print-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
2364 $(GTM_H) $(RTL_BASE_H)
10692477 2365build/read-md.o: read-md.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
bb933490 2366 $(HASHTAB_H) errors.h $(READ_MD_H)
e980df8e 2367build/read-rtl.o: read-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
10692477
RS
2368 $(GTM_H) $(RTL_BASE_H) $(OBSTACK_H) $(HASHTAB_H) $(READ_MD_H) \
2369 gensupport.h
e980df8e 2370build/rtl.o: rtl.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) \
40013784 2371 $(RTL_H) $(GGC_H) errors.h
3e097227 2372build/vec.o : vec.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(VEC_H) \
7c475d11 2373 $(GGC_H) toplev.h $(DIAGNOSTIC_CORE_H)
e980df8e 2374build/gencondmd.o : build/gencondmd.c $(BCONFIG_H) $(SYSTEM_H) \
f9897dfa
L
2375 coretypes.h $(GTM_H) insn-constants.h \
2376 $(filter-out insn-flags.h, $(RTL_H) $(TM_P_H) $(FUNCTION_H) $(REGS_H) \
7c475d11 2377 $(RECOG_H) output.h $(FLAGS_H) $(RESOURCE_H) toplev.h $(DIAGNOSTIC_CORE_H) reload.h \
f9897dfa 2378 $(EXCEPT_H) tm-constrs.h)
0b50988a
EB
2379# This pulls in tm-pred.h which contains inline functions wrapping up
2380# predicates from the back-end so those functions must be discarded.
2381# No big deal since gencondmd.c is a dummy file for non-GCC compilers.
2382build/gencondmd.o : \
2383 BUILD_CFLAGS := $(filter-out -fkeep-inline-functions, $(BUILD_CFLAGS))
4977bab6 2384
e980df8e
TT
2385# ...these are the programs themselves.
2386build/genattr.o : genattr.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
10692477 2387 coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
88a00ef7
JM
2388build/genattr-common.o : genattr-common.c $(RTL_BASE_H) $(BCONFIG_H) \
2389 $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
e980df8e
TT
2390build/genattrtab.o : genattrtab.c $(RTL_BASE_H) $(OBSTACK_H) \
2391 $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(GGC_H) \
9771b263 2392 $(READ_MD_H) gensupport.h $(FNMATCH_H)
e980df8e 2393build/genautomata.o : genautomata.c $(RTL_BASE_H) $(OBSTACK_H) \
3e097227 2394 $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(VEC_H) \
f9bf5a8e 2395 $(HASHTAB_H) gensupport.h $(FNMATCH_H)
bfefafc6 2396build/gencheck.o : gencheck.c all-tree.def $(BCONFIG_H) $(GTM_H) \
16fe2c09
JJ
2397 $(SYSTEM_H) coretypes.h tree.def c-family/c-common.def \
2398 $(lang_tree_files) gimple.def
e980df8e
TT
2399build/genchecksum.o : genchecksum.c $(BCONFIG_H) $(SYSTEM_H) $(MD5_H)
2400build/gencodes.o : gencodes.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
2401 coretypes.h $(GTM_H) errors.h gensupport.h
2402build/genconditions.o : genconditions.c $(RTL_BASE_H) $(BCONFIG_H) \
10692477
RS
2403 $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(HASHTAB_H) $(READ_MD_H) \
2404 gensupport.h
e980df8e
TT
2405build/genconfig.o : genconfig.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
2406 coretypes.h $(GTM_H) errors.h gensupport.h
9b68b6ea
RS
2407build/genconstants.o : genconstants.c $(BCONFIG_H) $(SYSTEM_H) \
2408 coretypes.h errors.h $(READ_MD_H)
e980df8e 2409build/genemit.o : genemit.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
10692477 2410 coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
0fe60a1b
RS
2411build/genenums.o : genenums.c $(BCONFIG_H) $(SYSTEM_H) \
2412 coretypes.h errors.h $(READ_MD_H)
e980df8e 2413build/genextract.o : genextract.c $(RTL_BASE_H) $(BCONFIG_H) \
9771b263 2414 $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
e980df8e 2415build/genflags.o : genflags.c $(RTL_BASE_H) $(OBSTACK_H) $(BCONFIG_H) \
10692477 2416 $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
e980df8e 2417build/gengenrtl.o : gengenrtl.c $(BCONFIG_H) $(SYSTEM_H) rtl.def
4a061351
SB
2418
2419# The gengtype generator program is special: Two versions are built.
2420# One is for the build machine, and one is for the host to allow
2421# plugins to define their types and generate the supporting GGC
2422# datastructures and routines with GTY markers.
2423# The host object files depend on CONFIG_H, and the build objects
2424# on BCONFIG_H. For the build objects, add -DGENERATOR_FILE manually,
2425# the build-%: rule doesn't apply to them.
2426
f142b5bc 2427gengtype-lex.o build/gengtype-lex.o : gengtype-lex.c gengtype.h $(SYSTEM_H)
c3e3d235 2428gengtype-lex.o: $(CONFIG_H) $(BCONFIG_H)
4a061351 2429CFLAGS-gengtype-lex.o += -DGENERATOR_FILE
f142b5bc 2430build/gengtype-lex.o: $(BCONFIG_H)
4a061351 2431
f142b5bc 2432gengtype-parse.o build/gengtype-parse.o : gengtype-parse.c gengtype.h \
e980df8e 2433 $(SYSTEM_H)
f142b5bc 2434gengtype-parse.o: $(CONFIG_H)
4a061351 2435CFLAGS-gengtype-parse.o += -DGENERATOR_FILE
f142b5bc 2436build/gengtype-parse.o: $(BCONFIG_H)
4a061351 2437
f142b5bc
RG
2438gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
2439 gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
2440 $(XREGEX_H)
2441gengtype-state.o: $(CONFIG_H)
4a061351 2442CFLAGS-gengtype-state.o += -DGENERATOR_FILE
f142b5bc
RG
2443build/gengtype-state.o: $(BCONFIG_H)
2444gengtype.o build/gengtype.o : gengtype.c $(SYSTEM_H) gengtype.h \
807e902e
KZ
2445 rtl.def insn-notes.def errors.h double-int.h version.h \
2446 $(HASHTAB_H) $(OBSTACK_H) $(XREGEX_H)
f142b5bc 2447gengtype.o: $(CONFIG_H)
4a061351 2448CFLAGS-gengtype.o += -DGENERATOR_FILE
f142b5bc 2449build/gengtype.o: $(BCONFIG_H)
4a061351 2450
e980df8e 2451build/genmddeps.o: genmddeps.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
9b68b6ea 2452 errors.h $(READ_MD_H)
e980df8e
TT
2453build/genmodes.o : genmodes.c $(BCONFIG_H) $(SYSTEM_H) errors.h \
2454 $(HASHTAB_H) machmode.def $(extra_modes_file)
2455build/genopinit.o : genopinit.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
cd1440b1 2456 coretypes.h $(GTM_H) errors.h gensupport.h optabs.def
e980df8e 2457build/genoutput.o : genoutput.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
10692477 2458 coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
e980df8e 2459build/genpeep.o : genpeep.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
7c475d11 2460 coretypes.h $(GTM_H) errors.h gensupport.h toplev.h $(DIAGNOSTIC_CORE_H)
e980df8e 2461build/genpreds.o : genpreds.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
10692477 2462 coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h $(OBSTACK_H)
e980df8e 2463build/genrecog.o : genrecog.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
10692477 2464 coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
acce4e77 2465build/genhooks.o : genhooks.c $(TARGET_DEF) $(C_TARGET_DEF) \
c49a6962 2466 $(COMMON_TARGET_DEF) $(BCONFIG_H) $(SYSTEM_H) errors.h
4a0639a2
MZ
2467build/genmddump.o : genmddump.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
2468 coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
e980df8e 2469
cbbbdc2c 2470# Compile the programs that generate insn-* from the machine description.
7980bfb8 2471# They are compiled with $(COMPILER_FOR_BUILD), and associated libraries,
cbbbdc2c
ZW
2472# since they need to run on this machine
2473# even if GCC is being compiled to run on some other machine.
1b0c37d7 2474
9b68b6ea 2475# All these programs use the RTL reader ($(BUILD_RTL)).
88a00ef7 2476genprogrtl = attr attr-common attrtab automata codes conditions config emit \
4a0639a2 2477 extract flags opinit output peep preds recog mddump
9b68b6ea
RS
2478$(genprogrtl:%=build/gen%$(build_exeext)): $(BUILD_RTL)
2479
2480# All these programs use the MD reader ($(BUILD_MD)).
0fe60a1b 2481genprogmd = $(genprogrtl) mddeps constants enums
9b68b6ea
RS
2482$(genprogmd:%=build/gen%$(build_exeext)): $(BUILD_MD)
2483
6ddddaed
RW
2484# All these programs need to report errors.
2485genprogerr = $(genprogmd) genrtl modes gtype hooks
2486$(genprogerr:%=build/gen%$(build_exeext)): $(BUILD_ERRORS)
2487
2488# Remaining build programs.
2489genprog = $(genprogerr) check checksum condmd
1c7352cd 2490
0b50988a 2491# These programs need libs over and above what they get from the above list.
8c94f366 2492build/genautomata$(build_exeext) : BUILD_LIBS += -lm
d5706a1e 2493
0458fe77 2494# These programs are not linked with the MD reader.
f8ed6dc5 2495build/gengtype$(build_exeext) : build/gengtype-lex.o build/gengtype-parse.o \
f142b5bc
RG
2496 build/gengtype-state.o build/version.o build/errors.o
2497
2498gengtype$(exeext) : gengtype.o gengtype-lex.o gengtype-parse.o \
2499 gengtype-state.o version.o errors.o $(LIBDEPS)
b6ee5bef
RO
2500 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
2501 $(filter-out ($LIBDEPS), $^) $(LIBS)
6ddddaed
RW
2502
2503# Rule for the generator programs:
2504$(genprog:%=build/gen%$(build_exeext)): build/gen%$(build_exeext): build/gen%.o $(BUILD_LIBDEPS)
a90163e9 2505 +$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) -o $@ \
6ddddaed 2506 $(filter-out $(BUILD_LIBDEPS), $^) $(BUILD_LIBS)
e2500fed 2507
18406601
PB
2508# Generated source files for gengtype. Prepend inclusion of
2509# bconfig.h because AIX requires _LARGE_FILES to be defined before
2510# any system header is included.
03787dfd 2511gengtype-lex.c : gengtype-lex.l
8fb15466
PB
2512 -$(FLEX) $(FLEXFLAGS) -o$@ $< && { \
2513 echo '#include "bconfig.h"' > $@.tmp; \
2514 cat $@ >> $@.tmp; \
2515 mv $@.tmp $@; \
2516 }
fae15c93 2517
e980df8e
TT
2518#\f
2519# Remake internationalization support.
c5bc3df6 2520CFLAGS-intl.o += -DLOCALEDIR=\"$(localedir)\"
e980df8e 2521
544eb21e 2522#\f
52c0e446 2523# Remake cpp.
79d8453e 2524
d059a239
FF
2525PREPROCESSOR_DEFINES = \
2526 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
f686ec05 2527 -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \
d059a239 2528 -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
17719d09 2529 -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \
caa55b1e 2530 -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
98c2359b 2531 -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
793e9558 2532 -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
4977bab6 2533 -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
047d636f 2534 -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
08b2bad2 2535 -DNATIVE_SYSTEM_HEADER_DIR=\"$(NATIVE_SYSTEM_HEADER_DIR)\" \
925af765
RS
2536 -DPREFIX=\"$(prefix)/\" \
2537 -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
047d636f 2538 @TARGET_SYSTEM_ROOT_DEFINE@
79d8453e 2539
c5bc3df6 2540CFLAGS-cppbuiltin.o += $(PREPROCESSOR_DEFINES) -DBASEVER=$(BASEVER_s)
2754b38f 2541cppbuiltin.o: $(BASEVER)
82a1c2fe 2542
c5bc3df6 2543CFLAGS-cppdefault.o += $(PREPROCESSOR_DEFINES)
e980df8e 2544
7bd95cc1
BK
2545# Note for the stamp targets, we run the program `true' instead of
2546# having an empty command (nothing following the semicolon).
2547
e980df8e
TT
2548# gcov-iov.c is run on the build machine to generate gcov-iov.h from version.c
2549build/gcov-iov.o: gcov-iov.c $(BCONFIG_H) coretypes.h $(GTM_H) \
2550 $(SYSTEM_H) coretypes.h $(TM_H)
2551
3b620440 2552build/gcov-iov$(build_exeext): build/gcov-iov.o
a90163e9 2553 +$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) \
7980bfb8 2554 build/gcov-iov.o -o $@
3b620440 2555
28068c2c 2556gcov-iov.h: s-iov
a1286ef5
ZW
2557s-iov: build/gcov-iov$(build_exeext) $(BASEVER) $(DEVPHASE)
2558 build/gcov-iov$(build_exeext) '$(BASEVER_c)' '$(DEVPHASE_c)' \
2559 > tmp-gcov-iov.h
88e3a2a3 2560 $(SHELL) $(srcdir)/../move-if-change tmp-gcov-iov.h gcov-iov.h
28068c2c 2561 $(STAMP) s-iov
4977bab6 2562
2691e6d7 2563GCOV_OBJS = gcov.o
ab87f8c8 2564gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
a90163e9 2565 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
2691e6d7 2566GCOV_DUMP_OBJS = gcov-dump.o
4977bab6 2567gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(LIBDEPS)
a90163e9 2568 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_DUMP_OBJS) \
7980bfb8 2569 $(LIBS) -o $@
c77556a5
RX
2570
2571GCOV_TOOL_DEP_FILES = $(srcdir)/../libgcc/libgcov-util.c gcov-io.c $(GCOV_IO_H) \
2572 $(srcdir)/../libgcc/libgcov-driver.c $(srcdir)/../libgcc/libgcov-driver-system.c \
2573 $(srcdir)/../libgcc/libgcov-merge.c \
2574 $(SYSTEM_H) coretypes.h $(TM_H) $(CONFIG_H) version.h intl.h $(DIAGNOSTIC_H)
2575libgcov-util.o: $(srcdir)/../libgcc/libgcov-util.c $(GCOV_TOOL_DEP_FILES)
2576 +$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -o $@ $<
2577libgcov-driver-tool.o: $(srcdir)/../libgcc/libgcov-driver.c $(GCOV_TOOL_DEP_FILES)
2578 +$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2579 -DIN_GCOV_TOOL=1 -o $@ $<
2580libgcov-merge-tool.o: $(srcdir)/../libgcc/libgcov-merge.c $(GCOV_TOOL_DEP_FILES)
2581 +$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2582 -DIN_GCOV_TOOL=1 -o $@ $<
2583GCOV_TOOL_OBJS = gcov-tool.o libgcov-util.o libgcov-driver-tool.o libgcov-merge-tool.o
2584gcov-tool$(exeext): $(GCOV_TOOL_OBJS) $(LIBDEPS)
2585 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_TOOL_OBJS) $(LIBS) -o $@
544eb21e 2586#\f
f686ec05 2587# Build the include directories. The stamp files are stmp-* rather than
e5e809f4 2588# s-* so that mostlyclean does not force the include directory to
ba1811f1
ILT
2589# be rebuilt.
2590
f686ec05 2591# Build the include directories.
201cdb74 2592stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) fixinc_list
ba1811f1 2593# Copy in the headers provided with gcc.
8294b6fe 2594#
ba1811f1
ILT
2595# The sed command gets just the last file name component;
2596# this is necessary because VPATH could add a dirname.
2597# Using basename would be simpler, but some systems don't have it.
8294b6fe 2598#
c85f7c16 2599# The touch command is here to workaround an AIX/Linux NFS bug.
8294b6fe
OH
2600#
2601# The move-if-change + cp -p twists for limits.h are intended to preserve
2602# the time stamp when we regenerate, to prevent pointless rebuilds during
2603# e.g. install-no-fixedincludes.
7bfe3c97 2604 -if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi
f686ec05 2605 -if [ -d include-fixed ] ; then true; else mkdir include-fixed; chmod a+rx include-fixed; fi
d7371761
RK
2606 for file in .. $(USER_H); do \
2607 if [ X$$file != X.. ]; then \
2608 realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
d9835ae8 2609 $(STAMP) include/$$realfile; \
ae678a13
JW
2610 rm -f include/$$realfile; \
2611 cp $$file include; \
2612 chmod a+r include/$$realfile; \
d7371761 2613 fi; \
ba1811f1 2614 done
9b91e436
KT
2615 for file in .. $(USER_H_INC_NEXT_PRE); do \
2616 if [ X$$file != X.. ]; then \
2617 mv include/$$file include/x_$$file; \
2618 echo "#include_next <$$file>" >include/$$file; \
2619 cat include/x_$$file >>include/$$file; \
2620 rm -f include/x_$$file; \
2621 chmod a+r include/$$file; \
2622 fi; \
2623 done
2624 for file in .. $(USER_H_INC_NEXT_POST); do \
2625 if [ X$$file != X.. ]; then \
2626 echo "#include_next <$$file>" >>include/$$file; \
2627 chmod a+r include/$$file; \
2628 fi; \
2629 done
207bf79d
JM
2630 rm -f include/stdint.h
2631 if [ $(USE_GCC_STDINT) = wrap ]; then \
2632 rm -f include/stdint-gcc.h; \
2633 cp $(srcdir)/ginclude/stdint-gcc.h include/stdint-gcc.h; \
1d9edd01 2634 chmod a+r include/stdint-gcc.h; \
207bf79d 2635 cp $(srcdir)/ginclude/stdint-wrap.h include/stdint.h; \
c8c520dd 2636 chmod a+r include/stdint.h; \
207bf79d
JM
2637 elif [ $(USE_GCC_STDINT) = provide ]; then \
2638 cp $(srcdir)/ginclude/stdint-gcc.h include/stdint.h; \
c8c520dd 2639 chmod a+r include/stdint.h; \
207bf79d 2640 fi
14da6073
JM
2641 set -e; for ml in `cat fixinc_list`; do \
2642 sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \
2643 multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
2644 fix_dir=include-fixed$${multi_dir}; \
2645 if $(LIMITS_H_TEST) ; then \
2646 cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > tmp-xlimits.h; \
2647 else \
2648 cat $(srcdir)/glimits.h > tmp-xlimits.h; \
2649 fi; \
2650 $(mkinstalldirs) $${fix_dir}; \
2651 chmod a+rx $${fix_dir} || true; \
8294b6fe
OH
2652 $(SHELL) $(srcdir)/../move-if-change \
2653 tmp-xlimits.h tmp-limits.h; \
14da6073 2654 rm -f $${fix_dir}/limits.h; \
8294b6fe 2655 cp -p tmp-limits.h $${fix_dir}/limits.h; \
14da6073
JM
2656 chmod a+r $${fix_dir}/limits.h; \
2657 done
e7f62ad3 2658# Install the README
f686ec05
JM
2659 rm -f include-fixed/README
2660 cp $(srcdir)/../fixincludes/README-fixinc include-fixed/README
2661 chmod a+r include-fixed/README
d9835ae8 2662 $(STAMP) $@
e7f62ad3 2663
4977bab6
ZW
2664.PHONY: install-gcc-tooldir
2665install-gcc-tooldir:
947c6b00 2666 $(mkinstalldirs) $(DESTDIR)$(gcc_tooldir)
4977bab6 2667
5cd37749 2668macro_list: s-macro_list; @true
15e3d4f1 2669s-macro_list : $(GCC_PASSES) cc1$(exeext)
53c7ffe7 2670 echo | $(GCC_FOR_TARGET) -E -dM - | \
8160ab35
MK
2671 sed -n -e 's/^#define \([^_][a-zA-Z0-9_]*\).*/\1/p' \
2672 -e 's/^#define \(_[^_A-Z][a-zA-Z0-9_]*\).*/\1/p' | \
5cd37749
JG
2673 sort -u > tmp-macro_list
2674 $(SHELL) $(srcdir)/../move-if-change tmp-macro_list macro_list
2675 $(STAMP) s-macro_list
53c7ffe7 2676
14da6073
JM
2677fixinc_list: s-fixinc_list; @true
2678s-fixinc_list : $(GCC_PASSES)
2679# Build up a list of multilib directories and corresponding sysroot
2680# suffixes, in form sysroot;multilib.
2681 if $(GCC_FOR_TARGET) -print-sysroot-headers-suffix > /dev/null 2>&1; then \
2682 set -e; for ml in `$(GCC_FOR_TARGET) -print-multi-lib`; do \
2683 multi_dir=`echo $${ml} | sed -e 's/;.*$$//'`; \
2684 flags=`echo $${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
2685 sfx=`$(GCC_FOR_TARGET) $${flags} -print-sysroot-headers-suffix`; \
2686 if [ "$${multi_dir}" = "." ]; \
2687 then multi_dir=""; \
2688 else \
2689 multi_dir=/$${multi_dir}; \
2690 fi; \
2691 echo "$${sfx};$${multi_dir}"; \
2692 done; \
2693 else \
2694 echo ";"; \
2695 fi > tmp-fixinc_list
2696 $(SHELL) $(srcdir)/../move-if-change tmp-fixinc_list fixinc_list
2697 $(STAMP) s-fixinc_list
2698
144023ad
AO
2699# The line below is supposed to avoid accidentally matching the
2700# built-in suffix rule `.o:' to build fixincl out of fixincl.o. You'd
2701# expect fixincl to be newer than fixincl.o, such that this situation
2702# would never come up. As it turns out, if you use ccache with
2703# CCACHE_HARDLINK enabled, the compiler doesn't embed the current
2704# working directory in object files (-g absent, or -fno-working-dir
2705# present), and build and host are the same, fixincl for the host will
2706# build after fixincl for the build machine, getting a cache hit,
a4d05547 2707# thereby updating the timestamp of fixincl.o in the host tree.
144023ad
AO
2708# Because of CCACHE_HARDLINK, this will also update the timestamp in
2709# the build tree, and so fixincl in the build tree will appear to be
2710# out of date. Yuck.
2711../$(build_subdir)/fixincludes/fixincl: ; @ :
2712
ba1811f1 2713# Build fixed copies of system files.
be448346
BS
2714# Abort if no system headers available, unless building a crosscompiler.
2715# FIXME: abort unless building --without-headers would be more accurate and less ugly
14da6073 2716stmp-fixinc: gsyslimits.h macro_list fixinc_list \
215c351a
PB
2717 $(build_objdir)/fixincludes/fixincl \
2718 $(build_objdir)/fixincludes/fixinc.sh
f686ec05
JM
2719 rm -rf include-fixed; mkdir include-fixed
2720 -chmod a+rx include-fixed
cc11cc9b
PB
2721 if [ -d ../prev-gcc ]; then \
2722 cd ../prev-gcc && \
9fb03bd8 2723 $(MAKE) real-$(INSTALL_HEADERS_DIR) DESTDIR=`pwd`/../gcc/ \
cc11cc9b 2724 libsubdir=. ; \
3dc4a939 2725 else \
14da6073
JM
2726 set -e; for ml in `cat fixinc_list`; do \
2727 sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \
2728 multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
2729 fix_dir=include-fixed$${multi_dir}; \
2730 if ! $(inhibit_libc) && test ! -d ${SYSTEM_HEADER_DIR}; then \
2731 echo The directory that should contain system headers does not exist: >&2 ; \
2732 echo " ${SYSTEM_HEADER_DIR}" >&2 ; \
2733 tooldir_sysinc=`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`; \
2734 if test "x${SYSTEM_HEADER_DIR}" = "x$${tooldir_sysinc}"; \
2735 then sleep 1; else exit 1; fi; \
2736 fi; \
2737 $(mkinstalldirs) $${fix_dir}; \
2738 chmod a+rx $${fix_dir} || true; \
2739 (TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \
2740 SHELL='$(SHELL)'; MACRO_LIST=`${PWD_COMMAND}`/macro_list ; \
1d93c860 2741 gcc_dir=`${PWD_COMMAND}` ; \
14da6073
JM
2742 export TARGET_MACHINE srcdir SHELL MACRO_LIST && \
2743 cd $(build_objdir)/fixincludes && \
1d93c860 2744 $(SHELL) ./fixinc.sh "$${gcc_dir}/$${fix_dir}" \
14da6073
JM
2745 $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) ); \
2746 rm -f $${fix_dir}/syslimits.h; \
2747 if [ -f $${fix_dir}/limits.h ]; then \
2748 mv $${fix_dir}/limits.h $${fix_dir}/syslimits.h; \
2749 else \
2750 cp $(srcdir)/gsyslimits.h $${fix_dir}/syslimits.h; \
2751 fi; \
2752 chmod a+r $${fix_dir}/syslimits.h; \
2753 done; \
53c7ffe7 2754 fi
d9835ae8 2755 $(STAMP) stmp-fixinc
544eb21e 2756#\f
8294b6fe
OH
2757
2758# Install with the gcc headers files, not the fixed include files, which we
2759# are typically not allowed to distribute. The general idea is to:
2760# - Get to "install" with a bare set of internal headers, not the
2761# fixed system ones,
2762# - Prevent rebuilds of what normally depends on the headers, which is
2763# useless for installation purposes and would rely on improper headers.
2764# - Restore as much of the original state as possible.
2765
2766.PHONY: install-no-fixedincludes
2767
2768install-no-fixedincludes:
2769 # Stash the current set of headers away, save stamps we're going to
2770 # alter explicitly, and arrange for fixincludes not to run next time
2771 # we trigger a headers rebuild.
2772 -rm -rf tmp-include
2773 -mv include tmp-include 2>/dev/null
2774 -mv include-fixed tmp-include-fixed 2>/dev/null
2775 -mv stmp-int-hdrs tmp-stmp-int-hdrs 2>/dev/null
2776 -mv stmp-fixinc tmp-stmp-fixinc 2>/dev/null
2777 -mkdir include
2778 -cp -p $(srcdir)/gsyslimits.h include/syslimits.h
2779 -touch stmp-fixinc
2780
2781 # Rebuild our internal headers, restore the original stamps so that
2782 # "install" doesn't trigger pointless rebuilds because of that update,
2783 # then do install
2784 $(MAKE) $(FLAGS_TO_PASS) stmp-int-hdrs
2785 -mv tmp-stmp-int-hdrs stmp-int-hdrs 2>/dev/null
2786 -mv tmp-stmp-fixinc stmp-fixinc 2>/dev/null
2787 $(MAKE) $(FLAGS_TO_PASS) install
2788
2789 # Restore the original set of maybe-fixed headers
2790 -rm -rf include; mv tmp-include include 2>/dev/null
2791 -rm -rf include-fixed; mv tmp-include-fixed include-fixed 2>/dev/null
2792
79d8453e
RS
2793# Remake the info files.
2794
fda9c731 2795doc: $(BUILD_INFO) $(GENERATED_MANPAGES)
a541f69d
KC
2796
2797INFOFILES = doc/cpp.info doc/gcc.info doc/gccint.info \
2798 doc/gccinstall.info doc/cppinternals.info
2799
2800info: $(INFOFILES) lang.info @GENINSRC@ srcinfo lang.srcinfo
2801
2802srcinfo: $(INFOFILES)
2803 -cp -p $^ $(srcdir)/doc
65455962 2804
a1286ef5
ZW
2805TEXI_CPP_FILES = cpp.texi fdl.texi cppenv.texi cppopts.texi \
2806 gcc-common.texi gcc-vers.texi
65455962 2807
a1286ef5
ZW
2808TEXI_GCC_FILES = gcc.texi gcc-common.texi gcc-vers.texi frontends.texi \
2809 standards.texi invoke.texi extend.texi md.texi objc.texi \
2810 gcov.texi trouble.texi bugreport.texi service.texi \
7f9766e4 2811 contribute.texi compat.texi funding.texi gnu.texi gpl_v3.texi \
04d170d2 2812 fdl.texi contrib.texi cppenv.texi cppopts.texi avr-mmcu.texi \
582e2e43 2813 implement-c.texi implement-cxx.texi arm-neon-intrinsics.texi \
c77556a5
RX
2814 arm-acle-intrinsics.texi aarch64-acle-intrinsics.texi \
2815 gcov-tool.texi
65455962 2816
c18a9bc4
JR
2817# we explicitly use $(srcdir)/doc/tm.texi here to avoid confusion with
2818# the generated tm.texi; the latter might have a more recent timestamp,
2819# but we don't want to rebuild the info files unless the contents of
2820# the *.texi files have changed.
a1286ef5
ZW
2821TEXI_GCCINT_FILES = gccint.texi gcc-common.texi gcc-vers.texi \
2822 contribute.texi makefile.texi configterms.texi options.texi \
c18a9bc4
JR
2823 portability.texi interface.texi passes.texi rtl.texi md.texi \
2824 $(srcdir)/doc/tm.texi hostconfig.texi fragments.texi \
a1286ef5 2825 configfiles.texi collect2.texi headerdirs.texi funding.texi \
7f9766e4 2826 gnu.texi gpl_v3.texi fdl.texi contrib.texi languages.texi \
01e0ef5a 2827 sourcebuild.texi gty.texi libgcc.texi cfg.texi tree-ssa.texi \
b1055be0 2828 loop.texi generic.texi gimple.texi plugins.texi optinfo.texi
65455962 2829
e5fc6da8 2830TEXI_GCCINSTALL_FILES = install.texi install-old.texi fdl.texi \
3b4ed48b 2831 gcc-common.texi gcc-vers.texi
65455962 2832
a1286ef5
ZW
2833TEXI_CPPINT_FILES = cppinternals.texi gcc-common.texi gcc-vers.texi
2834
2835# gcc-vers.texi is generated from the version files.
2836gcc-vers.texi: $(BASEVER) $(DEVPHASE)
2837 (echo "@set version-GCC $(BASEVER_c)"; \
2838 if [ "$(DEVPHASE_c)" = "experimental" ]; \
2839 then echo "@set DEVELOPMENT"; \
2840 else echo "@clear DEVELOPMENT"; \
2841 fi) > $@T
a0e527e3 2842 $(build_file_translate) echo @set srcdir $(abs_srcdir) >> $@T
2f41c1d6
PB
2843 if [ -n "$(PKGVERSION)" ]; then \
2844 echo "@set VERSION_PACKAGE $(PKGVERSION)" >> $@T; \
2845 fi
2846 echo "@set BUGURL $(BUGURL_TEXI)" >> $@T; \
a1286ef5
ZW
2847 mv -f $@T $@
2848
65455962 2849
b5422ad7 2850# The *.1, *.7, *.info, *.dvi, and *.pdf files are being generated from implicit
cb7c0b5a 2851# patterns. To use them, put each of the specific targets with its
65455962 2852# specific dependencies but no build commands.
e2500fed 2853
a541f69d
KC
2854doc/cpp.info: $(TEXI_CPP_FILES)
2855doc/gcc.info: $(TEXI_GCC_FILES)
2856doc/gccint.info: $(TEXI_GCCINT_FILES)
2857doc/cppinternals.info: $(TEXI_CPPINT_FILES)
d7f8491b 2858
a541f69d 2859doc/%.info: %.texi
1f9b3087 2860 if [ x$(BUILD_INFO) = xinfo ]; then \
ad3a7ce3
CD
2861 $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \
2862 -I $(gcc_docdir)/include -o $@ $<; \
1f9b3087 2863 fi
23de1fbf 2864
63069342 2865# Duplicate entry to handle renaming of gccinstall.info
a541f69d 2866doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES)
63069342 2867 if [ x$(BUILD_INFO) = xinfo ]; then \
ad3a7ce3
CD
2868 $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \
2869 -I $(gcc_docdir)/include -o $@ $<; \
63069342
KC
2870 fi
2871
a541f69d
KC
2872doc/cpp.dvi: $(TEXI_CPP_FILES)
2873doc/gcc.dvi: $(TEXI_GCC_FILES)
2874doc/gccint.dvi: $(TEXI_GCCINT_FILES)
2875doc/cppinternals.dvi: $(TEXI_CPPINT_FILES)
63069342 2876
b5422ad7
BM
2877doc/cpp.pdf: $(TEXI_CPP_FILES)
2878doc/gcc.pdf: $(TEXI_GCC_FILES)
2879doc/gccint.pdf: $(TEXI_GCCINT_FILES)
2880doc/cppinternals.pdf: $(TEXI_CPPINT_FILES)
2881
22482f74
MS
2882$(build_htmldir)/cpp/index.html: $(TEXI_CPP_FILES)
2883$(build_htmldir)/gcc/index.html: $(TEXI_GCC_FILES)
2884$(build_htmldir)/gccint/index.html: $(TEXI_GCCINT_FILES)
2885$(build_htmldir)/cppinternals/index.html: $(TEXI_CPPINT_FILES)
9d65c5cb 2886
a541f69d 2887dvi:: doc/gcc.dvi doc/gccint.dvi doc/gccinstall.dvi doc/cpp.dvi \
dedfa466 2888 doc/cppinternals.dvi lang.dvi
8dbda01e 2889
a541f69d 2890doc/%.dvi: %.texi
a1286ef5 2891 $(TEXI2DVI) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
95e30ecc 2892
63069342 2893# Duplicate entry to handle renaming of gccinstall.dvi
a541f69d 2894doc/gccinstall.dvi: $(TEXI_GCCINSTALL_FILES)
a1286ef5 2895 $(TEXI2DVI) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
d7f8491b 2896
bcc3d150
BM
2897PDFFILES = doc/gcc.pdf doc/gccint.pdf doc/gccinstall.pdf doc/cpp.pdf \
2898 doc/cppinternals.pdf
2899
2900pdf:: $(PDFFILES) lang.pdf
b5422ad7
BM
2901
2902doc/%.pdf: %.texi
2903 $(TEXI2PDF) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
2904
2905# Duplicate entry to handle renaming of gccinstall.pdf
2906doc/gccinstall.pdf: $(TEXI_GCCINSTALL_FILES)
2907 $(TEXI2PDF) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
2908
9288b845
CD
2909# List the directories or single hmtl files which are installed by
2910# install-html. The lang.html file triggers language fragments to build
55bcd32b 2911# html documentation.
9288b845
CD
2912HTMLS_INSTALL=$(build_htmldir)/cpp $(build_htmldir)/gcc \
2913 $(build_htmldir)/gccinstall $(build_htmldir)/gccint \
2914 $(build_htmldir)/cppinternals
2915
2916# List the html file targets.
2917HTMLS_BUILD=$(build_htmldir)/cpp/index.html $(build_htmldir)/gcc/index.html \
22482f74
MS
2918 $(build_htmldir)/gccinstall/index.html $(build_htmldir)/gccint/index.html \
2919 $(build_htmldir)/cppinternals/index.html lang.html
9d65c5cb 2920
9288b845 2921html:: $(HTMLS_BUILD)
22482f74
MS
2922
2923$(build_htmldir)/%/index.html: %.texi
9d65c5cb
MS
2924 $(mkinstalldirs) $(@D)
2925 rm -f $(@D)/*
2926 $(TEXI2HTML) -I $(abs_docdir) -I $(abs_docdir)/include -o $(@D) $<
2927
2928# Duplicate entry to handle renaming of gccinstall
22482f74 2929$(build_htmldir)/gccinstall/index.html: $(TEXI_GCCINSTALL_FILES)
9d65c5cb
MS
2930 $(mkinstalldirs) $(@D)
2931 echo rm -f $(@D)/*
a1e6d1ce
MLI
2932 SOURCEDIR=$(abs_docdir) \
2933 DESTDIR=$(@D) \
2934 $(SHELL) $(srcdir)/doc/install.texi2html
9d65c5cb 2935
c77556a5
RX
2936MANFILES = doc/gcov.1 doc/cpp.1 doc/gcc.1 doc/gfdl.7 doc/gpl.7 \
2937 doc/fsf-funding.7 doc/gcov-tool.1
a541f69d 2938
5340bbea 2939generated-manpages: man
ce5c1cf3
KC
2940
2941man: $(MANFILES) lang.man @GENINSRC@ srcman lang.srcman
a541f69d
KC
2942
2943srcman: $(MANFILES)
2944 -cp -p $^ $(srcdir)/doc
c01a508e 2945
a541f69d 2946doc/%.1: %.pod
6280c439 2947 $(STAMP) $@
65455962 2948 -($(POD2MAN) --section=1 $< > $(@).T$$$$ && \
6280c439
MM
2949 mv -f $(@).T$$$$ $@) || \
2950 (rm -f $(@).T$$$$ && exit 1)
6280c439 2951
a541f69d 2952doc/%.7: %.pod
6280c439 2953 $(STAMP) $@
65455962 2954 -($(POD2MAN) --section=7 $< > $(@).T$$$$ && \
6280c439
MM
2955 mv -f $(@).T$$$$ $@) || \
2956 (rm -f $(@).T$$$$ && exit 1)
65455962
KC
2957
2958%.pod: %.texi
2959 $(STAMP) $@
2f41c1d6 2960 -$(TEXI2POD) -DBUGURL="$(BUGURL_TEXI)" $< > $@
65455962
KC
2961
2962.INTERMEDIATE: cpp.pod gcc.pod gfdl.pod fsf-funding.pod
2963cpp.pod: cpp.texi cppenv.texi cppopts.texi
2964
2965# These next rules exist because the output name is not the same as
cb7c0b5a 2966# the input name, so our implicit %.pod rule will not work.
65455962 2967
4db19cc7 2968gcc.pod: invoke.texi cppenv.texi cppopts.texi gcc-vers.texi
65455962
KC
2969 $(STAMP) $@
2970 -$(TEXI2POD) $< > $@
2971gfdl.pod: fdl.texi
2972 $(STAMP) $@
2973 -$(TEXI2POD) $< > $@
2974fsf-funding.pod: funding.texi
2975 $(STAMP) $@
2976 -$(TEXI2POD) $< > $@
7f9766e4
JM
2977gpl.pod: gpl_v3.texi
2978 $(STAMP) $@
2979 -$(TEXI2POD) $< > $@
77bd67cb 2980
544eb21e 2981#\f
79d8453e
RS
2982# Deletion of files made during compilation.
2983# There are four levels of this:
f1908d70 2984# `mostlyclean', `clean', `distclean' and `maintainer-clean'.
79d8453e 2985# `mostlyclean' is useful while working on a particular type of machine.
2e494f70 2986# It deletes most, but not all, of the files made by compilation.
79d8453e 2987# It does not delete libgcc.a or its parts, so it won't have to be recompiled.
2e494f70 2988# `clean' deletes everything made by running `make all'.
47547081 2989# `distclean' also deletes the files made by config.
f1908d70 2990# `maintainer-clean' also deletes everything that could be regenerated
63d9b81c
RK
2991# automatically, except for `configure'.
2992# We remove as much from the language subdirectories as we can
013a2ee0 2993# (less duplicated code).
79d8453e 2994
6eb95e99 2995mostlyclean: lang.mostlyclean
8b1f719a 2996 -rm -f $(MOSTLYCLEANFILES)
9c0fed64 2997 -rm -f *$(objext) c-family/*$(objext)
22aa533e 2998 -rm -f *$(coverageexts)
3b620440
KC
2999# Delete build programs
3000 -rm -f build/*
26be549a 3001 -rm -f mddeps.mk
e5e809f4 3002# Delete other built files.
57dfdff0 3003 -rm -f specs.h options.c options.h options-save.c
e5e809f4
JL
3004# Delete the stamp and temporary files.
3005 -rm -f s-* tmp-* stamp-* stmp-*
013a2ee0 3006 -rm -f */stamp-* */tmp-*
2e494f70 3007# Delete debugging dump files.
61098249 3008 -rm -f *.[0-9][0-9].* */*.[0-9][0-9].*
2e494f70 3009# Delete some files made during installation.
52c0e446 3010 -rm -f specs $(SPECS)
b548dffb 3011 -rm -f collect collect2 mips-tfile mips-tdump
2e494f70
RS
3012# Delete unwanted output files from TeX.
3013 -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
013a2ee0 3014 -rm -f */*.toc */*.log */*.vr */*.fn */*.cp */*.tp */*.ky */*.pg
47547081
RS
3015# Delete sorted indices we don't actually use.
3016 -rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns
2e494f70 3017# Delete core dumps.
013a2ee0 3018 -rm -f core */core
11a67599
ZW
3019# Delete file generated for gengtype
3020 -rm -f gtyp-input.list
92724e1d 3021# Delete files generated by gengtype
8ac9d31f
TJ
3022 -rm -f gtype-*
3023 -rm -f gt-*
92724e1d 3024 -rm -f gtype.state
3fd30b88
GK
3025# Delete genchecksum outputs
3026 -rm -f *-checksum.c
427b248d
JM
3027# Delete lock-and-run bits
3028 -rm -rf linkfe.lck lock-stamp.*
79d8453e 3029
47547081
RS
3030# Delete all files made by compilation
3031# that don't exist in the distribution.
6eb95e99 3032clean: mostlyclean lang.clean
23af32e6 3033 -rm -f libgcc.a libgcc_eh.a libgcov.a
3b415018 3034 -rm -f libgcc_s*
443728bb 3035 -rm -f libunwind*
852b75ed 3036 -rm -f config.h tconfig.h bconfig.h tm_p.h tm.h
776dc15d 3037 -rm -f options.c options.h optionlist
11642c3a 3038 -rm -f cs-*
a541f69d 3039 -rm -f doc/*.dvi
b5422ad7 3040 -rm -f doc/*.pdf
14da6073
JM
3041# Delete the include directories.
3042 -rm -rf include include-fixed
75ed5d8b 3043# Delete files used by the "multilib" facility (including libgcc subdirs).
f6cdc7ea 3044 -rm -f multilib.h tmpmultilib*
75ed5d8b
DE
3045 -if [ "x$(MULTILIB_DIRNAMES)" != x ] ; then \
3046 rm -rf $(MULTILIB_DIRNAMES); \
3047 else if [ "x$(MULTILIB_OPTIONS)" != x ] ; then \
3048 rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \
3049 fi ; fi
79d8453e 3050
47547081
RS
3051# Delete all files that users would normally create
3052# while building and installing GCC.
6eb95e99 3053distclean: clean lang.distclean
11642c3a 3054 -rm -f auto-host.h auto-build.h
d1209685 3055 -rm -f cstamp-h
63d9b81c 3056 -rm -f config.status config.run config.cache config.bak
d232dfa4 3057 -rm -f Make-lang Make-hooks Make-host Make-target
ad854f24 3058 -rm -f Makefile *.oaux
f24af81b 3059 -rm -f gthr-default.h
27bf414c 3060 -rm -f TAGS */TAGS
338023d4 3061 -rm -f *.asm
a051ad3a 3062 -rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak
ad854f24 3063 -rm -f testsuite/*.log testsuite/*.sum
1bb1f121 3064 -cd testsuite && rm -f x *.x *.x? *.exe *.rpo *.o *.s *.S *.c
4977bab6 3065 -cd testsuite && rm -f *.out *.gcov *$(coverageexts)
f362c762 3066 -rm -rf ${QMTEST_DIR} stamp-qmtest
06f0b04c 3067 -rm -f cxxmain.c
fda9c731 3068 -rm -f .gdbinit configargs.h
c01a508e 3069 -rm -f gcov.pod
ad854f24
ZW
3070# Delete po/*.gmo only if we are not building in the source directory.
3071 -if [ ! -f po/exgettext ]; then rm -f po/*.gmo; fi
4adbd5dd 3072 -rmdir ada cp f java objc intl po testsuite plugin 2>/dev/null
2e494f70 3073
63d9b81c 3074# Get rid of every file that's generated from some other file, except for `configure'.
79d8453e 3075# Most of these files ARE PRESENT in the GCC distribution.
63d9b81c
RK
3076maintainer-clean:
3077 @echo 'This command is intended for maintainers to use; it'
3078 @echo 'deletes files that may need special tools to rebuild.'
6eb95e99 3079 $(MAKE) lang.maintainer-clean distclean
17db6582
JM
3080 -rm -f cpp.??s cpp.*aux
3081 -rm -f gcc.??s gcc.*aux
b5422ad7 3082 -rm -f $(gcc_docdir)/*.info $(gcc_docdir)/*.1 $(gcc_docdir)/*.7 $(gcc_docdir)/*.dvi $(gcc_docdir)/*.pdf
544eb21e 3083#\f
455c8f48 3084# Entry points `install', `install-strip', and `uninstall'.
2e494f70 3085# Also use `install-collect2' to install collect2 when the config files don't.
79d8453e 3086
ba1811f1 3087# Copy the compiler files into directories where they will be run.
aab26e16
RK
3088# Install the driver last so that the window when things are
3089# broken is small.
fa958513 3090install: install-common $(INSTALL_HEADERS) \
6eb95e99 3091 install-cpp install-man install-info install-@POSUB@ \
b6b89215 3092 install-driver install-lto-wrapper install-gcc-ar
79d8453e 3093
bf016de8
RAE
3094ifeq ($(enable_plugin),yes)
3095install: install-plugin
3096endif
3097
455c8f48
RW
3098install-strip: override INSTALL_PROGRAM = $(INSTALL_STRIP_PROGRAM)
3099ifneq ($(STRIP),)
3100install-strip: STRIPPROG = $(STRIP)
3101export STRIPPROG
3102endif
3103install-strip: install
3104
587a4ba6 3105# Handle cpp installation.
47b528da 3106install-cpp: installdirs cpp$(exeext)
439020ec
KC
3107 -rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext)
3108 -$(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext)
3109 -if [ x$(cpp_install_dir) != x ]; then \
3110 rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
3111 $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
3112 else true; fi
587a4ba6 3113
69cbb85a 3114# Create the installation directories.
a8ee6e2d 3115# $(libdir)/gcc/include isn't currently searched by cpp.
69cbb85a 3116installdirs:
947c6b00
NN
3117 $(mkinstalldirs) $(DESTDIR)$(libsubdir)
3118 $(mkinstalldirs) $(DESTDIR)$(libexecsubdir)
3119 $(mkinstalldirs) $(DESTDIR)$(bindir)
3120 $(mkinstalldirs) $(DESTDIR)$(includedir)
3121 $(mkinstalldirs) $(DESTDIR)$(infodir)
947c6b00
NN
3122 $(mkinstalldirs) $(DESTDIR)$(man1dir)
3123 $(mkinstalldirs) $(DESTDIR)$(man7dir)
79d8453e 3124
bf016de8 3125PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
9f25a338 3126 toplev.h $(DIAGNOSTIC_CORE_H) $(BASIC_BLOCK_H) $(HASH_TABLE_H) \
2fb9a547
AM
3127 tree-ssa-alias.h $(INTERNAL_FN_H) gimple-fold.h tree-eh.h gimple-expr.h \
3128 gimple.h is-a.h $(TREE_PASS_H) $(GCC_PLUGIN_H) \
ee666c25 3129 $(GGC_H) $(TREE_DUMP_H) $(PRETTY_PRINT_H) $(OPTS_H) $(PARAMS_H) \
cac1b0ee
BS
3130 $(tm_file_list) $(tm_include_list) $(tm_p_file_list) $(tm_p_include_list) \
3131 $(host_xm_file_list) $(host_xm_include_list) $(xm_include_list) \
f895fc2a 3132 intl.h $(PLUGIN_VERSION_H) $(DIAGNOSTIC_H) ${C_TREE_H} \
61d3ce20 3133 $(C_COMMON_H) c-family/c-objc.h $(C_PRETTY_PRINT_H) \
7a300452 3134 tree-iterator.h $(PLUGIN_H) $(TREE_SSA_H) langhooks.h incpath.h debug.h \
3b06d379 3135 $(EXCEPT_H) tree-ssa-sccvn.h real.h output.h $(IPA_UTILS_H) \
33887751 3136 $(C_PRAGMA_H) $(CPPLIB_H) $(FUNCTION_H) \
2a5e9d16 3137 cppdefault.h flags.h $(MD5_H) params.def params.h prefix.h tree-inline.h \
ee666c25 3138 $(GIMPLE_PRETTY_PRINT_H) realmpfr.h \
e60661f0 3139 $(IPA_PROP_H) $(TARGET_H) $(RTL_H) $(TM_P_H) $(CFGLOOP_H) $(EMIT_RTL_H) \
1aa26aac
SE
3140 version.h stringpool.h gimplify.h gimple-iterator.h gimple-ssa.h \
3141 fold-const.h tree-cfg.h tree-into-ssa.h tree-ssanames.h print-tree.h \
487125e7 3142 varasm.h context.h tree-phinodes.h stor-layout.h ssa-iterators.h \
4f0ddb6f
JJ
3143 $(RESOURCE_H) tree-cfgcleanup.h attribs.h calls.h cfgexpand.h \
3144 diagnostic-color.h gcc-symtab.h gimple-builder.h gimple-low.h \
3145 gimple-walk.h gimplify-me.h pass_manager.h print-rtl.h stmt.h \
3146 tree-dfa.h tree-hasher.h tree-nested.h tree-object-size.h tree-outof-ssa.h \
3147 tree-parloops.h tree-ssa-address.h tree-ssa-coalesce.h tree-ssa-dom.h \
3148 tree-ssa-loop.h tree-ssa-loop-ivopts.h tree-ssa-loop-manip.h \
3149 tree-ssa-loop-niter.h tree-ssa-ter.h tree-ssa-threadedge.h \
b3ba5f84
JY
3150 tree-ssa-threadupdate.h inchash.h wide-int.h signop.h hash-map.h \
3151 hash-set.h
bf016de8 3152
090fa0ab
GF
3153# generate the 'build fragment' b-header-vars
3154s-header-vars: Makefile
3155 rm -f tmp-header-vars
af0a7a92
OH
3156# The first sed gets the list "header variables" as the list variables
3157# assigned in Makefile and having _H at the end of the name. "sed -n" proved
3158# more portable than a trailing "-e d" to filter out the uninteresting lines,
3159# in particular on ia64-hpux where "s/.../p" only prints if -n was requested
3160# as well.
3161 $(foreach header_var,$(shell sed < Makefile -n -e 's/^\([A-Z0-9_]*_H\)[ ]*=.*/\1/p'),echo $(header_var)=$(shell echo $($(header_var):$(srcdir)/%=.../%) | sed -e 's~\.\.\./config/~config/~' -e 's~\.\.\..*/~~') >> tmp-header-vars;) \
090fa0ab
GF
3162 $(SHELL) $(srcdir)/../move-if-change tmp-header-vars b-header-vars
3163 $(STAMP) s-header-vars
3164
f142b5bc
RG
3165# Install gengtype
3166install-gengtype: installdirs gengtype$(exeext) gtype.state
3167 $(mkinstalldirs) $(DESTDIR)$(plugin_resourcesdir)
3168 $(INSTALL_DATA) gtype.state $(DESTDIR)$(plugin_resourcesdir)/gtype.state
3169 $(mkinstalldirs) $(DESTDIR)$(plugin_bindir)
3170 $(INSTALL_PROGRAM) gengtype$(exeext) $(DESTDIR)$(plugin_bindir)/gengtype$(exeext)
3171
bf016de8 3172# Install the headers needed to build a plugin.
f142b5bc 3173install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype
1baae426
RG
3174# We keep the directory structure for files in config or c-family and .def
3175# files. All other files are flattened to a single directory.
bf016de8 3176 $(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
2fdb618d 3177 headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`; \
3b3e44eb 3178 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \
bf016de8
RAE
3179 for file in $$headers; do \
3180 if [ -f $$file ] ; then \
3181 path=$$file; \
3182 elif [ -f $(srcdir)/$$file ]; then \
3183 path=$(srcdir)/$$file; \
3184 else continue; \
3185 fi; \
3186 case $$path in \
1baae426 3187 "$(srcdir)"/config/* | "$(srcdir)"/c-family/* | "$(srcdir)"/*.def ) \
9419a9fd 3188 base=`echo "$$path" | sed -e "s|$$srcdirstrip/||"`;; \
bf016de8
RAE
3189 *) base=`basename $$path` ;; \
3190 esac; \
3191 dest=$(plugin_includedir)/$$base; \
86e3c83a 3192 echo $(INSTALL_DATA) $$path $(DESTDIR)$$dest; \
bf016de8 3193 dir=`dirname $$dest`; \
86e3c83a
MK
3194 $(mkinstalldirs) $(DESTDIR)$$dir; \
3195 $(INSTALL_DATA) $$path $(DESTDIR)$$dest; \
bf016de8 3196 done
090fa0ab 3197 $(INSTALL_DATA) b-header-vars $(DESTDIR)$(plugin_includedir)/b-header-vars
bf016de8 3198
79d8453e 3199# Install the compiler executables built during cross compilation.
fa958513 3200install-common: native lang.install-common installdirs
79d8453e
RS
3201 for file in $(COMPILERS); do \
3202 if [ -f $$file ] ; then \
a8ee6e2d
GK
3203 rm -f $(DESTDIR)$(libexecsubdir)/$$file; \
3204 $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libexecsubdir)/$$file; \
79d8453e
RS
3205 else true; \
3206 fi; \
3207 done
d82c57a8 3208 for file in $(EXTRA_PROGRAMS) $(COLLECT2) ..; do \
79d8453e 3209 if [ x"$$file" != x.. ]; then \
a8ee6e2d
GK
3210 rm -f $(DESTDIR)$(libexecsubdir)/$$file; \
3211 $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libexecsubdir)/$$file; \
79d8453e
RS
3212 else true; fi; \
3213 done
e90f1b9d
MM
3214# We no longer install the specs file because its presence makes the
3215# driver slower, and because people who need it can recreate it by
3216# using -dumpspecs. We remove any old version because it would
3217# otherwise override the specs built into the driver.
8ff61ea7 3218 rm -f $(DESTDIR)$(libsubdir)/specs
ca363bb6 3219# Install gcov if it was compiled.
59a64126
DE
3220 -if [ -f gcov$(exeext) ]; \
3221 then \
3743ea05 3222 rm -f $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext); \
90961eff 3223 $(INSTALL_PROGRAM) gcov$(exeext) $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext); \
59a64126 3224 fi
c77556a5
RX
3225# Install gcov-tool if it was compiled.
3226 -if [ -f gcov-tool$(exeext) ]; \
3227 then \
3228 rm -f $(DESTDIR)$(bindir)/$(GCOV_TOOL_INSTALL_NAME)$(exeext); \
3229 $(INSTALL_PROGRAM) \
3230 gcov-tool$(exeext) $(DESTDIR)$(bindir)/$(GCOV_TOOL_INSTALL_NAME)$(exeext); \
3231 fi
aab26e16 3232
5340bbea 3233# Install the driver program as $(target_noncanonical)-gcc,
90ae7019 3234# $(target_noncanonical)-gcc-$(version), and also as gcc if native.
e658449e 3235install-driver: installdirs xgcc$(exeext)
439020ec
KC
3236 -rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
3237 -$(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
a1ce39be 3238 -if [ "$(GCC_INSTALL_NAME)" != "$(target_noncanonical)-gcc-$(version)" ]; then \
bb609c35
TS
3239 rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)$(exeext); \
3240 ( cd $(DESTDIR)$(bindir) && \
3241 $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-$(version)$(exeext) ); \
a1ce39be
RB
3242 fi
3243 -if [ ! -f gcc-cross$(exeext) ] \
3244 && [ "$(GCC_INSTALL_NAME)" != "$(GCC_TARGET_INSTALL_NAME)" ]; then \
caa55b1e 3245 rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-tmp$(exeext); \
90961eff 3246 ( cd $(DESTDIR)$(bindir) && \
caa55b1e
NN
3247 $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-tmp$(exeext) && \
3248 mv -f $(target_noncanonical)-gcc-tmp$(exeext) $(GCC_TARGET_INSTALL_NAME)$(exeext) ); \
79d8453e 3249 fi
79d8453e 3250
0b2fbcb2 3251# Install the info files.
feb9ea1a 3252# $(INSTALL_DATA) might be a relative pathname, so we can't cd into srcdir
ee5b121e 3253# to do the install.
97ae108d
MM
3254install-info:: doc installdirs \
3255 $(DESTDIR)$(infodir)/cpp.info \
3256 $(DESTDIR)$(infodir)/gcc.info \
3257 $(DESTDIR)$(infodir)/cppinternals.info \
ee312cd0 3258 $(DESTDIR)$(infodir)/gccinstall.info \
dedfa466
PB
3259 $(DESTDIR)$(infodir)/gccint.info \
3260 lang.install-info
97ae108d 3261
a541f69d 3262$(DESTDIR)$(infodir)/%.info: doc/%.info installdirs
97ae108d
MM
3263 rm -f $@
3264 if [ -f $< ]; then \
3265 for f in $(<)*; do \
17db6582 3266 realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
90961eff 3267 $(INSTALL_DATA) $$f $(DESTDIR)$(infodir)/$$realfile; \
3d56d025 3268 chmod a-x $(DESTDIR)$(infodir)/$$realfile; \
17db6582
JM
3269 done; \
3270 else true; fi
ee5b121e 3271 -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
a89f5df3
JM
3272 if [ -f $@ ]; then \
3273 install-info --dir-file=$(DESTDIR)$(infodir)/dir $@; \
f8c86b58 3274 else true; fi; \
265ce5bb 3275 else true; fi;
0b2fbcb2 3276
bcc3d150
BM
3277pdf__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
3278
3279install-pdf: $(PDFFILES) lang.install-pdf
3280 @$(NORMAL_INSTALL)
3281 test -z "$(pdfdir)/gcc" || $(mkinstalldirs) "$(DESTDIR)$(pdfdir)/gcc"
3282 @list='$(PDFFILES)'; for p in $$list; do \
3283 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
3284 f=$(pdf__strip_dir) \
3285 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/gcc/$$f'"; \
3286 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/gcc/$$f"; \
3287 done
3288
9288b845 3289html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
d3dc619d 3290
55bcd32b 3291install-html: $(HTMLS_BUILD) lang.install-html
9288b845 3292 @$(NORMAL_INSTALL)
ab7efd91 3293 test -z "$(htmldir)" || $(mkinstalldirs) "$(DESTDIR)$(htmldir)"
9288b845
CD
3294 @list='$(HTMLS_INSTALL)'; for p in $$list; do \
3295 if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
3296 f=$(html__strip_dir) \
3297 if test -d "$$d$$p"; then \
ab7efd91
CD
3298 echo " $(mkinstalldirs) '$(DESTDIR)$(htmldir)/$$f'"; \
3299 $(mkinstalldirs) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
9288b845
CD
3300 echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
3301 $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
3302 else \
3303 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
3304 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
3305 fi; \
3306 done
3307
79d8453e 3308# Install the man pages.
7bfb5ccc 3309install-man: lang.install-man \
a541f69d 3310 $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext) \
52ccb3d2
GK
3311 $(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext) \
3312 $(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext) \
a541f69d
KC
3313 $(DESTDIR)$(man7dir)/fsf-funding$(man7ext) \
3314 $(DESTDIR)$(man7dir)/gfdl$(man7ext) \
3315 $(DESTDIR)$(man7dir)/gpl$(man7ext)
3316
7bfb5ccc 3317$(DESTDIR)$(man7dir)/%$(man7ext): doc/%.7 installdirs
a541f69d
KC
3318 -rm -f $@
3319 -$(INSTALL_DATA) $< $@
3320 -chmod a-x $@
3321
7bfb5ccc 3322$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext): doc/gcc.1 installdirs
a541f69d 3323 -rm -f $@
5340bbea 3324 -$(INSTALL_DATA) $< $@
a541f69d
KC
3325 -chmod a-x $@
3326
7bfb5ccc 3327$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext): doc/cpp.1 installdirs
52ccb3d2 3328 -rm -f $@
5340bbea 3329 -$(INSTALL_DATA) $< $@
52ccb3d2
GK
3330 -chmod a-x $@
3331
7bfb5ccc 3332$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): doc/gcov.1 installdirs
a541f69d 3333 -rm -f $@
5340bbea 3334 -$(INSTALL_DATA) $< $@
a541f69d 3335 -chmod a-x $@
79d8453e 3336
c77556a5
RX
3337$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): doc/gcov-tool.1 installdirs
3338 -rm -f $@
3339 -$(INSTALL_DATA) $< $@
3340 -chmod a-x $@
3341
ba1811f1 3342# Install all the header files built in the include subdirectory.
fecd6201 3343install-headers: $(INSTALL_HEADERS_DIR)
ba1811f1
ILT
3344# Fix symlinks to absolute paths in the installed include directory to
3345# point to the installed directory, not the build directory.
ac64120e 3346# Don't need to use LN_S here since we really do need ln -s and no substitutes.
f686ec05 3347 -files=`cd $(DESTDIR)$(libsubdir)/include-fixed; find . -type l -print 2>/dev/null`; \
ba1811f1 3348 if [ $$? -eq 0 ]; then \
f686ec05 3349 dir=`cd include-fixed; ${PWD_COMMAND}`; \
ba1811f1 3350 for i in $$files; do \
f686ec05 3351 dest=`ls -ld $(DESTDIR)$(libsubdir)/include-fixed/$$i | sed -n 's/.*-> //p'`; \
ba1811f1 3352 if expr "$$dest" : "$$dir.*" > /dev/null; then \
f686ec05
JM
3353 rm -f $(DESTDIR)$(libsubdir)/include-fixed/$$i; \
3354 ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(DESTDIR)$(libsubdir)/include-fixed/$$i; \
ba1811f1
ILT
3355 fi; \
3356 done; \
3357 fi
79d8453e 3358
ba1811f1 3359# Create or recreate the gcc private include file directory.
69cbb85a 3360install-include-dir: installdirs
d3dc619d 3361 $(mkinstalldirs) $(DESTDIR)$(libsubdir)/include
f686ec05 3362 -rm -rf $(DESTDIR)$(libsubdir)/include-fixed
f686ec05 3363 mkdir $(DESTDIR)$(libsubdir)/include-fixed
f686ec05 3364 -chmod a+rx $(DESTDIR)$(libsubdir)/include-fixed
ba1811f1 3365
f08dd1f8
ZW
3366# Create or recreate the install-tools include file directory.
3367itoolsdir = $(libexecsubdir)/install-tools
3368itoolsdatadir = $(libsubdir)/install-tools
3369install-itoolsdirs: installdirs
3370 $(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include
3371 $(mkinstalldirs) $(DESTDIR)$(itoolsdir)
3372
ba1811f1 3373# Install the include directory using tar.
52c0e446 3374install-headers-tar: stmp-int-hdrs install-include-dir
965c3f43
AO
3375# We use `pwd`/include instead of just include to problems with CDPATH
3376# Unless a full pathname is provided, some shells would print the new CWD,
3377# found in CDPATH, corrupting the output. We could just redirect the
3378# output of `cd', but some shells lose on redirection within `()'s
8c90b13a 3379 (cd `${PWD_COMMAND}`/include ; \
90961eff 3380 tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include; tar xpf - )
f686ec05
JM
3381 (cd `${PWD_COMMAND}`/include-fixed ; \
3382 tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include-fixed; tar xpf - )
e6431ec5
RS
3383# /bin/sh on some systems returns the status of the first tar,
3384# and that can lose with GNU tar which always writes a full block.
3385# So use `exit 0' to ignore its exit status.
ba1811f1
ILT
3386
3387# Install the include directory using cpio.
52c0e446 3388install-headers-cpio: stmp-int-hdrs install-include-dir
965c3f43 3389# See discussion about the use of `pwd` above
8c90b13a 3390 cd `${PWD_COMMAND}`/include ; \
90961eff 3391 find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include
f686ec05
JM
3392 cd `${PWD_COMMAND}`/include-fixed ; \
3393 find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include-fixed
79d8453e 3394
ff3aaf17 3395# Install the include directory using cp.
52c0e446 3396install-headers-cp: stmp-int-hdrs install-include-dir
90961eff 3397 cp -p -r include $(DESTDIR)$(libsubdir)
f686ec05 3398 cp -p -r include-fixed $(DESTDIR)$(libsubdir)
ff3aaf17 3399
9fb03bd8
DJ
3400# Targets without dependencies, for use in prev-gcc during bootstrap.
3401real-install-headers-tar:
f686ec05
JM
3402 (cd `${PWD_COMMAND}`/include-fixed ; \
3403 tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include-fixed; tar xpf - )
9fb03bd8
DJ
3404
3405real-install-headers-cpio:
f686ec05
JM
3406 cd `${PWD_COMMAND}`/include-fixed ; \
3407 find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include-fixed
9fb03bd8
DJ
3408
3409real-install-headers-cp:
f686ec05 3410 cp -p -r include-fixed $(DESTDIR)$(libsubdir)
9fb03bd8 3411
53c7ffe7 3412# Install supporting files for fixincludes to be run later.
52c0e446 3413install-mkheaders: stmp-int-hdrs install-itoolsdirs \
14da6073 3414 macro_list fixinc_list
53c7ffe7
GK
3415 $(INSTALL_DATA) $(srcdir)/gsyslimits.h \
3416 $(DESTDIR)$(itoolsdatadir)/gsyslimits.h
3417 $(INSTALL_DATA) macro_list $(DESTDIR)$(itoolsdatadir)/macro_list
14da6073
JM
3418 $(INSTALL_DATA) fixinc_list $(DESTDIR)$(itoolsdatadir)/fixinc_list
3419 set -e; for ml in `cat fixinc_list`; do \
3420 multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
3421 $(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}; \
3422 $(INSTALL_DATA) include-fixed$${multidir}/limits.h $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}/limits.h; \
3423 done
3424 $(INSTALL_SCRIPT) $(srcdir)/../mkinstalldirs \
90961eff 3425 $(DESTDIR)$(itoolsdir)/mkinstalldirs ; \
14da6073
JM
3426 sysroot_headers_suffix='$${sysroot_headers_suffix}'; \
3427 echo 'SYSTEM_HEADER_DIR="'"$(SYSTEM_HEADER_DIR)"'"' \
a8ee6e2d 3428 > $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
e34a3d31 3429 echo 'OTHER_FIXINCLUDES_DIRS="$(OTHER_FIXINCLUDES_DIRS)"' \
a8ee6e2d 3430 >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
a8ee6e2d
GK
3431 echo 'STMP_FIXINC="$(STMP_FIXINC)"' \
3432 >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
e34a3d31 3433
10da1131 3434# Use this target to install the program `collect2' under the name `collect2'.
69cbb85a 3435install-collect2: collect2 installdirs
a8ee6e2d 3436 $(INSTALL_PROGRAM) collect2$(exeext) $(DESTDIR)$(libexecsubdir)/collect2$(exeext)
2e494f70 3437# Install the driver program as $(libsubdir)/gcc for collect2.
a8ee6e2d 3438 $(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(libexecsubdir)/gcc$(exeext)
2e494f70 3439
d7f09764
DN
3440# Install lto-wrapper.
3441install-lto-wrapper: lto-wrapper$(exeext)
3442 $(INSTALL_PROGRAM) lto-wrapper$(exeext) $(DESTDIR)$(libexecsubdir)/lto-wrapper$(exeext)
7ac8318c 3443
d6baa446
RC
3444install-gcc-ar: installdirs gcc-ar$(exeext) gcc-nm$(exeext) gcc-ranlib$(exeext)
3445 for i in gcc-ar gcc-nm gcc-ranlib; do \
3446 install_name=`echo $$i|sed '$(program_transform_name)'` ;\
3447 target_install_name=$(target_noncanonical)-`echo $$i|sed '$(program_transform_name)'` ; \
3448 rm -f $(DESTDIR)$(bindir)/$$install_name$(exeext) ; \
3449 $(INSTALL_PROGRAM) $$i$(exeext) $(DESTDIR)$(bindir)/$$install_name$(exeext) ;\
3450 if test -f gcc-cross$(exeext); then \
b6b89215
AK
3451 :; \
3452 else \
d6baa446 3453 rm -f $(DESTDIR)$(bindir)/$$target_install_name$(exeext); \
b6b89215 3454 ( cd $(DESTDIR)$(bindir) && \
d6baa446 3455 $(LN) $$install_name$(exeext) $$target_install_name$(exeext) ) ; \
b6b89215
AK
3456 fi ; \
3457 done
3458
79d8453e 3459# Cancel installation by deleting the installed files.
6eb95e99 3460uninstall: lang.uninstall
90961eff 3461 -rm -rf $(DESTDIR)$(libsubdir)
a8ee6e2d 3462 -rm -rf $(DESTDIR)$(libexecsubdir)
90961eff 3463 -rm -rf $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
90961eff 3464 -rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext)
1e730c5c 3465 -if [ x$(cpp_install_dir) != x ]; then \
90961eff 3466 rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
1e730c5c 3467 else true; fi
90961eff
AJ
3468 -rm -rf $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext)
3469 -rm -rf $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext)
90961eff 3470 -rm -rf $(DESTDIR)$(man1dir)/cpp$(man1ext)
90961eff
AJ
3471 -rm -f $(DESTDIR)$(infodir)/cpp.info* $(DESTDIR)$(infodir)/gcc.info*
3472 -rm -f $(DESTDIR)$(infodir)/cppinternals.info* $(DESTDIR)$(infodir)/gccint.info*
b6b89215
AK
3473 for i in ar nm ranlib ; do \
3474 install_name=`echo gcc-$$i|sed '$(program_transform_name)'`$(exeext) ;\
3475 target_install_name=$(target_noncanonical)-`echo gcc-$$i|sed '$(program_transform_name)'`$(exeext) ; \
3476 rm -f $(DESTDIR)$(bindir)/$$install_name ; \
3477 rm -f $(DESTDIR)$(bindir)/$$target_install_name ; \
3478 done
544eb21e 3479#\f
4c457b6b 3480# These targets are for the dejagnu testsuites. The file site.exp
e933cbe0
JL
3481# contains global variables that all the testsuites will use.
3482
e933cbe0
JL
3483target_subdir = @target_subdir@
3484
3485site.exp: ./config.status Makefile
3486 @echo "Making a new config file..."
f103fa7a 3487 -@rm -f ./site.tmp
d9835ae8 3488 @$(STAMP) site.exp
e933cbe0 3489 -@mv site.exp site.bak
f103fa7a
RG
3490 @echo "## these variables are automatically generated by make ##" > ./site.tmp
3491 @echo "# Do not edit here. If you wish to override these values" >> ./site.tmp
3492 @echo "# add them to the last section" >> ./site.tmp
3493 @echo "set rootme \"`${PWD_COMMAND}`\"" >> ./site.tmp
3494 @echo "set srcdir \"`cd ${srcdir}; ${PWD_COMMAND}`\"" >> ./site.tmp
3495 @echo "set host_triplet $(host)" >> ./site.tmp
3496 @echo "set build_triplet $(build)" >> ./site.tmp
3497 @echo "set target_triplet $(target)" >> ./site.tmp
3498 @echo "set target_alias $(target_noncanonical)" >> ./site.tmp
3499 @echo "set libiconv \"$(LIBICONV)\"" >> ./site.tmp
e933cbe0 3500# CFLAGS is set even though it's empty to show we reserve the right to set it.
f103fa7a
RG
3501 @echo "set CFLAGS \"\"" >> ./site.tmp
3502 @echo "set CXXFLAGS \"\"" >> ./site.tmp
3503 @echo "set HOSTCC \"$(CC)\"" >> ./site.tmp
3504 @echo "set HOSTCFLAGS \"$(CFLAGS)\"" >> ./site.tmp
c875f596
DN
3505# TEST_ALWAYS_FLAGS are flags that should be passed to every compilation.
3506# They are passed first to allow individual tests to override them.
3507 @echo "set TEST_ALWAYS_FLAGS \"$(SYSROOT_CFLAGS_FOR_TARGET)\"" >> ./site.tmp
4d936aca
JJ
3508# When running the tests we set GCC_EXEC_PREFIX to the install tree so that
3509# files that have already been installed there will be found. The -B option
3510# overrides it, so use of GCC_EXEC_PREFIX will not result in using GCC files
3511# from the install tree.
f103fa7a
RG
3512 @echo "set TEST_GCC_EXEC_PREFIX \"$(libdir)/gcc/\"" >> ./site.tmp
3513 @echo "set TESTING_IN_BUILD_TREE 1" >> ./site.tmp
3514 @echo "set HAVE_LIBSTDCXX_V3 1" >> ./site.tmp
68a607d8 3515 @if test "@enable_plugin@" = "yes" ; then \
f103fa7a
RG
3516 echo "set ENABLE_PLUGIN 1" >> ./site.tmp; \
3517 echo "set PLUGINCC \"$(PLUGINCC)\"" >> ./site.tmp; \
3518 echo "set PLUGINCFLAGS \"$(PLUGINCFLAGS)\"" >> ./site.tmp; \
3519 echo "set GMPINC \"$(GMPINC)\"" >> ./site.tmp; \
68a607d8 3520 fi
d7f09764 3521 @if test "@enable_lto@" = "yes" ; then \
f103fa7a 3522 echo "set ENABLE_LTO 1" >> ./site.tmp; \
d7f09764 3523 fi
e933cbe0
JL
3524# If newlib has been configured, we need to pass -B to gcc so it can find
3525# newlib's crt0.o if it exists. This will cause a "path prefix not used"
3526# message if it doesn't, but the testsuite is supposed to ignore the message -
3527# it's too difficult to tell when to and when not to pass -B (not all targets
3528# have crt0's). We could only add the -B if ../newlib/crt0.o exists, but that
3529# seems like too selective a test.
3530# ??? Another way to solve this might be to rely on linker scripts. Then
3531# theoretically the -B won't be needed.
3532# We also need to pass -L ../ld so that the linker can find ldscripts.
6a1b7268 3533 @if [ -d $(objdir)/../$(target_subdir)/newlib ] \
4665e56c 3534 && [ "${host}" != "${target}" ]; then \
f103fa7a
RG
3535 echo "set newlib_cflags \"-I$(objdir)/../$(target_subdir)/newlib/targ-include -I\$$srcdir/../newlib/libc/include\"" >> ./site.tmp; \
3536 echo "set newlib_ldflags \"-B$(objdir)/../$(target_subdir)/newlib/\"" >> ./site.tmp; \
3537 echo "append CFLAGS \" \$$newlib_cflags\"" >> ./site.tmp; \
3538 echo "append CXXFLAGS \" \$$newlib_cflags\"" >> ./site.tmp; \
3539 echo "append LDFLAGS \" \$$newlib_ldflags\"" >> ./site.tmp; \
e933cbe0
JL
3540 else true; \
3541 fi
3542 @if [ -d $(objdir)/../ld ] ; then \
f103fa7a 3543 echo "append LDFLAGS \" -L$(objdir)/../ld\"" >> ./site.tmp; \
e933cbe0
JL
3544 else true; \
3545 fi
f103fa7a
RG
3546 echo "set tmpdir $(objdir)/testsuite" >> ./site.tmp
3547 @echo "set srcdir \"\$${srcdir}/testsuite\"" >> ./site.tmp
6ccfe27c 3548 @if [ "X$(ALT_CC_UNDER_TEST)" != "X" ] ; then \
f103fa7a 3549 echo "set ALT_CC_UNDER_TEST \"$(ALT_CC_UNDER_TEST)\"" >> ./site.tmp; \
6ccfe27c
JJ
3550 else true; \
3551 fi
fa870451 3552 @if [ "X$(ALT_CXX_UNDER_TEST)" != "X" ] ; then \
f103fa7a 3553 echo "set ALT_CXX_UNDER_TEST \"$(ALT_CXX_UNDER_TEST)\"" >> ./site.tmp; \
fa870451
JJ
3554 else true; \
3555 fi
3556 @if [ "X$(COMPAT_OPTIONS)" != "X" ] ; then \
f103fa7a 3557 echo "set COMPAT_OPTIONS \"$(COMPAT_OPTIONS)\"" >> ./site.tmp; \
fa870451
JJ
3558 else true; \
3559 fi
f103fa7a
RG
3560 @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./site.tmp
3561 @cat ./site.tmp > site.exp
e933cbe0
JL
3562 @cat site.bak | sed \
3563 -e '1,/^## All variables above are.*##/ d' >> site.exp
f103fa7a 3564 -@rm -f ./site.tmp
e933cbe0 3565
d4a10d0a 3566CHECK_TARGETS = @check_languages@
cbc59f01 3567
e933cbe0
JL
3568check: $(CHECK_TARGETS)
3569
7134e605
JJ
3570check-subtargets: $(patsubst %,%-subtargets,$(CHECK_TARGETS))
3571
a738a85c 3572# The idea is to parallelize testing of multilibs, for example:
7dd232a8 3573# make -j3 check-gcc//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}
a738a85c
AO
3574# will run 3 concurrent sessions of check-gcc, eventually testing
3575# all 10 combinations. GNU make is required, as is a shell that expands
3576# alternations within braces.
49a41726
JM
3577lang_checks_parallel = $(lang_checks:=//%)
3578$(lang_checks_parallel): site.exp
7dd232a8
AO
3579 target=`echo "$@" | sed 's,//.*,,'`; \
3580 variant=`echo "$@" | sed 's,^[^/]*//,,'`; \
a738a85c
AO
3581 vardots=`echo "$$variant" | sed 's,/,.,g'`; \
3582 $(MAKE) TESTSUITEDIR="testsuite.$$vardots" \
8207e1fb 3583 RUNTESTFLAGS="--target_board=$$variant $(RUNTESTFLAGS)" \
a738a85c
AO
3584 "$$target"
3585
3586TESTSUITEDIR = testsuite
3587
3588$(TESTSUITEDIR)/site.exp: site.exp
577092ba 3589 -test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR)
a738a85c 3590 -rm -f $@
453897b4 3591 sed '/set tmpdir/ s|testsuite$$|$(TESTSUITEDIR)|' < site.exp > $@
a738a85c 3592
7134e605
JJ
3593# This is only used for check-% targets that aren't parallelized.
3594$(filter-out $(lang_checks_parallelized),$(lang_checks)): check-% : site.exp
4adbd5dd 3595 -test -d plugin || mkdir plugin
577092ba 3596 -test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR)
fea4cfe0 3597 test -d $(TESTSUITEDIR)/$* || mkdir $(TESTSUITEDIR)/$*
8c90b13a
L
3598 -(rootme=`${PWD_COMMAND}`; export rootme; \
3599 srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
fea4cfe0
L
3600 cd $(TESTSUITEDIR)/$*; \
3601 rm -f tmp-site.exp; \
453897b4 3602 sed '/set tmpdir/ s|testsuite$$|$(TESTSUITEDIR)/$*|' \
fea4cfe0 3603 < ../../site.exp > tmp-site.exp; \
88405bd3 3604 $(SHELL) $${srcdir}/../move-if-change tmp-site.exp site.exp; \
d8bb17c8
OP
3605 EXPECT=${EXPECT} ; export EXPECT ; \
3606 if [ -f $${rootme}/../expect/expect ] ; then \
88405bd3 3607 TCL_LIBRARY=`cd .. ; cd $${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
d8bb17c8 3608 export TCL_LIBRARY ; fi ; \
4b09846b 3609 $(RUNTEST) --tool $* $(RUNTESTFLAGS))
d8bb17c8 3610
717c4789 3611$(patsubst %,%-subtargets,$(lang_checks)): check-%-subtargets:
7134e605
JJ
3612 @echo check-$*
3613
3614check_p_tool=$(firstword $(subst _, ,$*))
717c4789 3615check_p_count=$(check_$(check_p_tool)_parallelize)
7134e605 3616check_p_subno=$(word 2,$(subst _, ,$*))
717c4789
JJ
3617check_p_numbers0:=1 2 3 4 5 6 7 8 9
3618check_p_numbers1:=0 $(check_p_numbers0)
3619check_p_numbers2:=$(foreach i,$(check_p_numbers0),$(addprefix $(i),$(check_p_numbers1)))
3620check_p_numbers3:=$(addprefix 0,$(check_p_numbers1)) $(check_p_numbers2)
3621check_p_numbers4:=$(foreach i,$(check_p_numbers0),$(addprefix $(i),$(check_p_numbers3)))
3622check_p_numbers5:=$(addprefix 0,$(check_p_numbers3)) $(check_p_numbers4)
3623check_p_numbers6:=$(foreach i,$(check_p_numbers0),$(addprefix $(i),$(check_p_numbers5)))
3624check_p_numbers:=$(check_p_numbers0) $(check_p_numbers2) $(check_p_numbers4) $(check_p_numbers6)
7134e605 3625check_p_subdir=$(subst _,,$*)
717c4789
JJ
3626check_p_subdirs=$(wordlist 1,$(check_p_count),$(wordlist 1, \
3627 $(if $(GCC_TEST_PARALLEL_SLOTS),$(GCC_TEST_PARALLEL_SLOTS),128), \
3628 $(check_p_numbers)))
7134e605
JJ
3629
3630# For parallelized check-% targets, this decides whether parallelization
3631# is desirable (if -jN is used and RUNTESTFLAGS doesn't contain anything
6feeed06 3632# but optional --target_board or --extra_opts arguments). If desirable,
7134e605
JJ
3633# recursive make is run with check-parallel-$lang{,1,2,3,4,5} etc. goals,
3634# which can be executed in parallel, as they are run in separate directories.
717c4789
JJ
3635# check-parallel-$lang{,1,2,3,4,5} etc. goals invoke runtest with
3636# GCC_RUNTEST_PARALLELIZE_DIR var in the environment and runtest_file_p
3637# dejaGNU procedure is overridden to additionally synchronize through
3638# a $lang-parallel directory which tests will be run by which runtest instance.
7134e605
JJ
3639# Afterwards contrib/dg-extract-results.sh is used to merge the sum and log
3640# files. If parallelization isn't desirable, only one recursive make
3641# is run with check-parallel-$lang goal and check_$lang_parallelize variable
3642# cleared to say that no additional arguments beyond $(RUNTESTFLAGS)
3643# should be passed to runtest.
3644#
3645# To parallelize some language check, add the corresponding check-$lang
3646# to lang_checks_parallelized variable and define check_$lang_parallelize
3647# variable (see above check_gcc_parallelize description).
3648$(lang_checks_parallelized): check-% : site.exp
717c4789
JJ
3649 -rm -rf $(TESTSUITEDIR)/$*-parallel
3650 @if [ "$(filter -j, $(MFLAGS))" = "-j" ]; then \
3651 test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR) || true; \
3652 test -d $(TESTSUITEDIR)/$*-parallel || mkdir $(TESTSUITEDIR)/$*-parallel || true; \
3653 GCC_RUNTEST_PARALLELIZE_DIR=`${PWD_COMMAND}`/$(TESTSUITEDIR)/$(check_p_tool)-parallel ; \
3654 export GCC_RUNTEST_PARALLELIZE_DIR ; \
8207e1fb 3655 $(MAKE) TESTSUITEDIR="$(TESTSUITEDIR)" RUNTESTFLAGS="$(RUNTESTFLAGS)" \
7134e605
JJ
3656 check-parallel-$* \
3657 $(patsubst %,check-parallel-$*_%, $(check_p_subdirs)); \
717c4789
JJ
3658 sums= ; logs= ; \
3659 for dir in $(TESTSUITEDIR)/$* \
3660 $(patsubst %,$(TESTSUITEDIR)/$*%,$(check_p_subdirs));\
7134e605 3661 do \
717c4789
JJ
3662 if [ -d $$dir ]; then \
3663 mv -f $$dir/$*.sum $$dir/$*.sum.sep; mv -f $$dir/$*.log $$dir/$*.log.sep; \
3664 sums="$$sums $$dir/$*.sum.sep"; logs="$$logs $$dir/$*.log.sep"; \
3665 fi; \
7134e605 3666 done; \
717c4789 3667 $(SHELL) $(srcdir)/../contrib/dg-extract-results.sh $$sums \
7134e605 3668 > $(TESTSUITEDIR)/$*/$*.sum; \
717c4789 3669 $(SHELL) $(srcdir)/../contrib/dg-extract-results.sh -L $$logs \
7134e605 3670 > $(TESTSUITEDIR)/$*/$*.log; \
717c4789 3671 rm -rf $(TESTSUITEDIR)/$*-parallel || true; \
7134e605 3672 else \
8207e1fb 3673 $(MAKE) TESTSUITEDIR="$(TESTSUITEDIR)" RUNTESTFLAGS="$(RUNTESTFLAGS)" \
7134e605
JJ
3674 check_$*_parallelize= check-parallel-$*; \
3675 fi
3676
7134e605 3677check-parallel-% : site.exp
2eac0853
JM
3678 -@test -d plugin || mkdir plugin
3679 -@test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR)
3680 @test -d $(TESTSUITEDIR)/$(check_p_subdir) || mkdir $(TESTSUITEDIR)/$(check_p_subdir)
3681 -$(if $(check_p_subno),@)(rootme=`${PWD_COMMAND}`; export rootme; \
7134e605 3682 srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
717c4789
JJ
3683 if [ -n "$(check_p_subno)" ] \
3684 && [ -n "$$GCC_RUNTEST_PARALLELIZE_DIR" ] \
3685 && [ -f $(TESTSUITEDIR)/$(check_p_tool)-parallel/finished ]; then \
3686 rm -rf $(TESTSUITEDIR)/$(check_p_subdir); \
3687 else \
3688 cd $(TESTSUITEDIR)/$(check_p_subdir); \
3689 rm -f tmp-site.exp; \
3690 sed '/set tmpdir/ s|testsuite$$|$(TESTSUITEDIR)/$(check_p_subdir)|' \
7134e605 3691 < ../../site.exp > tmp-site.exp; \
717c4789
JJ
3692 $(SHELL) $${srcdir}/../move-if-change tmp-site.exp site.exp; \
3693 EXPECT=${EXPECT} ; export EXPECT ; \
3694 if [ -f $${rootme}/../expect/expect ] ; then \
3695 TCL_LIBRARY=`cd .. ; cd $${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
3696 export TCL_LIBRARY ; \
3697 fi ; \
3698 $(RUNTEST) --tool $(check_p_tool) $(RUNTESTFLAGS); \
3699 if [ -n "$$GCC_RUNTEST_PARALLELIZE_DIR" ] ; then \
3700 touch $${rootme}/$(TESTSUITEDIR)/$(check_p_tool)-parallel/finished; \
3701 fi ; \
3702 fi )
7134e605 3703
f362c762
MM
3704# QMTest targets
3705
3706# The path to qmtest.
3707QMTEST_PATH=qmtest
3708
3709# The flags to pass to qmtest.
3710QMTESTFLAGS=
3711
3712# The flags to pass to "qmtest run".
d7068b3d 3713QMTESTRUNFLAGS=-f none --result-stream dejagnu_stream.DejaGNUStream
f362c762
MM
3714
3715# The command to use to invoke qmtest.
3716QMTEST=${QMTEST_PATH} ${QMTESTFLAGS}
3717
3718# The tests (or suites) to run.
d7068b3d 3719QMTEST_GPP_TESTS=g++
f362c762
MM
3720
3721# The subdirectory of the OBJDIR that will be used to store the QMTest
3722# test database configuration and that will be used for temporary
3723# scratch space during QMTest's execution.
62363d99 3724QMTEST_DIR=qmtestsuite
f362c762
MM
3725
3726# Create the QMTest database configuration.
3727${QMTEST_DIR} stamp-qmtest:
d7068b3d
MM
3728 ${QMTEST} -D ${QMTEST_DIR} create-tdb \
3729 -c gcc_database.GCCDatabase \
7134e605 3730 -a srcdir=`cd ${srcdir}/testsuite && ${PWD_COMMAND}` && \
d7068b3d 3731 $(STAMP) stamp-qmtest
f362c762
MM
3732
3733# Create the QMTest context file.
3734${QMTEST_DIR}/context: stamp-qmtest
d7068b3d
MM
3735 rm -f $@
3736 echo "CompilerTable.languages=c cplusplus" >> $@
3737 echo "CompilerTable.c_kind=GCC" >> $@
3738 echo "CompilerTable.c_path=${objdir}/xgcc" >> $@
3739 echo "CompilerTable.c_options=-B${objdir}/" >> $@
3740 echo "CompilerTable.cplusplus_kind=GCC" >> $@
5d99894e 3741 echo "CompilerTable.cplusplus_path=${objdir}/xg++" >> $@
d7068b3d 3742 echo "CompilerTable.cplusplus_options=-B${objdir}/" >> $@
caa55b1e 3743 echo "DejaGNUTest.target=${target_noncanonical}" >> $@
f362c762
MM
3744
3745# Run the G++ testsuite using QMTest.
d7068b3d 3746qmtest-g++: ${QMTEST_DIR}/context
f362c762 3747 cd ${QMTEST_DIR} && ${QMTEST} run ${QMTESTRUNFLAGS} -C context \
d7068b3d 3748 -o g++.qmr ${QMTEST_GPP_TESTS}
f362c762
MM
3749
3750# Use the QMTest GUI.
3751qmtest-gui: ${QMTEST_DIR}/context
3752 cd ${QMTEST_DIR} && ${QMTEST} gui -C context
3753
f362c762
MM
3754.PHONY: qmtest-g++
3755
efdc7e19
RH
3756# Run Paranoia on real.c.
3757
40013784 3758paranoia.o: $(srcdir)/../contrib/paranoia.cc $(CONFIG_H) $(SYSTEM_H) $(TREE_H)
3a6ebcdc 3759 g++ -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $< $(OUTPUT_OPTION)
efdc7e19
RH
3760
3761paranoia: paranoia.o real.o $(LIBIBERTY)
3762 g++ -o $@ paranoia.o real.o $(LIBIBERTY)
3763
79d8453e
RS
3764# These exist for maintenance purposes.
3765
3766# Update the tags table.
65ebbf81 3767TAGS: lang.tags
7d60db05
JM
3768 (cd $(srcdir); \
3769 incs= ; \
3770 list='$(SUBDIRS)'; for dir in $$list; do \
3771 if test -f $$dir/TAGS; then \
3772 incs="$$incs --include $$dir/TAGS.sub"; \
3773 fi; \
3774 done; \
4e2b2eee
AH
3775 etags -o TAGS.sub c-family/*.h c-family/*.c *.h *.c *.cc \
3776 --language=none --regex="/\(char\|unsigned int\|int\|bool\|void\|HOST_WIDE_INT\|enum [A-Za-z_0-9]+\) [*]?\([A-Za-z_0-9]+\)/\2/" common.opt \
3777 --language=none --regex="/\(DEF_RTL_EXPR\|DEFTREECODE\|DEFGSCODE\).*(\([A-Za-z_0-9]+\)/\2/" rtl.def tree.def gimple.def \
b67b29f6 3778 --language=none --regex="/DEFTIMEVAR (\([A-Za-z_0-9]+\)/\1/" timevar.def \
4e2b2eee 3779 ; \
7d60db05 3780 etags --include TAGS.sub $$incs)
79d8453e 3781
39e73137 3782# -----------------------------------------------------
5b7874aa
ZW
3783# Rules for generating translated message descriptions.
3784# Disabled by autoconf if the tools are not available.
39e73137 3785# -----------------------------------------------------
5b7874aa
ZW
3786
3787XGETTEXT = @XGETTEXT@
3788GMSGFMT = @GMSGFMT@
3789MSGMERGE = msgmerge
5c3c3683 3790CATALOGS = $(patsubst %,po/%,@CATALOGS@)
5b7874aa 3791
0f81faf6 3792.PHONY: build- install- build-po install-po update-po
5b7874aa
ZW
3793
3794# Dummy rules to deal with dependencies produced by use of
3795# "build-@POSUB@" and "install-@POSUB@" above, when NLS is disabled.
3796build-: ; @true
3797install-: ; @true
3798
3799build-po: $(CATALOGS)
3800
3801# This notation should be acceptable to all Make implementations used
3802# by people who are interested in updating .po files.
3803update-po: $(CATALOGS:.gmo=.pox)
3804
9f6682b7
ZW
3805# N.B. We do not attempt to copy these into $(srcdir). The snapshot
3806# script does that.
5b7874aa 3807.po.gmo:
fc0cd180 3808 $(mkinstalldirs) po
bc524dd0 3809 $(GMSGFMT) --statistics -o $@ $<
5b7874aa 3810
9f6682b7
ZW
3811# The new .po has to be gone over by hand, so we deposit it into
3812# build/po with a different extension.
a1286ef5 3813# If build/po/gcc.pot exists, use it (it was just created),
359cd11e 3814# else use the one in srcdir.
5b7874aa 3815.po.pox:
fc0cd180 3816 $(mkinstalldirs) po
a1286ef5
ZW
3817 $(MSGMERGE) $< `if test -f po/gcc.pot; \
3818 then echo po/gcc.pot; \
3819 else echo $(srcdir)/po/gcc.pot; fi` -o $@
5b7874aa 3820
9f6682b7
ZW
3821# This rule has to look for .gmo modules in both srcdir and
3822# the cwd, and has to check that we actually have a catalog
3823# for each language, in case they weren't built or included
3824# with the distribution.
5b7874aa 3825install-po:
947c6b00 3826 $(mkinstalldirs) $(DESTDIR)$(datadir)
318b7749 3827 cats="$(CATALOGS)"; for cat in $$cats; do \
9f6682b7
ZW
3828 lang=`basename $$cat | sed 's/\.gmo$$//'`; \
3829 if [ -f $$cat ]; then :; \
3830 elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \
3831 else continue; \
3832 fi; \
5b7874aa 3833 dir=$(localedir)/$$lang/LC_MESSAGES; \
947c6b00
NN
3834 echo $(mkinstalldirs) $(DESTDIR)$$dir; \
3835 $(mkinstalldirs) $(DESTDIR)$$dir || exit 1; \
a1286ef5
ZW
3836 echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \
3837 $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \
5b7874aa
ZW
3838 done
3839
3840# Rule for regenerating the message template (gcc.pot).
3841# Instead of forcing everyone to edit POTFILES.in, which proved impractical,
3842# this rule has no dependencies and always regenerates gcc.pot. This is
3843# relatively harmless since the .po files do not directly depend on it.
3844# Note that exgettext has an awk script embedded in it which requires a
3845# fairly modern (POSIX-compliant) awk.
359cd11e 3846# The .pot file is left in the build directory.
a1286ef5 3847gcc.pot: po/gcc.pot
fb72a0a3 3848po/gcc.pot: force
fc0cd180 3849 $(mkinstalldirs) po
02ba6b22 3850 $(MAKE) srcextra
5b7874aa 3851 AWK=$(AWK) $(SHELL) $(srcdir)/po/exgettext \
a1286ef5 3852 $(XGETTEXT) gcc $(srcdir)
eab34643 3853
043378c3
TT
3854#\f
3855
3856# Dependency information.
3857
eab34643
TT
3858# In order for parallel make to really start compiling the expensive
3859# objects from $(OBJS) as early as possible, build all their
3860# prerequisites strictly before all objects.
3861$(ALL_HOST_OBJS) : | $(generated_files)
043378c3
TT
3862
3863# Include the auto-generated dependencies for all host objects.
3864DEPFILES = \
3865 $(foreach obj,$(ALL_HOST_OBJS),\
3866 $(dir $(obj))$(DEPDIR)/$(patsubst %.o,%.Po,$(notdir $(obj))))
3867-include $(DEPFILES)