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