]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/Makefile.in
* tree-flow.h: Move some protoypes. Include new tree-ssa-loop.h.
[thirdparty/gcc.git] / gcc / Makefile.in
CommitLineData
966842d4 1# Makefile for GNU Compiler Collection
2# Run 'configure' to generate Makefile from Makefile.in
3
9231cb67 4# Copyright (C) 1987-2013 Free Software Foundation, Inc.
32e6d418 5
f12b58b3 6#This file is part of GCC.
32e6d418 7
f12b58b3 8#GCC is free software; you can redistribute it and/or modify
32e6d418 9#it under the terms of the GNU General Public License as published by
8c4c00c1 10#the Free Software Foundation; either version 3, or (at your option)
32e6d418 11#any later version.
12
f12b58b3 13#GCC is distributed in the hope that it will be useful,
32e6d418 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
8c4c00c1 19#along with GCC; see the file COPYING3. If not see
20#<http://www.gnu.org/licenses/>.
32e6d418 21
22# The targets for external use include:
2b7a4d59 23# all, doc, install, install-cross, install-cross-rest, install-strip,
e3ca137a 24# uninstall, TAGS, mostlyclean, clean, distclean, maintainer-clean.
32e6d418 25
f5da66df 26# This is the default target.
966842d4 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 =
f5da66df 40
a6b4c5a9 41# Suppress smart makes who think they know how to automake yacc and flex file
c6396a0b 42.y.c:
a6b4c5a9 43.l.c:
c6396a0b 44
966842d4 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:
e79e977d 51.SUFFIXES: .c .cc .o .po .pox .gmo
966842d4 52
53# -------------------------------
54# Standard autoconf-set variables
55# -------------------------------
56
4f442f07 57build=@build@
58host=@host@
966842d4 59target=@target@
88a86c80 60target_noncanonical:=@target_noncanonical@
966842d4 61
62# Sed command to transform gcc to installed name.
88a86c80 63program_transform_name := @program_transform_name@
966842d4 64
65# -----------------------------
66# Directories used during build
67# -----------------------------
68
69# Directory where sources are, from where we are.
70srcdir = @srcdir@
77a85ce7 71gcc_docdir = @srcdir@/doc
b5a57562 72
73# Directory where sources are, absolute.
74abs_srcdir = @abs_srcdir@
75abs_docdir = @abs_srcdir@/doc
15da80c1 76
741b7726 77# Top build directory for this package, relative to here.
78top_builddir = .
c7cc973b 79
794723c1 80# The absolute path to the current directory.
81objdir := $(shell pwd)
966842d4 82
c1eb9e31 83host_subdir=@host_subdir@
2b59cb05 84build_subdir=@build_subdir@
c7cc973b 85target_subdir=@target_subdir@
3e427a9c 86build_libsubdir=@build_libsubdir@
2b59cb05 87
c7cc973b 88# Top build directory for the "Cygnus tree", relative to $(top_builddir).
c1eb9e31 89ifeq ($(host_subdir),.)
c7cc973b 90toplevel_builddir := ..
c1eb9e31 91else
c7cc973b 92toplevel_builddir := ../..
c1eb9e31 93endif
94
c7cc973b 95build_objdir := $(toplevel_builddir)/$(build_subdir)
96build_libobjdir := $(toplevel_builddir)/$(build_libsubdir)
97target_objdir := $(toplevel_builddir)/$(target_subdir)
98
089f59b9 99# --------
100# Defined vpaths
101# --------
102
103# Directory where sources are, from where we are.
104VPATH = @srcdir@
105
d3c27322 106# We define a vpath for the sources of the .texi files here because they
089f59b9 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
097bd8a7 111vpath %.texi $(gcc_docdir)
112vpath %.texi $(gcc_docdir)/include
089f59b9 113
966842d4 114# --------
115# UNSORTED
116# --------
117
32e6d418 118# Variables that exist for you to override.
119# See below for how to change them for certain systems.
120
73027c94 121# List of language subdirectories.
b809c9f2 122SUBDIRS =@subdirs@ build
73027c94 123
32e6d418 124# Selection of languages to be made.
26526d23 125CONFIG_LANGUAGES = @all_selected_languages@
805e22b2 126LANGUAGES = c gcov$(exeext) gcov-dump$(exeext) $(CONFIG_LANGUAGES)
32e6d418 127
3bed0958 128# Default values for variables overridden in Makefile fragments.
0355c121 129# CFLAGS is for the user to override to, e.g., do a cross build with -O2.
f357ac87 130# TCFLAGS is used for compilations with the GCC just built.
3bed0958 131# T_CFLAGS is used for all compilations and is overridden by t-* files.
132T_CFLAGS =
f357ac87 133TCFLAGS =
c81c13fb 134CFLAGS = @CFLAGS@
7ab76cec 135CXXFLAGS = @CXXFLAGS@
26526d23 136LDFLAGS = @LDFLAGS@
f357ac87 137
d5a37d75 138# Flags to determine code coverage. When coverage is disabled, this will
139# contain the optimization flags, as you normally want code coverage
317ddc71 140# without optimization.
d5a37d75 141COVERAGE_FLAGS = @coverage_flags@
b4d48d67 142coverageexts = .{gcda,gcno}
d5a37d75 143
e3ca137a 144# The warning flags are separate from CFLAGS because people tend to
b3ff31d3 145# override optimization flags and we'd like them to still have warnings
146# turned on. These flags are also used to pass other stage dependent
147# flags from configure. The user is free to explicitly turn these flags
148# off if they wish.
f357ac87 149# LOOSE_WARN are the warning flags to use when compiling something
ac242e0f 150# which is only compiled with gcc, such as libgcc.
7ab76cec 151# C_LOOSE_WARN is similar, but with C-only warnings.
e3ca137a 152# STRICT_WARN are the additional warning flags to
ac242e0f 153# apply to the back end and some front ends, which may be compiled
e3ca137a 154# with other compilers.
7ab76cec 155# C_STRICT_WARN is similar, with C-only warnings.
c7cc973b 156LOOSE_WARN = @loose_warn@
7ab76cec 157C_LOOSE_WARN = @c_loose_warn@
e3ca137a 158STRICT_WARN = @strict_warn@
7ab76cec 159C_STRICT_WARN = @c_strict_warn@
f357ac87 160
0d74b24d 161# This is set by --enable-checking. The idea is to catch forgotten
162# "extern" tags in header files.
163NOCOMMON_FLAG = @nocommon_flag@
164
7c801b60 165NOEXCEPTION_FLAGS = @noexception_flags@
166
17e2788d 167# This is set by --disable-maintainer-mode (default) to "#"
141d02d1 168# FIXME: 'MAINT' will always be set to an empty string, no matter if
169# --disable-maintainer-mode is used or not. This is because the
170# following will expand to "MAINT := " in maintainer mode, and to
171# "MAINT := #" in non-maintainer mode, but because '#' starts a comment,
172# they mean exactly the same thing for make.
57eb42be 173MAINT := @MAINT@
17e2788d 174
141d02d1 175# The following provides the variable ENABLE_MAINTAINER_RULES that can
176# be used in language Make-lang.in makefile fragments to enable
177# maintainer rules. So, ENABLE_MAINTAINER_RULES is 'true' in
178# maintainer mode, and '' otherwise.
179@MAINT@ ENABLE_MAINTAINER_RULES = true
180
0fa54ff1 181# These are set by --enable-checking=valgrind.
182RUN_GEN = @valgrind_command@
183VALGRIND_DRIVER_DEFINES = @valgrind_path_defines@
184
f357ac87 185# This is how we control whether or not the additional warnings are applied.
186.-warn = $(STRICT_WARN)
26222a19 187build-warn = $(STRICT_WARN)
7ab76cec 188GCC_WARN_CFLAGS = $(LOOSE_WARN) $(C_LOOSE_WARN) $($(@D)-warn) $(if $(filter-out $(STRICT_WARN),$($(@D)-warn)),,$(C_STRICT_WARN)) $(NOCOMMON_FLAG) $($@-warn)
189GCC_WARN_CXXFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $($@-warn)
a179eb24 190
1d752508 191# These files are to have specific diagnostics suppressed, or are not to
192# be subject to -Werror:
5125036e 193# flex output may yield harmless "no previous prototype" warnings
11ce2c7a 194build/gengtype-lex.o-warn = -Wno-error
6d70c713 195gengtype-lex.o-warn = -Wno-error
f357ac87 196
197# All warnings have to be shut off in stage1 if the compiler used then
198# isn't gcc; configure determines that. WARN_CFLAGS will be either
7ab76cec 199# $(GCC_WARN_CFLAGS), or nothing. Similarly, WARN_CXXFLAGS will be
200# either $(GCC_WARN_CXXFLAGS), or nothing.
f357ac87 201WARN_CFLAGS = @warn_cflags@
7ab76cec 202WARN_CXXFLAGS = @warn_cxxflags@
f357ac87 203
37343e91 204CPPFLAGS = @CPPFLAGS@
205
be2828ce 206AWK = @AWK@
38bce124 207CC = @CC@
7ab76cec 208CXX = @CXX@
345a1501 209BISON = @BISON@
3f1608f3 210BISONFLAGS =
345a1501 211FLEX = @FLEX@
212FLEXFLAGS =
6ac26439 213AR = @AR@
32e6d418 214AR_FLAGS = rc
6ac26439 215NM = @NM@
8c74272d 216RANLIB = @RANLIB@
72318bfa 217RANLIB_FLAGS = @ranlib_flags@
966842d4 218
d6dfe18a 219# Libraries to use on the host.
220HOST_LIBS = @HOST_LIBS@
221
7ab76cec 222# The name of the compiler to use.
7ab76cec 223COMPILER = $(CXX)
224COMPILER_FLAGS = $(CXXFLAGS)
d6dfe18a 225# If HOST_LIBS is set, then the user is controlling the libraries to
226# link against. In that case, link with $(CC) so that the -lstdc++
227# library is not introduced. If HOST_LIBS is not set, link with
228# $(CXX) to pick up -lstdc++.
229ifeq ($(HOST_LIBS),)
7ab76cec 230LINKER = $(CXX)
231LINKER_FLAGS = $(CXXFLAGS)
d6dfe18a 232else
233LINKER = $(CC)
234LINKER_FLAGS = $(CFLAGS)
235endif
585d4848 236
be5f9e46 237# Like LINKER, but use a mutex for serializing front end links.
238ifeq (@DO_LINK_MUTEX@,true)
239LLINKER = $(SHELL) $(srcdir)/lock-and-run.sh linkfe.lck $(LINKER)
240else
241LLINKER = $(LINKER)
242endif
243
966842d4 244# -------------------------------------------
245# Programs which operate on the build machine
246# -------------------------------------------
247
89dc5e05 248SHELL = @SHELL@
3354d061 249# pwd command to use. Allow user to override default by setting PWDCMD in
250# the environment to account for automounters. The make variable must not
251# be called PWDCMD, otherwise the value set here is passed to make
252# subprocesses and overrides the setting from the user's environment.
7a8ca04a 253# Don't use PWD since it is a common shell environment variable and we
254# don't want to corrupt it.
255PWD_COMMAND = $${PWDCMD-pwd}
32e6d418 256# on sysV, define this as cp.
87c0ad1b 257INSTALL = @INSTALL@
ea4a6c81 258# Some systems may be missing symbolic links, regular links, or both.
259# Allow configure to check this and use "ln -s", "ln", or "cp" as appropriate.
260LN=@LN@
261LN_S=@LN_S@
32e6d418 262# These permit overriding just for certain files.
74086405 263INSTALL_PROGRAM = @INSTALL_PROGRAM@
264INSTALL_DATA = @INSTALL_DATA@
4da7cd36 265INSTALL_SCRIPT = @INSTALL@
2b7a4d59 266install_sh = $(SHELL) $(srcdir)/../install-sh
267INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
049ccec1 268MAKEINFO = @MAKEINFO@
ca6eabd1 269MAKEINFOFLAGS = --no-split
f345940f 270TEXI2DVI = texi2dvi
51f93521 271TEXI2PDF = texi2pdf
61a98835 272TEXI2HTML = $(MAKEINFO) --html
fefb5ea6 273TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl
bd5ac53b 274POD2MAN = pod2man --center="GNU" --release="gcc-$(version)" --date=$(shell sed 's/\(....\)\(..\)\(..\)/\1-\2-\3/' <$(DATESTAMP))
8a34c73b 275# Some versions of `touch' (such as the version on Solaris 2.8)
5ec97d31 276# do not correctly set the timestamp due to buggy versions of `utime'
8a34c73b 277# in the kernel. So, we use `echo' instead.
5ec97d31 278STAMP = echo timestamp >
d45cdac2 279# If necessary (e.g., when using the MSYS shell on Microsoft Windows)
280# translate the shell's notion of absolute pathnames to the native
281# spelling.
fbf9447e 282build_file_translate = @build_file_translate@
5ec97d31 283
966842d4 284# Make sure the $(MAKE) variable is defined.
285@SET_MAKE@
286
ca08f0d3 287# Locate mkinstalldirs.
288mkinstalldirs=$(SHELL) $(srcdir)/../mkinstalldirs
289
bdaa15c6 290# write_entries_to_file - writes each entry in a list
291# to the specified file. Entries are written in chunks of
9d75589a 292# $(write_entries_to_file_split) to accommodate systems with
bdaa15c6 293# severe command-line-length limitations.
294# Parameters:
295# $(1): variable containing entries to iterate over
296# $(2): output file
297write_entries_to_file_split = 50
298write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) \
299 $(foreach range, \
300 $(shell i=1; while test $$i -le $(words $(1)); do \
301 echo $$i; i=`expr $$i + $(write_entries_to_file_split)`; done), \
fd4a16cd 302 $(shell echo "$(wordlist $(range), \
303 $(shell expr $(range) + $(write_entries_to_file_split) - 1), $(1))" \
f5763863 304 | tr ' ' '\012' >> $(2)))
bdaa15c6 305
966842d4 306# --------
307# UNSORTED
308# --------
309
b8bd120b 310# Dependency tracking stuff.
311CCDEPMODE = @CCDEPMODE@
312DEPDIR = @DEPDIR@
313depcomp = $(SHELL) $(srcdir)/../depcomp
314
e7c8aa66 315# In the past we used AC_PROG_CC_C_O and set this properly, but
316# it was discovered that this hadn't worked in a long time, so now
317# we just hard-code.
318OUTPUT_OPTION = -o $@
966842d4 319
f357ac87 320# This is where we get zlib from. zlibdir is -L../zlib and zlibinc is
321# -I../zlib, unless we were configured with --with-system-zlib, in which
322# case both are empty.
323ZLIB = @zlibdir@ -lz
324ZLIBINC = @zlibinc@
32e6d418 325
4ee9c684 326# How to find GMP
327GMPLIBS = @GMPLIBS@
328GMPINC = @GMPINC@
329
87e20041 330# How to find ISL
331ISLINC = @ISLINC@
255b6be7 332
333# How to find CLOOG
334CLOOGLIBS = @CLOOGLIBS@
335CLOOGINC = @CLOOGINC@
336
7bfefa9d 337# Set to 'yes' if the LTO front end is enabled.
338enable_lto = @enable_lto@
339
5299ef9d 340# Compiler and flags needed for plugin support
5299ef9d 341PLUGINCC = @CXX@
342PLUGINCFLAGS = @CXXFLAGS@
9d58ff65 343
344# Libs and linker options needed for plugin support
9227b6fc 345PLUGINLIBS = @pluginlibs@
346
912f2b18 347enable_plugin = @enable_plugin@
348
3824453e 349CPPLIB = ../libcpp/libcpp.a
d856c8a6 350CPPINC = -I$(srcdir)/../libcpp/include
351
3c28f41a 352# Where to find decNumber
10de71e1 353enable_decimal_float = @enable_decimal_float@
3c28f41a 354DECNUM = $(srcdir)/../libdecnumber
10de71e1 355DECNUMFMT = $(srcdir)/../libdecnumber/$(enable_decimal_float)
356DECNUMINC = -I$(DECNUM) -I$(DECNUMFMT) -I../libdecnumber
3c28f41a 357LIBDECNUMBER = ../libdecnumber/libdecnumber.a
358
3f425711 359# The backtrace library.
360BACKTRACE = $(srcdir)/../libbacktrace
361BACKTRACEINC = -I$(BACKTRACE)
362LIBBACKTRACE = ../libbacktrace/.libs/libbacktrace.a
363
2cfd79fe 364# Target to use when installing include directory. Either
ffe38693 365# install-headers-tar, install-headers-cpio or install-headers-cp.
87c0ad1b 366INSTALL_HEADERS_DIR = @build_install_headers_dir@
2cfd79fe 367
c8763215 368# Header files that are made available under the same name
369# to programs compiled with GCC.
2675096e 370USER_H = $(srcdir)/ginclude/float.h \
f3dde807 371 $(srcdir)/ginclude/iso646.h \
372 $(srcdir)/ginclude/stdarg.h \
373 $(srcdir)/ginclude/stdbool.h \
374 $(srcdir)/ginclude/stddef.h \
375 $(srcdir)/ginclude/varargs.h \
68a556d6 376 $(srcdir)/ginclude/stdfix.h \
985c6e3a 377 $(srcdir)/ginclude/stdnoreturn.h \
83e25171 378 $(srcdir)/ginclude/stdalign.h \
f3dde807 379 $(EXTRA_HEADERS)
c8763215 380
ac0366be 381USER_H_INC_NEXT_PRE = @user_headers_inc_next_pre@
382USER_H_INC_NEXT_POST = @user_headers_inc_next_post@
383
894a47b4 384# The GCC to use for compiling crt*.o.
b3781cc4 385# Usually the one we just built.
894a47b4 386# Don't use this as a dependency--use $(GCC_PASSES).
805e22b2 387GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include -L$(objdir)/../ld
32e6d418 388
224d9f3d 389# Set if the compiler was configured with --with-build-sysroot.
390SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
391
32e6d418 392# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
794723c1 393# It specifies -B./.
d23f832c 394# It also specifies -isystem ./include to find, e.g., stddef.h.
7ab76cec 395GCC_CFLAGS=$(CFLAGS_FOR_TARGET) $(INTERNAL_CFLAGS) $(T_CFLAGS) $(LOOSE_WARN) $(C_LOOSE_WARN) -Wold-style-definition $($@-warn) -isystem ./include $(TCFLAGS)
32e6d418 396
966842d4 397# ---------------------------------------------------
398# Programs which produce files for the target machine
399# ---------------------------------------------------
fbc57885 400
50088060 401AR_FOR_TARGET := $(shell \
fbc57885 402 if [ -f $(objdir)/../binutils/ar ] ; then \
403 echo $(objdir)/../binutils/ar ; \
404 else \
4f442f07 405 if [ "$(host)" = "$(target)" ] ; then \
6ac26439 406 echo $(AR); \
fbc57885 407 else \
2b7a4d59 408 t='$(program_transform_name)'; echo ar | sed -e "$$t" ; \
fbc57885 409 fi; \
50088060 410 fi)
8a34c73b 411AR_FLAGS_FOR_TARGET =
aa787722 412AR_CREATE_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) rc
413AR_EXTRACT_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) x
80556f23 414LIPO_FOR_TARGET = lipo
f32e3360 415ORIGINAL_AS_FOR_TARGET = @ORIGINAL_AS_FOR_TARGET@
50088060 416RANLIB_FOR_TARGET := $(shell \
fbc57885 417 if [ -f $(objdir)/../binutils/ranlib ] ; then \
418 echo $(objdir)/../binutils/ranlib ; \
419 else \
4f442f07 420 if [ "$(host)" = "$(target)" ] ; then \
6d7e356a 421 echo $(RANLIB); \
fbc57885 422 else \
2b7a4d59 423 t='$(program_transform_name)'; echo ranlib | sed -e "$$t" ; \
fbc57885 424 fi; \
50088060 425 fi)
f32e3360 426ORIGINAL_LD_FOR_TARGET = @ORIGINAL_LD_FOR_TARGET@
427ORIGINAL_NM_FOR_TARGET = @ORIGINAL_NM_FOR_TARGET@
428NM_FOR_TARGET = ./nm
80556f23 429STRIP_FOR_TARGET := $(shell \
2b7a4d59 430 if [ -f $(objdir)/../binutils/strip-new ] ; then \
431 echo $(objdir)/../binutils/strip-new ; \
80556f23 432 else \
433 if [ "$(host)" = "$(target)" ] ; then \
434 echo strip; \
435 else \
2b7a4d59 436 t='$(program_transform_name)'; echo strip | sed -e "$$t" ; \
80556f23 437 fi; \
438 fi)
fbc57885 439
966842d4 440# --------
441# UNSORTED
442# --------
443
8a5b87ad 444# Where to find some libiberty headers.
445HASHTAB_H = $(srcdir)/../include/hashtab.h
21886706 446OBSTACK_H = $(srcdir)/../include/obstack.h
bb96e316 447SPLAY_TREE_H= $(srcdir)/../include/splay-tree.h
21886706 448MD5_H = $(srcdir)/../include/md5.h
eb3dd80d 449XREGEX_H = $(srcdir)/../include/xregex.h
2334f0df 450FNMATCH_H = $(srcdir)/../include/fnmatch.h
8a5b87ad 451
7bfefa9d 452# Linker plugin API headers
453LINKER_PLUGIN_API_H = $(srcdir)/../include/plugin-api.h
7bfefa9d 454
0fc07c25 455# Default native SYSTEM_HEADER_DIR, to be overridden by targets.
638454a1 456NATIVE_SYSTEM_HEADER_DIR = @NATIVE_SYSTEM_HEADER_DIR@
397f1574 457# Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
805e22b2 458CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
397f1574 459
0fc07c25 460# autoconf sets SYSTEM_HEADER_DIR to one of the above.
9d75589a 461# Purge it of unnecessary internal relative paths
4a62cbb1 462# to directories that might not exist yet.
463# The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta.
01916651 464# Use single quotes here to avoid nested double- and backquotes, this
465# macro is also used in a double-quoted context.
466SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta`
0fc07c25 467
f2397fc4 468# Control whether to run fixincludes.
280d5c1a 469STMP_FIXINC = @STMP_FIXINC@
a5889b74 470
0848b369 471# Test to see whether <limits.h> exists in the system header files.
472LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
473
805e22b2 474# Directory for prefix to system directories, for
475# each of $(system_prefix)/usr/include, $(system_prefix)/usr/lib, etc.
476TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
1a035bcc 477TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@
805e22b2 478
a455468e 479xmake_file=@xmake_file@
480tmake_file=@tmake_file@
f555bf81 481TM_ENDIAN_CONFIG=@TM_ENDIAN_CONFIG@
482TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@
483TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@
87c0ad1b 484out_file=$(srcdir)/config/@out_file@
485out_object_file=@out_object_file@
3e87b980 486common_out_file=$(srcdir)/common/config/@common_out_file@
487common_out_object_file=@common_out_object_file@
87c0ad1b 488md_file=$(srcdir)/config/@md_file@
805e22b2 489tm_file_list=@tm_file_list@
4dcab8b7 490tm_include_list=@tm_include_list@
8d4f8d46 491tm_defines=@tm_defines@
83b8e55b 492tm_p_file_list=@tm_p_file_list@
4dcab8b7 493tm_p_include_list=@tm_p_include_list@
83b8e55b 494build_xm_file_list=@build_xm_file_list@
4dcab8b7 495build_xm_include_list=@build_xm_include_list@
83b8e55b 496build_xm_defines=@build_xm_defines@
497host_xm_file_list=@host_xm_file_list@
4dcab8b7 498host_xm_include_list=@host_xm_include_list@
83b8e55b 499host_xm_defines=@host_xm_defines@
4dcab8b7 500xm_file_list=@xm_file_list@
501xm_include_list=@xm_include_list@
8b24e546 502xm_defines=@xm_defines@
e53d55e7 503lang_checks=
504lang_checks_parallelized=
94ce8195 505dg_target_exps:=aarch64.exp,alpha.exp,arm.exp,avr.exp,bfin.exp,cris.exp
506dg_target_exps:=$(dg_target_exps),epiphany.exp,frv.exp,i386.exp,ia64.exp
507dg_target_exps:=$(dg_target_exps),m68k.exp,microblaze.exp,mips.exp,powerpc.exp
508dg_target_exps:=$(dg_target_exps),rx.exp,s390.exp,sh.exp,sparc.exp,spu.exp
509dg_target_exps:=$(dg_target_exps),tic6x.exp,xstormy16.exp
a0d20ccb 510# This lists a couple of test files that take most time during check-gcc.
511# When doing parallelized check-gcc, these can run in parallel with the
512# remaining tests. Each word in this variable stands for work for one
513# make goal and one extra make goal is added to handle all the *.exp
514# files not handled explicitly already. If multiple *.exp files
515# should be run in the same runtest invocation (usually if they aren't
516# very long running, but still should be split of from the check-parallel-$lang
517# remaining tests runtest invocation), they should be concatenated with commas.
518# Note that [a-zA-Z] wildcards need to have []s prefixed with \ (needed
519# by tcl) and as the *.exp arguments are mached both as is and with
520# */ prefixed to it in runtest_file_p, it is usually desirable to include
521# a subdirectory name.
522check_gcc_parallelize=execute.exp=execute/2* \
03cf39fc 523 execute.exp=execute/\[013-9a-fA-F\]* \
524 execute.exp=execute/\[pP\]*,dg.exp \
525 execute.exp=execute/\[g-oq-zG-OQ-Z\]*,compile.exp=compile/2* \
526 compile.exp=compile/\[9pP\]*,builtins.exp \
527 compile.exp=compile/\[013-8a-oq-zA-OQ-Z\]* \
528 dg-torture.exp,ieee.exp \
94ce8195 529 vect.exp,unsorted.exp \
530 guality.exp \
531 struct-layout-1.exp,stackalign.exp \
532 $(dg_target_exps)
7bedc3a0 533lang_opt_files=@lang_opt_files@ $(srcdir)/c-family/c.opt $(srcdir)/common.opt
87c0ad1b 534lang_specs_files=@lang_specs_files@
c3cc26e1 535lang_tree_files=@lang_tree_files@
83b8e55b 536target_cpu_default=@target_cpu_default@
5c872430 537OBJC_BOEHM_GC=@objc_boehm_gc@
47a2c1d4 538extra_modes_file=@extra_modes_file@
ff05e09e 539extra_opt_files=@extra_opt_files@
b197fbcf 540host_hook_obj=@out_host_hook_obj@
32e6d418 541
77adc39e 542# Multiarch support
543enable_multiarch = @enable_multiarch@
af69b10a 544with_cpu = @with_cpu@
77adc39e 545with_float = @with_float@
546ifeq ($(enable_multiarch),yes)
547 if_multiarch = $(1)
77adc39e 548else
91cf035d 549 ifeq ($(enable_multiarch),auto)
550 # SYSTEM_HEADER_DIR is makefile syntax, cannot be evaluated in configure.ac
551 if_multiarch = $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib/*/crti.o),$(1))
552 else
553 if_multiarch =
554 endif
77adc39e 555endif
556
966842d4 557# ------------------------
558# Installation directories
559# ------------------------
560
32e6d418 561# Common prefix for installation directories.
562# NOTE: This directory must exist when you start installation.
87c0ad1b 563prefix = @prefix@
2ffdcadf 564# Directory in which to put localized header files. On the systems with
565# gcc as the native cc, `local_prefix' may not be `prefix' which is
566# `/usr'.
a2aa0fc1 567# NOTE: local_prefix *should not* default from prefix.
87c0ad1b 568local_prefix = @local_prefix@
c6396a0b 569# Directory in which to put host dependent programs and libraries
87c0ad1b 570exec_prefix = @exec_prefix@
32e6d418 571# Directory in which to put the executable for the command `gcc'
87c0ad1b 572bindir = @bindir@
32e6d418 573# Directory in which to put the directories used by the compiler.
87c0ad1b 574libdir = @libdir@
9db45a87 575# Directory in which GCC puts its executables.
576libexecdir = @libexecdir@
966842d4 577
578# --------
579# UNSORTED
580# --------
581
9db45a87 582# Directory in which the compiler finds libraries etc.
d58156a1 583libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(version)
9db45a87 584# Directory in which the compiler finds executables
d58156a1 585libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(version)
6d70c713 586# Directory in which all plugin resources are installed
587plugin_resourcesdir = $(libsubdir)/plugin
588 # Directory in which plugin headers are installed
589plugin_includedir = $(plugin_resourcesdir)/include
590# Directory in which plugin specific executables are installed
591plugin_bindir = $(libexecsubdir)/plugin
40cb25f2 592# Used to produce a relative $(gcc_tooldir) in gcc.o
8099945b 593unlibsubdir = ../../..
fc5f9e0c 594# $(prefix), expressed as a path relative to $(libsubdir).
595#
596# An explanation of the sed strings:
597# -e 's|^$(prefix)||' matches and eliminates 'prefix' from 'exec_prefix'
598# -e 's|/$$||' match a trailing forward slash and eliminates it
599# -e 's|^[^/]|/|' forces the string to start with a forward slash (*)
600# -e 's|/[^/]*|../|g' replaces each occurrence of /<directory> with ../
601#
602# (*) Note this pattern overwrites the first character of the string
603# with a forward slash if one is not already present. This is not a
604# problem because the exact names of the sub-directories concerned is
605# unimportant, just the number of them matters.
606#
607# The practical upshot of these patterns is like this:
608#
609# prefix exec_prefix result
610# ------ ----------- ------
611# /foo /foo/bar ../
612# /foo/ /foo/bar ../
613# /foo /foo/bar/ ../
614# /foo/ /foo/bar/ ../
615# /foo /foo/bar/ugg ../../
616libsubdir_to_prefix := \
617 $(unlibsubdir)/$(shell echo "$(libdir)" | \
618 sed -e 's|^$(prefix)||' -e 's|/$$||' -e 's|^[^/]|/|' \
619 -e 's|/[^/]*|../|g')
620# $(exec_prefix), expressed as a path relative to $(prefix).
621prefix_to_exec_prefix := \
622 $(shell echo "$(exec_prefix)" | \
623 sed -e 's|^$(prefix)||' -e 's|^/||' -e '/./s|$$|/|')
f22b529a 624# Directory in which to find other cross-compilation tools and headers.
066520ea 625dollar = @dollar@
f22b529a 626# Used in install-cross.
627gcc_tooldir = @gcc_tooldir@
976ceec9 628# Since gcc_tooldir does not exist at build-time, use -B$(build_tooldir)/bin/
d58156a1 629build_tooldir = $(exec_prefix)/$(target_noncanonical)
e23b9583 630# Directory in which the compiler finds target-independent g++ includes.
631gcc_gxx_include_dir = @gcc_gxx_include_dir@
36ddd5fe 632gcc_gxx_include_dir_add_sysroot = @gcc_gxx_include_dir_add_sysroot@
35df828f 633# Directory to search for site-specific includes.
759d75c3 634local_includedir = $(local_prefix)/include
635includedir = $(prefix)/include
a2aa0fc1 636# where the info files go
87c0ad1b 637infodir = @infodir@
3e2f90b9 638# Where cpp should go besides $prefix/bin if necessary
639cpp_install_dir = @cpp_install_dir@
be2828ce 640# where the locale files go
eb718689 641datadir = @datadir@
be2828ce 642localedir = $(datadir)/locale
32e6d418 643# Extension (if any) to put in installed man-page filename.
7a16ce2c 644man1ext = .1
645man7ext = .7
f403cbcb 646objext = .o
2aa3e87b 647exeext = @host_exeext@
648build_exeext = @build_exeext@
f403cbcb 649
32e6d418 650# Directory in which to put man pages.
3cf6a465 651mandir = @mandir@
652man1dir = $(mandir)/man1
7a16ce2c 653man7dir = $(mandir)/man7
f32abccb 654# Dir for temp files.
655tmpdir = /tmp
32e6d418 656
85690e4d 657datarootdir = @datarootdir@
658docdir = @docdir@
18f327f7 659# Directory in which to build HTML
85690e4d 660build_htmldir = $(objdir)/HTML/gcc-$(version)
61a98835 661# Directory in which to put HTML
85690e4d 662htmldir = @htmldir@
61a98835 663
be2828ce 664# Whether we were configured with NLS.
665USE_NLS = @USE_NLS@
666
667# Internationalization library.
c6976b58 668LIBINTL = @LIBINTL@
669LIBINTL_DEP = @LIBINTL_DEP@
be2828ce 670
39000f9a 671# Character encoding conversion library.
672LIBICONV = @LIBICONV@
c6976b58 673LIBICONV_DEP = @LIBICONV_DEP@
39000f9a 674
05513b45 675# If a supplementary library is being used for the GC.
676GGC_LIB=
677
a99be165 678# "true" if the target C library headers are unavailable; "false"
679# otherwise.
680inhibit_libc = @inhibit_libc@
681ifeq ($(inhibit_libc),true)
682INHIBIT_LIBC_CFLAGS = -Dinhibit_libc
683endif
684
32e6d418 685# List of extra executables that should be compiled for this target machine
7151decb 686# that are used when linking.
32e6d418 687# The rules for compiling them should be in the t-* file for the machine.
87c0ad1b 688EXTRA_PROGRAMS = @extra_programs@
c6396a0b 689
c6396a0b 690# List of extra object files that should be compiled and linked with
691# compiler proper (cc1, cc1obj, cc1plus).
87c0ad1b 692EXTRA_OBJS = @extra_objs@
c6396a0b 693
17108b2b 694# List of extra object files that should be compiled and linked with
695# the gcc driver.
69eb04f7 696EXTRA_GCC_OBJS =@extra_gcc_objs@
17108b2b 697
76fd9e61 698# List of extra libraries that should be linked with the gcc driver.
699EXTRA_GCC_LIBS = @EXTRA_GCC_LIBS@
700
630c76ba 701# List of additional header files to install.
87c0ad1b 702EXTRA_HEADERS =@extra_headers_list@
630c76ba 703
f3449a3c 704# How to handle <stdint.h>.
705USE_GCC_STDINT = @use_gcc_stdint@
706
e08c7853 707# The configure script will set this to collect2$(exeext), except on a
708# (non-Unix) host which can not build collect2, for which it will be
709# set to empty.
710COLLECT2 = @collect2@
79f818d0 711
32e6d418 712# Program to convert libraries.
c6221df9 713LIBCONVERT =
32e6d418 714
715# Control whether header files are installed.
336ff1b3 716INSTALL_HEADERS=install-headers install-mkheaders
32e6d418 717
049ccec1 718# Control whether Info documentation is built and installed.
719BUILD_INFO = @BUILD_INFO@
049ccec1 720
fefb5ea6 721# Control whether manpages generated by texi2pod.pl can be rebuilt.
722GENERATED_MANPAGES = @GENERATED_MANPAGES@
723
106a27e5 724# Additional directories of header files to run fixincludes on.
af731fc2 725# These should be directories searched automatically by default
726# just as /usr/include is.
c6221df9 727# *Do not* use this for directories that happen to contain
af731fc2 728# header files, but are not searched automatically by default.
106a27e5 729# On most systems, this is empty.
730OTHER_FIXINCLUDES_DIRS=
731
fc0b8ef8 732# A list of all the language-specific executables.
e53d55e7 733COMPILERS = @all_compilers@
fc0b8ef8 734
77a164d8 735# List of things which should already be built whenever we try to use xgcc
32e6d418 736# to compile anything (without linking).
e53d55e7 737GCC_PASSES=xgcc$(exeext) specs
32e6d418 738
32e6d418 739# Directory to link to, when using the target `maketest'.
740DIR = ../gcc
741
0fc07c25 742# Native compiler for the build machine and its switches.
58933515 743CC_FOR_BUILD = @CC_FOR_BUILD@
a44c8c3b 744CXX_FOR_BUILD = @CXX_FOR_BUILD@
805e22b2 745BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE
a44c8c3b 746BUILD_CXXFLAGS = @BUILD_CXXFLAGS@ -DGENERATOR_FILE
0fc07c25 747
585d4848 748# Native compiler that we use. This may be C++ some day.
a44c8c3b 749COMPILER_FOR_BUILD = $(CXX_FOR_BUILD)
750BUILD_COMPILERFLAGS = $(BUILD_CXXFLAGS)
585d4848 751
40b6e20e 752# Native linker that we use.
a44c8c3b 753LINKER_FOR_BUILD = $(CXX_FOR_BUILD)
754BUILD_LINKERFLAGS = $(BUILD_CXXFLAGS)
40b6e20e 755
0fc07c25 756# Native linker and preprocessor flags. For x-fragment overrides.
9841cd80 757BUILD_LDFLAGS=@BUILD_LDFLAGS@
805e22b2 758BUILD_CPPFLAGS=$(ALL_CPPFLAGS)
32e6d418 759
b541ad9d 760# Actual name to use when installing a native compiler.
88a86c80 761GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)')
762GCC_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo gcc|sed '$(program_transform_name)')
763CPP_INSTALL_NAME := $(shell echo cpp|sed '$(program_transform_name)')
88a86c80 764GCOV_INSTALL_NAME := $(shell echo gcov|sed '$(program_transform_name)')
b541ad9d 765
6c08487b 766# Setup the testing framework, if you have one
767EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
768 echo $${rootme}/../expect/expect ; \
769 else echo expect ; fi`
770
771RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
772 echo $${srcdir}/../dejagnu/runtest ; \
773 else echo runtest; fi`
774RUNTESTFLAGS =
775
d0faeb9d 776# This should name the specs file that we're going to install. Target
777# Makefiles may override it and name another file to be generated from
778# the built-in specs and installed as the default spec, as long as
779# they also introduce a rule to generate a file name specs, to be used
780# at build time.
781SPECS = specs
782
755fa783 783# Extra include files that are defined by HeaderInclude directives in
784# the .opt files
785OPTIONS_H_EXTRA =
786
787# Extra include files that are defined by SourceInclude directives in
788# the .opt files
0f246197 789OPTIONS_C_EXTRA = $(PRETTY_PRINT_H)
755fa783 790
791@option_includes@
792
32e6d418 793# End of variables for you to override.
794
805e22b2 795# GTM_H lists the config files that the generator files depend on,
796# while TM_H lists the ones ordinary gcc files depend on, which
797# includes several files generated by those generators.
21886706 798BCONFIG_H = bconfig.h $(build_xm_file_list)
805e22b2 799CONFIG_H = config.h $(host_xm_file_list)
e23a6527 800TCONFIG_H = tconfig.h $(xm_file_list)
805e22b2 801TM_P_H = tm_p.h $(tm_p_file_list)
c50b68d2 802GTM_H = tm.h $(tm_file_list) insn-constants.h
022a2799 803TM_H = $(GTM_H) insn-flags.h $(OPTIONS_H)
805e22b2 804
1af67e62 805# Variables for version information.
ff84d87f 806BASEVER := $(srcdir)/BASE-VER # 4.x.y
807DEVPHASE := $(srcdir)/DEV-PHASE # experimental, prerelease, ""
808DATESTAMP := $(srcdir)/DATESTAMP # YYYYMMDD or empty
a2b17a85 809REVISION := $(srcdir)/REVISION # [BRANCH revision XXXXXX]
1af67e62 810
ff84d87f 811BASEVER_c := $(shell cat $(BASEVER))
812DEVPHASE_c := $(shell cat $(DEVPHASE))
813DATESTAMP_c := $(shell cat $(DATESTAMP))
1af67e62 814
a2b17a85 815ifeq (,$(wildcard $(REVISION)))
816REVISION_c :=
1fdf44f0 817REVISION :=
a2b17a85 818else
819REVISION_c := $(shell cat $(REVISION))
820endif
821
ff84d87f 822version := $(BASEVER_c)
1af67e62 823
824# For use in version.c - double quoted strings, with appropriate
825# surrounding punctuation and spaces, and with the datestamp and
826# development phase collapsed to the empty string in release mode
827# (i.e. if DEVPHASE_c is empty). The space immediately after the
828# comma in the $(if ...) constructs is significant - do not remove it.
ff84d87f 829BASEVER_s := "\"$(BASEVER_c)\""
830DEVPHASE_s := "\"$(if $(DEVPHASE_c), ($(DEVPHASE_c)))\""
831DATESTAMP_s := "\"$(if $(DEVPHASE_c), $(DATESTAMP_c))\""
d25dc80e 832PKGVERSION_s:= "\"@PKGVERSION@\""
833BUGURL_s := "\"@REPORT_BUGS_TO@\""
834
835PKGVERSION := @PKGVERSION@
836BUGURL_TEXI := @REPORT_BUGS_TEXI@
1af67e62 837
a2b17a85 838ifdef REVISION_c
839REVISION_s := "\"$(if $(DEVPHASE_c), $(REVISION_c))\""
840else
c80cefd7 841REVISION_s := "\"\""
a2b17a85 842endif
843
21886706 844# Shorthand variables for dependency lists.
c7d89805 845DUMPFILE_H = $(srcdir)/../libcpp/include/line-map.h dumpfile.h
f1f41a6c 846VEC_H = vec.h statistics.h $(GGC_H)
2b15d2ba 847HASH_TABLE_H = $(HASHTAB_H) hash-table.h
f1f41a6c 848EXCEPT_H = except.h $(HASHTAB_H)
c94b1d0e 849TARGET_DEF = target.def target-hooks-macros.h
850C_TARGET_DEF = c-family/c-target.def target-hooks-macros.h
3e87b980 851COMMON_TARGET_DEF = common/common-target.def target-hooks-macros.h
e7a88601 852TARGET_H = $(TM_H) target.h $(TARGET_DEF) insn-modes.h insn-codes.h
c94b1d0e 853C_TARGET_H = c-family/c-target.h $(C_TARGET_DEF)
218e3e4e 854COMMON_TARGET_H = common/common-target.h $(INPUT_H) $(COMMON_TARGET_DEF)
21886706 855MACHMODE_H = machmode.h mode-classes.def insn-modes.h
856HOOKS_H = hooks.h $(MACHMODE_H)
857HOSTHOOKS_DEF_H = hosthooks-def.h $(HOOKS_H)
858LANGHOOKS_DEF_H = langhooks-def.h $(HOOKS_H)
202d6e5f 859TARGET_DEF_H = target-def.h target-hooks-def.h $(HOOKS_H) targhooks.h
c94b1d0e 860C_TARGET_DEF_H = c-family/c-target-def.h c-family/c-target-hooks-def.h \
218e3e4e 861 $(TREE_H) $(C_COMMON_H) $(HOOKS_H) common/common-targhooks.h
50a8e74c 862RTL_BASE_H = coretypes.h rtl.h rtl.def $(MACHMODE_H) reg-notes.def \
863 insn-notes.def $(INPUT_H) $(REAL_H) statistics.h $(VEC_H) \
864 $(FIXED_VALUE_H) alias.h $(HASHTAB_H)
36eba48c 865FIXED_VALUE_H = fixed-value.h $(MACHMODE_H) double-int.h
f1f41a6c 866RTL_H = $(RTL_BASE_H) $(FLAGS_H) genrtl.h
ac0640e5 867READ_MD_H = $(OBSTACK_H) $(HASHTAB_H) read-md.h
21886706 868PARAMS_H = params.h params.def
4c0315d0 869BUILTINS_DEF = builtins.def sync-builtins.def omp-builtins.def \
3c6d4197 870 gtm-builtins.def sanitizer.def cilkplus.def
fb049fba 871INTERNAL_FN_DEF = internal-fn.def
872INTERNAL_FN_H = internal-fn.h $(INTERNAL_FN_DEF)
96423453 873TREE_CORE_H = tree-core.h coretypes.h all-tree.def tree.def \
874 c-family/c-common.def $(lang_tree_files) $(MACHMODE_H) \
875 $(BUILTINS_DEF) $(INPUT_H) statistics.h \
876 $(VEC_H) treestruct.def $(HASHTAB_H) \
f1f41a6c 877 double-int.h alias.h $(SYMTAB_H) $(FLAGS_H) \
7bedc3a0 878 $(REAL_H) $(FIXED_VALUE_H)
96423453 879TREE_H = tree.h $(TREE_CORE_H) tree-check.h
0f71a633 880REGSET_H = regset.h $(BITMAP_H) hard-reg-set.h
a0235af9 881BASIC_BLOCK_H = basic-block.h $(PREDICT_H) $(VEC_H) $(FUNCTION_H) \
882 cfg-flags.def cfghooks.h
ea269688 883GIMPLE_H = gimple.h gimple.def gsstruct.def pointer-set.h $(VEC_H) \
f1f41a6c 884 $(GGC_H) $(BASIC_BLOCK_H) $(TREE_H) tree-ssa-operands.h \
d9dd21a8 885 tree-ssa-alias.h $(INTERNAL_FN_H) $(HASH_TABLE_H)
21886706 886GCOV_IO_H = gcov-io.h gcov-iov.h auto-host.h
21886706 887RECOG_H = recog.h
21886706 888EMIT_RTL_H = emit-rtl.h
50a8e74c 889FLAGS_H = flags.h flag-types.h $(OPTIONS_H)
755fa783 890OPTIONS_H = options.h flag-types.h $(OPTIONS_H_EXTRA)
f1f41a6c 891FUNCTION_H = function.h $(HASHTAB_H) $(TM_H) hard-reg-set.h \
892 $(VEC_H) $(INPUT_H) $(MACHMODE_H)
21886706 893EXPR_H = expr.h insn-config.h $(FUNCTION_H) $(RTL_H) $(FLAGS_H) $(TREE_H) $(MACHMODE_H) $(EMIT_RTL_H)
ee65118b 894OPTABS_H = optabs.h insn-codes.h insn-opinit.h
c6e9953d 895REGS_H = regs.h $(MACHMODE_H) hard-reg-set.h
f1f41a6c 896CFGLOOP_H = cfgloop.h $(BASIC_BLOCK_H) double-int.h \
0f71a633 897 $(BITMAP_H) sbitmap.h
21886706 898IPA_UTILS_H = ipa-utils.h $(TREE_H) $(CGRAPH_H)
36eba48c 899IPA_REFERENCE_H = ipa-reference.h $(BITMAP_H) $(TREE_H)
ea269688 900CGRAPH_H = cgraph.h $(VEC_H) $(TREE_H) $(BASIC_BLOCK_H) $(FUNCTION_H) \
2dc9831f 901 cif-code.def ipa-ref.h ipa-ref-inline.h $(LINKER_PLUGIN_API_H) is-a.h
0f71a633 902DF_H = df.h $(BITMAP_H) $(REGSET_H) sbitmap.h $(BASIC_BLOCK_H) \
903 alloc-pool.h $(TIMEVAR_H)
21886706 904RESOURCE_H = resource.h hard-reg-set.h $(DF_H)
460b8bb3 905GCC_H = gcc.h version.h $(DIAGNOSTIC_CORE_H)
36eba48c 906GGC_H = ggc.h gtype-desc.h statistics.h
21886706 907TIMEVAR_H = timevar.h timevar.def
808674b1 908INSN_ATTR_H = insn-attr.h insn-attr-common.h $(INSN_ADDR_H)
f1f41a6c 909INSN_ADDR_H = $(srcdir)/insn-addr.h
4a020a8c 910C_COMMON_H = c-family/c-common.h c-family/c-common.def $(TREE_H) \
7bedc3a0 911 $(SPLAY_TREE_H) $(CPPLIB_H) $(GGC_H) $(DIAGNOSTIC_CORE_H)
912C_PRAGMA_H = c-family/c-pragma.h $(CPPLIB_H)
3ce7d1bd 913C_TREE_H = c/c-tree.h $(C_COMMON_H) $(DIAGNOSTIC_H)
36eba48c 914SYSTEM_H = system.h hwint.h $(srcdir)/../include/libiberty.h \
915 $(srcdir)/../include/safe-ctype.h $(srcdir)/../include/filenames.h
21886706 916PREDICT_H = predict.h predict.def
c39ed964 917CPPLIB_H = $(srcdir)/../libcpp/include/line-map.h \
918 $(srcdir)/../libcpp/include/cpplib.h
36eba48c 919INPUT_H = $(srcdir)/../libcpp/include/line-map.h input.h
ba30d337 920OPTS_H = $(INPUT_H) $(VEC_H) opts.h $(OBSTACK_H)
36eba48c 921SYMTAB_H = $(srcdir)/../libcpp/include/symtab.h $(OBSTACK_H)
c39ed964 922CPP_ID_DATA_H = $(CPPLIB_H) $(srcdir)/../libcpp/include/cpp-id-data.h
36eba48c 923CPP_INTERNAL_H = $(srcdir)/../libcpp/internal.h $(CPP_ID_DATA_H)
c7d89805 924TREE_DUMP_H = tree-dump.h $(SPLAY_TREE_H) $(DUMPFILE_H)
925TREE_PASS_H = tree-pass.h $(TIMEVAR_H) $(DUMPFILE_H)
21886706 926TREE_FLOW_H = tree-flow.h tree-flow-inline.h tree-ssa-operands.h \
0f71a633 927 $(BITMAP_H) sbitmap.h $(BASIC_BLOCK_H) $(GIMPLE_H) \
dd277d48 928 $(HASHTAB_H) $(CGRAPH_H) $(IPA_REFERENCE_H) \
929 tree-ssa-alias.h
69ee5dbb 930TREE_SSA_H = tree-ssa.h $(TREE_FLOW_H)
36eba48c 931PRETTY_PRINT_H = pretty-print.h $(INPUT_H) $(OBSTACK_H)
eb3dd80d 932TREE_PRETTY_PRINT_H = tree-pretty-print.h $(PRETTY_PRINT_H)
933GIMPLE_PRETTY_PRINT_H = gimple-pretty-print.h $(TREE_PRETTY_PRINT_H)
92468061 934DIAGNOSTIC_CORE_H = diagnostic-core.h $(INPUT_H) bversion.h diagnostic.def
852f689e 935DIAGNOSTIC_H = diagnostic.h $(DIAGNOSTIC_CORE_H) $(PRETTY_PRINT_H)
7bedc3a0 936C_PRETTY_PRINT_H = c-family/c-pretty-print.h $(PRETTY_PRINT_H) \
937 $(C_COMMON_H) $(TREE_H)
f1f41a6c 938TREE_INLINE_H = tree-inline.h
21886706 939REAL_H = real.h $(MACHMODE_H)
7bfefa9d 940LTO_STREAMER_H = lto-streamer.h $(LINKER_PLUGIN_API_H) $(TARGET_H) \
d9dd21a8 941 $(CGRAPH_H) $(VEC_H) $(HASH_TABLE_H) $(TREE_H) $(GIMPLE_H) \
32d76803 942 $(GCOV_IO_H) $(DIAGNOSTIC_H) alloc-pool.h pointer-set.h
821d0e0f 943IPA_PROP_H = ipa-prop.h $(TREE_H) $(VEC_H) $(CGRAPH_H) $(GIMPLE_H) alloc-pool.h
36eba48c 944BITMAP_H = bitmap.h $(HASHTAB_H) statistics.h
eb3dd80d 945GCC_PLUGIN_H = gcc-plugin.h highlev-plugin-common.h plugin.def \
946 $(CONFIG_H) $(SYSTEM_H) $(HASHTAB_H)
a0b14cdf 947PLUGIN_H = plugin.h $(GCC_PLUGIN_H)
e8ad34e4 948PLUGIN_VERSION_H = plugin-version.h configargs.h
8d0badf1 949CONTEXT_H = context.h
41d1788c 950
2e9d8ccf 951#\f
32e6d418 952# Now figure out from those variables how to compile and link.
953
0fc07c25 954# IN_GCC distinguishes between code compiled into GCC itself and other
955# programs built during a bootstrap.
29d774d0 956# autoconf inserts -DCROSS_DIRECTORY_STRUCTURE if we are building a
957# cross compiler which does not use the native headers and libraries.
9cfab531 958INTERNAL_CFLAGS = -DIN_GCC @CROSS@
32e6d418 959
c19ee476 960# This is the variable actually used when we compile. If you change this,
c0450c4b 961# you probably want to update BUILD_CFLAGS in configure.ac
141acd01 962ALL_CFLAGS = $(T_CFLAGS) $(CFLAGS-$@) \
794723c1 963 $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@
32e6d418 964
7ab76cec 965# The C++ version.
cbc8c5f6 966ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) $(INTERNAL_CFLAGS) \
7c801b60 967 $(COVERAGE_FLAGS) $(NOEXCEPTION_FLAGS) $(WARN_CXXFLAGS) @DEFS@
7ab76cec 968
dd350d42 969# Likewise. Put INCLUDES at the beginning: this way, if some autoconf macro
970# puts -I options in CPPFLAGS, our include files in the srcdir will always
971# win against random include files in /usr/include.
794723c1 972ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS)
32e6d418 973
585d4848 974# This is the variable to use when using $(COMPILER).
7ab76cec 975ALL_COMPILERFLAGS = $(ALL_CXXFLAGS)
585d4848 976
40b6e20e 977# This is the variable to use when using $(LINKER).
7ab76cec 978ALL_LINKERFLAGS = $(ALL_CXXFLAGS)
40b6e20e 979
2b59cb05 980# Build and host support libraries.
883c44aa 981LIBIBERTY = ../libiberty/libiberty.a
3e427a9c 982BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
32e6d418 983
ad0f3983 984# Dependencies on the intl and portability libraries.
0b4f4daf 985LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) \
3f425711 986 $(LIBDECNUMBER) $(LIBBACKTRACE)
32e6d418 987
988# Likewise, for use in the tools that must run on this machine
989# even if we are cross-building GCC.
805e22b2 990BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
32e6d418 991
992# How to link with both our special library facilities
993# and the system's installed libraries.
3f425711 994LIBS = @LIBS@ libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBBACKTRACE) \
995 $(LIBIBERTY) $(LIBDECNUMBER) $(HOST_LIBS)
87e20041 996BACKENDLIBS = $(CLOOGLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
832cb92a 997 $(ZLIB)
0ba0ef70 998# Any system libraries needed just for GNAT.
999SYSLIBS = @GNAT_LIBEXC@
1000
75f488d0 1001# Used from ada/gcc-interface/Make-lang.in
f1984c57 1002GNATBIND = @GNATBIND@
1003GNATMAKE = @GNATMAKE@
1004
96b74343 1005# Libs needed (at present) just for jcf-dump.
1006LDEXP_LIB = @LDEXP_LIB@
1007
32e6d418 1008# Likewise, for use in the tools that must run on this machine
1009# even if we are cross-building GCC.
805e22b2 1010BUILD_LIBS = $(BUILD_LIBIBERTY)
32e6d418 1011
664c5888 1012BUILD_RTL = build/rtl.o build/read-rtl.o build/ggc-none.o \
960ebfe7 1013 build/vec.o build/min-insn-modes.o build/gensupport.o \
1014 build/print-rtl.o
664c5888 1015BUILD_MD = build/read-md.o
524a54cf 1016BUILD_ERRORS = build/errors.o
32e6d418 1017
1018# Specify the directories to be searched for header files.
1019# Both . and srcdir are used, in that order,
d826737c 1020# so that *config.h will be found in the compilation
32e6d418 1021# subdirectory rather than in the source directory.
f357ac87 1022# -I$(@D) and -I$(srcdir)/$(@D) cause the subdirectory of the file
1023# currently being compiled, in both source trees, to be examined as well.
1e12d536 1024# libintl.h will be found in ../intl if we are using the included libintl.
f357ac87 1025INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
4ee9c684 1026 -I$(srcdir)/../include @INCINTL@ \
3f425711 1027 $(CPPINC) $(GMPINC) $(DECNUMINC) $(BACKTRACEINC) \
87e20041 1028 $(CLOOGINC) $(ISLINC)
32e6d418 1029
b8bd120b 1030COMPILE.base = $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) -o $@
1031ifeq ($(CCDEPMODE),depmode=gcc3)
1032# Note a subtlety here: we use $(@D) for the directory part, to make
1033# things like the go/%.o rule work properly; but we use $(*F) for the
1034# file part, as we just want the file part of the stem, not the entire
1035# file name.
1036COMPILE = $(COMPILE.base) -MT $@ -MMD -MP -MF $(@D)/$(DEPDIR)/$(*F).TPo
1037POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(*F).TPo $(@D)/$(DEPDIR)/$(*F).Po
1038else
1039COMPILE = source='$<' object='$@' libtool=no \
1040 DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) $(COMPILE.base)
1041POSTCOMPILE =
1042endif
1043
e79e977d 1044.cc.o .c.o:
b8bd120b 1045 $(COMPILE) $<
1046 $(POSTCOMPILE)
32e6d418 1047
2e9d8ccf 1048#\f
966842d4 1049# Support for additional languages (other than C).
1050# C can be supported this way too (leave for later).
73027c94 1051
a455468e 1052LANG_MAKEFRAGS = @all_lang_makefrags@
73027c94 1053
1054# Flags to pass to recursive makes.
e3ca137a 1055# CC is set by configure.
73027c94 1056# ??? The choices here will need some experimenting with.
c8694ccd 1057
1058export AR_FOR_TARGET
1059export AR_CREATE_FOR_TARGET
1060export AR_FLAGS_FOR_TARGET
1061export AR_EXTRACT_FOR_TARGET
1062export AWK
c8694ccd 1063export DESTDIR
1064export GCC_FOR_TARGET
1065export INCLUDES
1066export INSTALL_DATA
9fec3fa8 1067export LIPO_FOR_TARGET
c8694ccd 1068export MACHMODE_H
1069export NM_FOR_TARGET
9fec3fa8 1070export STRIP_FOR_TARGET
c8694ccd 1071export RANLIB_FOR_TARGET
1072export libsubdir
c8694ccd 1073
e3ca137a 1074FLAGS_TO_PASS = \
794723c1 1075 "ADA_CFLAGS=$(ADA_CFLAGS)" \
73027c94 1076 "BISON=$(BISON)" \
1077 "BISONFLAGS=$(BISONFLAGS)" \
b3ff31d3 1078 "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
73027c94 1079 "LDFLAGS=$(LDFLAGS)" \
345a1501 1080 "FLEX=$(FLEX)" \
1081 "FLEXFLAGS=$(FLEXFLAGS)" \
ea4a6c81 1082 "LN=$(LN)" \
1083 "LN_S=$(LN_S)" \
73027c94 1084 "MAKEINFO=$(MAKEINFO)" \
1085 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
e01fe443 1086 "MAKEOVERRIDES=" \
73027c94 1087 "SHELL=$(SHELL)" \
62268150 1088 "exeext=$(exeext)" \
2aa3e87b 1089 "build_exeext=$(build_exeext)" \
62268150 1090 "objext=$(objext)" \
73027c94 1091 "exec_prefix=$(exec_prefix)" \
1092 "prefix=$(prefix)" \
933b38ee 1093 "local_prefix=$(local_prefix)" \
8ffadb5b 1094 "gxx_include_dir=$(gcc_gxx_include_dir)" \
976ceec9 1095 "build_tooldir=$(build_tooldir)" \
40cb25f2 1096 "gcc_tooldir=$(gcc_tooldir)" \
73027c94 1097 "bindir=$(bindir)" \
01922927 1098 "libexecsubdir=$(libexecsubdir)" \
b9de6413 1099 "datarootdir=$(datarootdir)" \
be2828ce 1100 "datadir=$(datadir)" \
be2828ce 1101 "localedir=$(localedir)"
2e9d8ccf 1102#\f
32e6d418 1103# Lists of files for various purposes.
1104
ff05e09e 1105# All option source files
1106ALL_OPT_FILES=$(lang_opt_files) $(extra_opt_files)
1107
8daa9e98 1108# Target specific, C specific object file
1109C_TARGET_OBJS=@c_target_objs@
1110
1111# Target specific, C++ specific object file
1112CXX_TARGET_OBJS=@cxx_target_objs@
1113
32006f36 1114# Target specific, Fortran specific object file
1115FORTRAN_TARGET_OBJS=@fortran_target_objs@
1116
e53d55e7 1117# Object files for gcc many-languages driver.
218e3e4e 1118GCC_OBJS = gcc.o ggc-none.o
a1baa5f1 1119
6b77556b 1120c-family-warn = $(STRICT_WARN)
1121
7bedc3a0 1122# Language-specific object files shared by all C-family front ends.
e53d55e7 1123# FIXME: tree-mudflap is C-family only, but it is also part of the middle-end.
1124# The mudflap machinery should be properly separated from the front ends, and
1125# perhaps turned into a plugin.
7bedc3a0 1126C_COMMON_OBJS = c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o \
1127 c-family/c-format.o c-family/c-gimplify.o c-family/c-lex.o \
1128 c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o \
1129 c-family/c-ppoutput.o c-family/c-pragma.o c-family/c-pretty-print.o \
3c6d4197 1130 c-family/c-semantics.o c-family/c-ada-spec.o tree-mudflap.o \
9e46467d 1131 c-family/array-notation-common.o c-family/c-ubsan.o
6cba4ca3 1132
32e6d418 1133# Language-independent object files.
cfcda0e0 1134# We put the insn-*.o files first so that a parallel make will build
1135# them sooner, because they are large and otherwise tend to be the
1136# last objects to finish building.
aef23a85 1137OBJS = \
cfcda0e0 1138 insn-attrtab.o \
1139 insn-automata.o \
73ed0c67 1140 insn-dfatab.o \
cfcda0e0 1141 insn-emit.o \
1142 insn-extract.o \
73ed0c67 1143 insn-latencytab.o \
cfcda0e0 1144 insn-modes.o \
1145 insn-opinit.o \
1146 insn-output.o \
1147 insn-peep.o \
1148 insn-preds.o \
1149 insn-recog.o \
15f255bd 1150 insn-enums.o \
5cc13354 1151 ggc-page.o \
cfcda0e0 1152 alias.o \
1153 alloc-pool.o \
3072d30e 1154 auto-inc-dec.o \
cfcda0e0 1155 bb-reorder.o \
1156 bitmap.o \
1157 bt-load.o \
1158 builtins.o \
1159 caller-save.o \
1160 calls.o \
1161 cfg.o \
1162 cfganal.o \
1163 cfgbuild.o \
1164 cfgcleanup.o \
1165 cfgexpand.o \
1166 cfghooks.o \
cfcda0e0 1167 cfgloop.o \
1168 cfgloopanal.o \
1169 cfgloopmanip.o \
1170 cfgrtl.o \
0704fb2e 1171 symtab.o \
aef23a85 1172 cgraph.o \
1173 cgraphbuild.o \
1174 cgraphunit.o \
f41db742 1175 cgraphclones.o \
cfcda0e0 1176 combine.o \
e1caca42 1177 combine-stack-adj.o \
a50372fe 1178 compare-elim.o \
8d0badf1 1179 context.o \
cfcda0e0 1180 convert.o \
1181 coverage.o \
aef23a85 1182 cppbuiltin.o \
1183 cppdefault.o \
07abdb66 1184 cprop.o \
cfcda0e0 1185 cse.o \
1186 cselib.o \
2541503d 1187 data-streamer.o \
1188 data-streamer-in.o \
1189 data-streamer-out.o \
cfcda0e0 1190 dbxout.o \
3072d30e 1191 dbgcnt.o \
1192 dce.o \
cfcda0e0 1193 ddg.o \
1194 debug.o \
1195 df-core.o \
1196 df-problems.o \
1197 df-scan.o \
1198 dfp.o \
cfcda0e0 1199 dojump.o \
1200 dominance.o \
1201 domwalk.o \
1202 double-int.o \
3072d30e 1203 dse.o \
7bd765d4 1204 dumpfile.o \
cfcda0e0 1205 dwarf2asm.o \
dcdf448e 1206 dwarf2cfi.o \
cfcda0e0 1207 dwarf2out.o \
1208 emit-rtl.o \
1209 et-forest.o \
1210 except.o \
1211 explow.o \
1212 expmed.o \
1213 expr.o \
1214 final.o \
5efd9b45 1215 fixed-value.o \
cfcda0e0 1216 fold-const.o \
1217 function.o \
1218 fwprop.o \
1219 gcse.o \
cfcda0e0 1220 ggc-common.o \
75a70cf9 1221 gimple.o \
9a4a3348 1222 gimple-builder.o \
75a70cf9 1223 gimple-iterator.o \
2d18b16d 1224 gimple-fold.o \
cfcda0e0 1225 gimple-low.o \
75a70cf9 1226 gimple-pretty-print.o \
4502f5d0 1227 gimple-ssa-strength-reduction.o \
2541503d 1228 gimple-streamer-in.o \
1229 gimple-streamer-out.o \
cfcda0e0 1230 gimplify.o \
929d2a90 1231 godump.o \
cfcda0e0 1232 graph.o \
3f9439d7 1233 graphds.o \
255b6be7 1234 graphite.o \
26c166eb 1235 graphite-blocking.o \
1236 graphite-clast-to-gimple.o \
1237 graphite-dependences.o \
1238 graphite-interchange.o \
89049f25 1239 graphite-optimize-isl.o \
26c166eb 1240 graphite-poly.o \
26c166eb 1241 graphite-scop-detection.o \
1242 graphite-sese-to-poly.o \
cfcda0e0 1243 gtype-desc.o \
1244 haifa-sched.o \
1b727a0a 1245 hw-doloop.o \
b96c136c 1246 hwint.o \
cfcda0e0 1247 ifcvt.o \
1d4227c3 1248 ree.o \
aef23a85 1249 incpath.o \
3072d30e 1250 init-regs.o \
fb049fba 1251 internal-fn.o \
aef23a85 1252 ipa-cp.o \
5514adf9 1253 ipa-devirt.o \
aef23a85 1254 ipa-split.o \
1255 ipa-inline.o \
1256 ipa-inline-analysis.o \
1257 ipa-inline-transform.o \
6eaf903b 1258 ipa-profile.o \
aef23a85 1259 ipa-prop.o \
1260 ipa-pure-const.o \
1261 ipa-reference.o \
1262 ipa-ref.o \
1263 ipa-utils.o \
1264 ipa.o \
47dd2e78 1265 ira.o \
1266 ira-build.o \
1267 ira-costs.o \
1268 ira-conflicts.o \
1269 ira-color.o \
1270 ira-emit.o \
1271 ira-lives.o \
cfcda0e0 1272 jump.o \
cfcda0e0 1273 langhooks.o \
1274 lcm.o \
1275 lists.o \
cfcda0e0 1276 loop-doloop.o \
1277 loop-init.o \
1278 loop-invariant.o \
1279 loop-iv.o \
1280 loop-unroll.o \
1281 loop-unswitch.o \
1a6a0f2a 1282 lower-subreg.o \
c6a6cdaa 1283 lra.o \
1284 lra-assigns.o \
1285 lra-coalesce.o \
1286 lra-constraints.o \
1287 lra-eliminations.o \
1288 lra-lives.o \
1289 lra-spills.o \
7bfefa9d 1290 lto-cgraph.o \
2541503d 1291 lto-streamer.o \
7bfefa9d 1292 lto-streamer-in.o \
1293 lto-streamer-out.o \
1294 lto-section-in.o \
1295 lto-section-out.o \
7bfefa9d 1296 lto-opts.o \
7bfefa9d 1297 lto-compress.o \
e0dc6f2b 1298 mcf.o \
cfcda0e0 1299 mode-switching.o \
1300 modulo-sched.o \
355572cc 1301 omega.o \
cfcda0e0 1302 omp-low.o \
1303 optabs.o \
0bfbe373 1304 options-save.o \
f0da0668 1305 opts-global.o \
cfcda0e0 1306 passes.o \
9227b6fc 1307 plugin.o \
cfcda0e0 1308 pointer-set.o \
1309 postreload-gcse.o \
1310 postreload.o \
1311 predict.o \
cfcda0e0 1312 print-rtl.o \
1313 print-tree.o \
1314 profile.o \
1315 real.o \
dae0b5cb 1316 realmpfr.o \
cfcda0e0 1317 recog.o \
1318 reg-stack.o \
2d4749b6 1319 regcprop.o \
cf709bf6 1320 reginfo.o \
cfcda0e0 1321 regmove.o \
1322 regrename.o \
3072d30e 1323 regstat.o \
cfcda0e0 1324 reload.o \
1325 reload1.o \
1326 reorg.o \
1327 resource.o \
1328 rtl-error.o \
cfcda0e0 1329 rtl.o \
1330 rtlanal.o \
1331 rtlhooks.o \
1332 sbitmap.o \
1333 sched-deps.o \
1334 sched-ebb.o \
1335 sched-rgn.o \
1336 sched-vis.o \
1337 sdbout.o \
e1ab7874 1338 sel-sched-ir.o \
1339 sel-sched-dump.o \
1340 sel-sched.o \
26c166eb 1341 sese.o \
cfcda0e0 1342 simplify-rtx.o \
981db194 1343 sparseset.o \
cfcda0e0 1344 sreal.o \
3072d30e 1345 stack-ptr-mod.o \
9659d177 1346 statistics.o \
cfcda0e0 1347 stmt.o \
1348 stor-layout.o \
4b673aa1 1349 store-motion.o \
2541503d 1350 streamer-hooks.o \
cfcda0e0 1351 stringpool.o \
821d4118 1352 target-globals.o \
cfcda0e0 1353 targhooks.o \
1354 timevar.o \
1355 toplev.o \
1356 tracer.o \
4c0315d0 1357 trans-mem.o \
cfcda0e0 1358 tree-affine.o \
b92cccf4 1359 asan.o \
b077695d 1360 tsan.o \
9e46467d 1361 ubsan.o \
e6a23add 1362 tree-call-cdce.o \
cfcda0e0 1363 tree-cfg.o \
1364 tree-cfgcleanup.o \
1365 tree-chrec.o \
1366 tree-complex.o \
1367 tree-data-ref.o \
1368 tree-dfa.o \
ce084dfc 1369 tree-diagnostic.o \
cfcda0e0 1370 tree-dump.o \
1371 tree-eh.o \
cffbbb9d 1372 tree-emutls.o \
cfcda0e0 1373 tree-if-conv.o \
aef23a85 1374 tree-inline.o \
cfcda0e0 1375 tree-into-ssa.o \
1376 tree-iterator.o \
801c5610 1377 tree-loop-distribution.o \
cfcda0e0 1378 tree-nested.o \
aef23a85 1379 tree-nomudflap.o \
cfcda0e0 1380 tree-nrv.o \
1381 tree-object-size.o \
1382 tree-optimize.o \
1383 tree-outof-ssa.o \
28c92cbb 1384 tree-parloops.o \
cfcda0e0 1385 tree-phinodes.o \
ad4a85ad 1386 tree-predcom.o \
cfcda0e0 1387 tree-pretty-print.o \
1388 tree-profile.o \
1389 tree-scalar-evolution.o \
1390 tree-sra.o \
a347af29 1391 tree-switch-conversion.o \
cfcda0e0 1392 tree-ssa-address.o \
1393 tree-ssa-alias.o \
1394 tree-ssa-ccp.o \
1395 tree-ssa-coalesce.o \
1396 tree-ssa-copy.o \
1397 tree-ssa-copyrename.o \
1398 tree-ssa-dce.o \
1399 tree-ssa-dom.o \
1400 tree-ssa-dse.o \
1401 tree-ssa-forwprop.o \
8530c7be 1402 tree-ssa-ifcombine.o \
cfcda0e0 1403 tree-ssa-live.o \
1404 tree-ssa-loop-ch.o \
1405 tree-ssa-loop-im.o \
1406 tree-ssa-loop-ivcanon.o \
1407 tree-ssa-loop-ivopts.o \
1408 tree-ssa-loop-manip.o \
1409 tree-ssa-loop-niter.o \
1410 tree-ssa-loop-prefetch.o \
1411 tree-ssa-loop-unswitch.o \
1412 tree-ssa-loop.o \
1413 tree-ssa-math-opts.o \
1414 tree-ssa-operands.o \
1415 tree-ssa-phiopt.o \
a2fd87ad 1416 tree-ssa-phiprop.o \
cfcda0e0 1417 tree-ssa-pre.o \
1418 tree-ssa-propagate.o \
1419 tree-ssa-reassoc.o \
9e9e6e3e 1420 tree-ssa-sccvn.o \
cfcda0e0 1421 tree-ssa-sink.o \
9efe50a4 1422 tree-ssa-strlen.o \
cfcda0e0 1423 tree-ssa-structalias.o \
51385f30 1424 tree-ssa-tail-merge.o \
cfcda0e0 1425 tree-ssa-ter.o \
1426 tree-ssa-threadedge.o \
1427 tree-ssa-threadupdate.o \
1428 tree-ssa-uncprop.o \
a7d4604b 1429 tree-ssa-uninit.o \
cfcda0e0 1430 tree-ssa.o \
1431 tree-ssanames.o \
1432 tree-stdarg.o \
2541503d 1433 tree-streamer.o \
1434 tree-streamer-in.o \
1435 tree-streamer-out.o \
cfcda0e0 1436 tree-tailcall.o \
cfcda0e0 1437 tree-vect-generic.o \
1438 tree-vect-patterns.o \
aef23a85 1439 tree-vect-data-refs.o \
1440 tree-vect-stmts.o \
1441 tree-vect-loop.o \
1442 tree-vect-loop-manip.o \
1443 tree-vect-slp.o \
cfcda0e0 1444 tree-vectorizer.o \
cfcda0e0 1445 tree-vrp.o \
1446 tree.o \
e6637753 1447 valtrack.o \
cfcda0e0 1448 value-prof.o \
1449 var-tracking.o \
1450 varasm.o \
aef23a85 1451 varpool.o \
cfcda0e0 1452 vmsdbgout.o \
b710ec85 1453 vtable-verify.o \
cfcda0e0 1454 web.o \
aef23a85 1455 xcoffout.o \
1456 $(out_object_file) \
cfcda0e0 1457 $(EXTRA_OBJS) \
aef23a85 1458 $(host_hook_obj)
40109983 1459
0b4f4daf 1460# Objects in libcommon.a, potentially used by all host binaries and with
1461# no target dependencies.
41609f8b 1462OBJS-libcommon = diagnostic.o diagnostic-color.o pretty-print.o intl.o input.o version.o
0b4f4daf 1463
eb65953e 1464# Objects in libcommon-target.a, used by drivers and by the core
1465# compiler and containing target-dependent code.
6a2fc14e 1466OBJS-libcommon-target = $(common_out_object_file) prefix.o params.o \
2b15d2ba 1467 opts.o opts-common.o options.o vec.o hooks.o common/common-targhooks.o \
cdd7a5a4 1468 hash-table.o file-find.o
eb65953e 1469
141acd01 1470# This lists all host objects for the front ends.
e53d55e7 1471ALL_HOST_FRONTEND_OBJS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS))
141acd01 1472
0b4f4daf 1473ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) $(OBJS-libcommon) \
e53d55e7 1474 $(OBJS-libcommon-target) @TREEBROWSER@ main.o c-family/cppspec.o \
ea38f4be 1475 $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) $(GCOV_OBJS) $(GCOV_DUMP_OBJS) \
1476 lto-wrapper.o
6fb2153a 1477
141acd01 1478# This lists all host object files, whether they are included in this
1479# compilation or not.
1480ALL_HOST_OBJS = $(ALL_HOST_FRONTEND_OBJS) $(ALL_HOST_BACKEND_OBJS)
1481
73ed0c67 1482BACKEND = libbackend.a main.o @TREEBROWSER@ libcommon-target.a libcommon.a \
eb65953e 1483 $(CPPLIB) $(LIBDECNUMBER)
0f221fb7 1484
1410e798 1485# This is defined to "yes" if Tree checking is enabled, which roughly means
1486# front-end checking.
1487TREECHECKING = @TREECHECKING@
1488
e3ca137a 1489MOSTLYCLEANFILES = insn-flags.h insn-config.h insn-codes.h \
32e6d418 1490 insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
73ed0c67 1491 insn-attr.h insn-attr-common.h insn-attrtab.c insn-dfatab.c \
ee65118b 1492 insn-latencytab.c insn-opinit.c insn-opinit.h insn-preds.c insn-constants.h \
18cfeada 1493 tm-preds.h tm-constrs.h checksum-options \
af908c02 1494 tree-check.h min-insn-modes.c insn-modes.c insn-modes.h \
b6762859 1495 genrtl.h gt-*.h gtype-*.h gtype-desc.c gtyp-input.list \
e53d55e7 1496 xgcc$(exeext) cpp$(exeext) \
237490bf 1497 $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
46215dc9 1498 $(SPECS) collect2$(exeext) gcc-ar$(exeext) gcc-nm$(exeext) \
1499 gcc-ranlib$(exeext) \
805e22b2 1500 gcov-iov$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \
6d70c713 1501 gengtype$(exeext) *.[0-9][0-9].* *.[si] *-checksum.c libbackend.a \
1502 libcommon-target.a libcommon.a libgcc.mk
32e6d418 1503
2e9d8ccf 1504#\f
73027c94 1505# Language makefile fragments.
1506
1507# The following targets define the interface between us and the languages.
1508#
0fc07c25 1509# all.cross, start.encap, rest.encap,
ae6555f9 1510# install-common, install-info, install-man,
98fb2ff8 1511# uninstall,
80e909c6 1512# mostlyclean, clean, distclean, maintainer-clean,
73027c94 1513#
d5cd09c5 1514# Each language is linked in with a series of hooks. The name of each
1515# hooked is "lang.${target_name}" (eg: lang.info). Configure computes
1516# and adds these here. We use double-colon rules for some of the hooks;
1517# double-colon rules should be preferred for any new hooks.
73027c94 1518
a455468e 1519# language hooks, generated by configure
87c0ad1b 1520@language_hooks@
73027c94 1521
a455468e 1522# per-language makefile fragments
1523ifneq ($(LANG_MAKEFRAGS),)
1524include $(LANG_MAKEFRAGS)
1525endif
73027c94 1526
e0fa47cd 1527# target and host overrides must follow the per-language makefile fragments
1528# so they can override or augment language-specific variables
1529
1530# target overrides
1531ifneq ($(tmake_file),)
1532include $(tmake_file)
1533endif
1534
1535# host overrides
1536ifneq ($(xmake_file),)
1537include $(xmake_file)
1538endif
1539
e014fc6a 1540# all-tree.def includes all the tree.def files.
1541all-tree.def: s-alltree; @true
1542s-alltree: Makefile
1543 rm -f tmp-all-tree.def
1544 echo '#include "tree.def"' > tmp-all-tree.def
1545 echo 'END_OF_BASE_TREE_CODES' >> tmp-all-tree.def
7bedc3a0 1546 echo '#include "c-family/c-common.def"' >> tmp-all-tree.def
e014fc6a 1547 ltf="$(lang_tree_files)"; for f in $$ltf; do \
1548 echo "#include \"$$f\""; \
1549 done | sed 's|$(srcdir)/||' >> tmp-all-tree.def
1550 $(SHELL) $(srcdir)/../move-if-change tmp-all-tree.def all-tree.def
1551 $(STAMP) s-alltree
1552
141acd01 1553# Now that LANG_MAKEFRAGS are included, we can add special flags to the
1554# objects that belong to the front ends. We add an extra define that
1555# causes back-end specific include files to be poisoned, in the hope that
1556# we can avoid introducing dependencies of the front ends on things that
1557# no front end should ever look at (e.g. everything RTL related).
1558$(foreach file,$(ALL_HOST_FRONTEND_OBJS),$(eval CFLAGS-$(file) += -DIN_GCC_FRONTEND))
1559
2e9d8ccf 1560#\f
32e6d418 1561
966842d4 1562# -----------------------------
1563# Rebuilding this configuration
1564# -----------------------------
1565
58e540b8 1566# On the use of stamps:
1567# Consider the example of tree-check.h. It is constructed with build/gencheck.
1568# A simple rule to build tree-check.h would be
1569# tree-check.h: build/gencheck$(build_exeext)
1570# $(RUN_GEN) build/gencheck$(build_exeext) > tree-check.h
1571#
1572# but tree-check.h doesn't change every time gencheck changes. It would the
21886706 1573# nice if targets that depend on tree-check.h wouldn't be rebuild
58e540b8 1574# unnecessarily when tree-check.h is unchanged. To make this, tree-check.h
1575# must not be overwritten with a identical copy. One solution is to use a
1576# temporary file
1577# tree-check.h: build/gencheck$(build_exeext)
f0ecf45a 1578# $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h
58e540b8 1579# $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h
1580#
1581# This solution has a different problem. Since the time stamp of tree-check.h
1582# is unchanged, make will try to update tree-check.h every time it runs.
1583# To prevent this, one can add a stamp
1584# tree-check.h: s-check
1585# s-check : build/gencheck$(build_exeext)
f0ecf45a 1586# $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h
58e540b8 1587# $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h
1588# $(STAMP) s-check
1589#
1590# The problem with this solution is that make thinks that tree-check.h is
1591# always unchanged. Make must be deceived into thinking that tree-check.h is
f0ecf45a 1592# rebuild by the "tree-check.h: s-check" rule. To do this, add a dummy command:
58e540b8 1593# tree-check.h: s-check; @true
1594# s-check : build/gencheck$(build_exeext)
f0ecf45a 1595# $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h
58e540b8 1596# $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h
1597# $(STAMP) s-check
1598#
1599# This is what is done in this makefile. Note that mkconfig.sh has a
1600# move-if-change built-in
1601
1af67e62 1602Makefile: config.status $(srcdir)/Makefile.in $(LANG_MAKEFRAGS)
a455468e 1603 LANGUAGES="$(CONFIG_LANGUAGES)" \
1604 CONFIG_HEADERS= \
3a6fbbb0 1605 CONFIG_SHELL="$(SHELL)" \
a455468e 1606 CONFIG_FILES=$@ $(SHELL) config.status
32e6d418 1607
83b8e55b 1608config.h: cs-config.h ; @true
805e22b2 1609bconfig.h: cs-bconfig.h ; @true
83b8e55b 1610tconfig.h: cs-tconfig.h ; @true
805e22b2 1611tm.h: cs-tm.h ; @true
83b8e55b 1612tm_p.h: cs-tm_p.h ; @true
1613
1614cs-config.h: Makefile
805e22b2 1615 TARGET_CPU_DEFAULT="" \
4dcab8b7 1616 HEADERS="$(host_xm_include_list)" DEFINES="$(host_xm_defines)" \
83b8e55b 1617 $(SHELL) $(srcdir)/mkconfig.sh config.h
1618
805e22b2 1619cs-bconfig.h: Makefile
1620 TARGET_CPU_DEFAULT="" \
4dcab8b7 1621 HEADERS="$(build_xm_include_list)" DEFINES="$(build_xm_defines)" \
805e22b2 1622 $(SHELL) $(srcdir)/mkconfig.sh bconfig.h
83b8e55b 1623
a1a7e9d5 1624cs-tconfig.h: Makefile
8b24e546 1625 TARGET_CPU_DEFAULT="" \
fcd42b1e 1626 HEADERS="$(xm_include_list)" DEFINES="USED_FOR_TARGET $(xm_defines)" \
83b8e55b 1627 $(SHELL) $(srcdir)/mkconfig.sh tconfig.h
1628
805e22b2 1629cs-tm.h: Makefile
1630 TARGET_CPU_DEFAULT="$(target_cpu_default)" \
4dcab8b7 1631 HEADERS="$(tm_include_list)" DEFINES="$(tm_defines)" \
805e22b2 1632 $(SHELL) $(srcdir)/mkconfig.sh tm.h
1633
83b8e55b 1634cs-tm_p.h: Makefile
805e22b2 1635 TARGET_CPU_DEFAULT="" \
4dcab8b7 1636 HEADERS="$(tm_p_include_list)" DEFINES="" \
83b8e55b 1637 $(SHELL) $(srcdir)/mkconfig.sh tm_p.h
1638
c0450c4b 1639# Don't automatically run autoconf, since configure.ac might be accidentally
67afd3f0 1640# newer than configure. Also, this writes into the source directory which
1641# might be on a read-only file system. If configured for maintainer mode
1642# then do allow autoconf to be run.
1643
a2655af1 1644AUTOCONF = autoconf
1645ACLOCAL = aclocal
1646ACLOCAL_AMFLAGS = -I ../config -I ..
1647aclocal_deps = \
1648 $(srcdir)/../libtool.m4 \
1649 $(srcdir)/../ltoptions.m4 \
1650 $(srcdir)/../ltsugar.m4 \
1651 $(srcdir)/../ltversion.m4 \
1652 $(srcdir)/../lt~obsolete.m4 \
1653 $(srcdir)/../config/acx.m4 \
1654 $(srcdir)/../config/codeset.m4 \
1655 $(srcdir)/../config/extensions.m4 \
1656 $(srcdir)/../config/gettext-sister.m4 \
1657 $(srcdir)/../config/iconv.m4 \
1658 $(srcdir)/../config/lcmessage.m4 \
1659 $(srcdir)/../config/lib-ld.m4 \
1660 $(srcdir)/../config/lib-link.m4 \
1661 $(srcdir)/../config/lib-prefix.m4 \
1662 $(srcdir)/../config/override.m4 \
1663 $(srcdir)/../config/progtest.m4 \
82e964b0 1664 $(srcdir)/../config/stdint.m4 \
a2655af1 1665 $(srcdir)/../config/unwind_ipinfo.m4 \
1666 $(srcdir)/../config/warnings.m4 \
23340821 1667 $(srcdir)/../config/dfp.m4 \
749dea2a 1668 $(srcdir)/../config/mmap.m4 \
a2655af1 1669 $(srcdir)/acinclude.m4
1670
1671$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/aclocal.m4
1672 (cd $(srcdir) && $(AUTOCONF))
1673
1674$(srcdir)/aclocal.m4 : @MAINT@ $(aclocal_deps)
1675 (cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS))
87c0ad1b 1676
0d9d9ae4 1677# cstamp-h.in controls rebuilding of config.in.
d44645af 1678# It is named cstamp-h.in and not stamp-h.in so the mostlyclean rule doesn't
1679# delete it. A stamp file is needed as autoheader won't update the file if
1680# nothing has changed.
0d9d9ae4 1681# It remains in the source directory and is part of the distribution.
1682# This follows what is done in shellutils, fileutils, etc.
c3b8daa3 1683# "echo timestamp" is used instead of touch to be consistent with other
1684# packages that use autoconf (??? perhaps also to avoid problems with patch?).
0d9d9ae4 1685# ??? Newer versions have a maintainer mode that may be useful here.
67afd3f0 1686
1687# Don't run autoheader automatically either.
1688# Only run it if maintainer mode is enabled.
a2655af1 1689@MAINT@ AUTOHEADER = autoheader
67afd3f0 1690@MAINT@ $(srcdir)/config.in: $(srcdir)/cstamp-h.in
c0450c4b 1691@MAINT@ $(srcdir)/cstamp-h.in: $(srcdir)/configure.ac
a2655af1 1692@MAINT@ (cd $(srcdir) && $(AUTOHEADER))
67afd3f0 1693@MAINT@ @rm -f $(srcdir)/cstamp-h.in
1694@MAINT@ echo timestamp > $(srcdir)/cstamp-h.in
764fc592 1695auto-host.h: cstamp-h ; @true
0d9d9ae4 1696cstamp-h: config.in config.status
a455468e 1697 CONFIG_HEADERS=auto-host.h:config.in \
1698 CONFIG_FILES= \
1699 LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status
5539b206 1700
d44645af 1701# Really, really stupid make features, such as SUN's KEEP_STATE, may force
1702# a target to build even if it is up-to-date. So we must verify that
1703# config.status does not exist before failing.
1af67e62 1704config.status: $(srcdir)/configure $(srcdir)/config.gcc
d44645af 1705 @if [ ! -f config.status ] ; then \
98fb2ff8 1706 echo You must configure gcc. Look at http://gcc.gnu.org/install/ for details.; \
d44645af 1707 false; \
1708 else \
76103b2c 1709 LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status --recheck; \
d44645af 1710 fi
1711
966842d4 1712# --------
1713# UNSORTED
1714# --------
1715
c7cc973b 1716# Provide quickstrap as a target that people can type into the gcc directory,
1717# and that fails if you're not into it.
1718quickstrap: all
1719 cd $(toplevel_builddir) && $(MAKE) all-target-libgcc
1720
bfcba12d 1721all.internal: start.encap rest.encap doc
32e6d418 1722# This is what to compile if making a cross-compiler.
a01acf14 1723all.cross: native gcc-cross$(exeext) cpp$(exeext) specs \
894a47b4 1724 libgcc-support lang.all.cross doc @GENINSRC@ srcextra
32e6d418 1725# This is what must be made before installing GCC and converting libraries.
dd6a91ba 1726start.encap: native xgcc$(exeext) cpp$(exeext) specs \
6ea4242f 1727 libgcc-support lang.start.encap @GENINSRC@ srcextra
335ebf8f 1728# These can't be made until after GCC can run.
f2397fc4 1729rest.encap: lang.rest.encap
32e6d418 1730# This is what is made with the host's compiler
1731# whether making a cross compiler or not.
1e12d536 1732native: config.status auto-host.h build-@POSUB@ $(LANGUAGES) \
7151decb 1733 $(EXTRA_PROGRAMS) $(COLLECT2) lto-wrapper$(exeext) \
46215dc9 1734 gcc-ar$(exeext) gcc-nm$(exeext) gcc-ranlib$(exeext)
32e6d418 1735
6d70c713 1736ifeq ($(enable_plugin),yes)
1737native: gengtype$(exeext)
1738endif
1739
840a6e8d 1740# On the target machine, finish building a cross compiler.
1741# This does the things that can't be done on the host machine.
894a47b4 1742rest.cross: specs
840a6e8d 1743
840a6e8d 1744# Recompile all the language-independent object files.
1745# This is used only if the user explicitly asks for it.
0f221fb7 1746compilations: $(BACKEND)
32e6d418 1747
d856c8a6 1748# This archive is strictly for the host.
66548868 1749libbackend.a: $(OBJS)
0f221fb7 1750 -rm -rf libbackend.a
66548868 1751 $(AR) $(AR_FLAGS) libbackend.a $(OBJS)
72318bfa 1752 -$(RANLIB) $(RANLIB_FLAGS) libbackend.a
03f51dea 1753
eb65953e 1754libcommon-target.a: $(OBJS-libcommon-target)
1755 -rm -rf libcommon-target.a
1756 $(AR) $(AR_FLAGS) libcommon-target.a $(OBJS-libcommon-target)
1757 -$(RANLIB) $(RANLIB_FLAGS) libcommon-target.a
1758
0b4f4daf 1759libcommon.a: $(OBJS-libcommon)
1760 -rm -rf libcommon.a
1761 $(AR) $(AR_FLAGS) libcommon.a $(OBJS-libcommon)
1762 -$(RANLIB) $(RANLIB_FLAGS) libcommon.a
1763
77a164d8 1764# We call this executable `xgcc' rather than `gcc'
1765# to avoid confusion if the current directory is in the path
1766# and CC is `gcc'. It is renamed to `gcc' when it is installed.
e53d55e7 1767xgcc$(exeext): $(GCC_OBJS) c/gccspec.o libcommon-target.a $(LIBDEPS) \
eb65953e 1768 $(EXTRA_GCC_OBJS)
70293f47 1769 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
e53d55e7 1770 c/gccspec.o $(EXTRA_GCC_OBJS) libcommon-target.a \
76fd9e61 1771 $(EXTRA_GCC_LIBS) $(LIBS)
840a6e8d 1772
e53d55e7 1773# cpp is to cpp0 as e.g. g++ is to cc1plus: Just another driver.
1774# It is part of c-family because the handled extensions are hard-coded
1775# and only contain c-family extensions (see known_suffixes).
1776cpp$(exeext): $(GCC_OBJS) c-family/cppspec.o libcommon-target.a $(LIBDEPS) \
eb65953e 1777 $(EXTRA_GCC_OBJS)
70293f47 1778 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
e53d55e7 1779 c-family/cppspec.o $(EXTRA_GCC_OBJS) libcommon-target.a \
76fd9e61 1780 $(EXTRA_GCC_LIBS) $(LIBS)
28c11b39 1781
840a6e8d 1782# Dump a specs file to make -B./ read these specs over installed ones.
d0faeb9d 1783$(SPECS): xgcc$(exeext)
c92e16d4 1784 $(GCC_FOR_TARGET) -dumpspecs > tmp-specs
d0faeb9d 1785 mv tmp-specs $(SPECS)
32e6d418 1786
77a164d8 1787# We do want to create an executable named `xgcc', so we can use it to
32e6d418 1788# compile libgcc2.a.
1789# Also create gcc-cross, so that install-common will install properly.
a01acf14 1790gcc-cross$(exeext): xgcc$(exeext)
62268150 1791 cp xgcc$(exeext) gcc-cross$(exeext)
32e6d418 1792
18cfeada 1793checksum-options:
1794 echo "$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS)" > checksum-options.tmp \
1795 && $(srcdir)/../move-if-change checksum-options.tmp checksum-options
21886706 1796
2e9d8ccf 1797#\f
32e6d418 1798# Build libgcc.a.
a20b21eb 1799
f2397fc4 1800libgcc-support: libgcc.mvars stmp-int-hdrs $(TCONFIG_H) \
4dc4ff49 1801 $(MACHMODE_H) gcov-iov.h
894a47b4 1802
4dc4ff49 1803libgcc.mvars: config.status Makefile specs xgcc$(exeext)
894a47b4 1804 : > tmp-libgcc.mvars
237490bf 1805 echo GCC_CFLAGS = '$(GCC_CFLAGS)' >> tmp-libgcc.mvars
1806 echo INHIBIT_LIBC_CFLAGS = '$(INHIBIT_LIBC_CFLAGS)' >> tmp-libgcc.mvars
5b69e2e1 1807 echo TARGET_SYSTEM_ROOT = '$(TARGET_SYSTEM_ROOT)' >> tmp-libgcc.mvars
894a47b4 1808
1809 mv tmp-libgcc.mvars libgcc.mvars
32e6d418 1810
f1ad3130 1811# Use the genmultilib shell script to generate the information the gcc
1812# driver program needs to select the library directory based on the
1813# switches.
997d68fe 1814multilib.h: s-mlib; @true
1815s-mlib: $(srcdir)/genmultilib Makefile
a2770a85 1816 if test @enable_multilib@ = yes \
1817 || test -n "$(MULTILIB_OSDIRNAMES)"; then \
7a94134d 1818 $(SHELL) $(srcdir)/genmultilib \
1819 "$(MULTILIB_OPTIONS)" \
1820 "$(MULTILIB_DIRNAMES)" \
1821 "$(MULTILIB_MATCHES)" \
1822 "$(MULTILIB_EXCEPTIONS)" \
1823 "$(MULTILIB_EXTRA_OPTS)" \
1824 "$(MULTILIB_EXCLUSIONS)" \
c954ff02 1825 "$(MULTILIB_OSDIRNAMES)" \
cec45616 1826 "$(MULTILIB_REQUIRED)" \
77adc39e 1827 "$(MULTIARCH_DIRNAME)" \
7137cdac 1828 "$(MULTILIB_REUSE)" \
a2770a85 1829 "@enable_multilib@" \
7a94134d 1830 > tmp-mlib.h; \
1831 else \
7137cdac 1832 $(SHELL) $(srcdir)/genmultilib '' '' '' '' '' '' '' '' \
1833 "$(MULTIARCH_DIRNAME)" '' no \
a2770a85 1834 > tmp-mlib.h; \
7a94134d 1835 fi
ed90d522 1836 $(SHELL) $(srcdir)/../move-if-change tmp-mlib.h multilib.h
5ec97d31 1837 $(STAMP) s-mlib
2e9d8ccf 1838#\f
32e6d418 1839# Compiling object files from source files.
1840
21886706 1841# Note that dependencies on obstack.h are not written
1842# because that file is not part of GCC.
1843
6bc11008 1844srcextra: gcc.srcextra lang.srcextra
1845
1e837561 1846gcc.srcextra: gengtype-lex.c
a6b4c5a9 1847 -cp -p $^ $(srcdir)
1848
cdd7a5a4 1849AR_OBJS = file-find.o
46215dc9 1850AR_LIBS = @COLLECT2_LIBS@
1851
cdd7a5a4 1852gcc-ar$(exeext): gcc-ar.o $(AR_OBJS) $(LIBDEPS)
46215dc9 1853 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) gcc-ar.o -o $@ \
cdd7a5a4 1854 $(AR_OBJS) $(LIBS) $(AR_LIBS)
46215dc9 1855
cdd7a5a4 1856gcc-nm$(exeext): gcc-nm.o $(AR_OBJS) $(LIBDEPS)
46215dc9 1857 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) gcc-nm.o -o $@ \
cdd7a5a4 1858 $(AR_OBJS) $(LIBS) $(AR_LIBS)
46215dc9 1859
cdd7a5a4 1860gcc-ranlib$(exeext): gcc-ranlib.o $(AR_OBJS) $(LIBDEPS)
46215dc9 1861 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) gcc-ranlib.o -o $@ \
cdd7a5a4 1862 $(AR_OBJS) $(LIBS) $(AR_LIBS)
46215dc9 1863
1864CFLAGS-gcc-ar.o += $(DRIVER_DEFINES) \
1865 -DTARGET_MACHINE=\"$(target_noncanonical)\" \
1866 @TARGET_SYSTEM_ROOT_DEFINE@ -DPERSONALITY=\"ar\"
1867
46215dc9 1868CFLAGS-gcc-ranlib.o += $(DRIVER_DEFINES) \
1869 -DTARGET_MACHINE=\"$(target_noncanonical)\" \
1870 @TARGET_SYSTEM_ROOT_DEFINE@ -DPERSONALITY=\"ranlib\"
1871
46215dc9 1872CFLAGS-gcc-nm.o += $(DRIVER_DEFINES) \
1873 -DTARGET_MACHINE=\"$(target_noncanonical)\" \
1874 @TARGET_SYSTEM_ROOT_DEFINE@ -DPERSONALITY=\"nm\"
1875
46215dc9 1876# ??? the implicit rules dont trigger if the source file has a different name
1877# so copy instead
1878gcc-ranlib.c: gcc-ar.c
1879 cp $^ $@
1880
1881gcc-nm.c: gcc-ar.c
1882 cp $^ $@
1883
cdd7a5a4 1884COLLECT2_OBJS = collect2.o collect2-aix.o tlink.o vec.o ggc-none.o file-find.o
45449d9f 1885COLLECT2_LIBS = @COLLECT2_LIBS@
67ce0331 1886collect2$(exeext): $(COLLECT2_OBJS) $(LIBDEPS)
e77fd588 1887# Don't try modifying collect2 (aka ld) in place--it might be linking this.
70293f47 1888 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o T$@ \
45449d9f 1889 $(COLLECT2_OBJS) $(LIBS) $(COLLECT2_LIBS)
8e920924 1890 mv -f T$@ $@
32e6d418 1891
fc3bd902 1892CFLAGS-collect2.o += -DTARGET_MACHINE=\"$(target_noncanonical)\" \
1893 @TARGET_SYSTEM_ROOT_DEFINE@
21886706 1894
00d389c8 1895lto-wrapper$(exeext): lto-wrapper.o ggc-none.o libcommon-target.a $(LIBDEPS)
1896 +$(LINKER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o T$@ \
1897 lto-wrapper.o ggc-none.o libcommon-target.a $(LIBS)
7bfefa9d 1898 mv -f T$@ $@
1899
e53d55e7 1900# Files used by all variants of C or by the stand-alone pre-processor.
7bedc3a0 1901
fc3bd902 1902CFLAGS-c-family/c-opts.o += @TARGET_SYSTEM_ROOT_DEFINE@
21886706 1903
fc3bd902 1904CFLAGS-c-family/c-pch.o += -DHOST_MACHINE=\"$(host)\" \
1905 -DTARGET_MACHINE=\"$(target)\"
c0b4078e 1906
c1485012 1907default-c.o: config/default-c.c
1908 $(COMPILE) $<
1909 $(POSTCOMPILE)
21886706 1910
7bedc3a0 1911# Files used by all variants of C and some other languages.
1912
fc3bd902 1913CFLAGS-prefix.o += -DPREFIX=\"$(prefix)\" -DBASEVER=$(BASEVER_s)
32e6d418 1914
21886706 1915# Language-independent files.
277b05bb 1916
4813bdd4 1917DRIVER_DEFINES = \
b155ba2f 1918 -DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \
9db45a87 1919 -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
1920 -DSTANDARD_LIBEXEC_PREFIX=\"$(libexecdir)/gcc/\" \
7df9e578 1921 -DDEFAULT_TARGET_VERSION=\"$(version)\" \
d58156a1 1922 -DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\" \
b155ba2f 1923 -DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \
fc5f9e0c 1924 -DTOOLDIR_BASE_PREFIX=\"$(libsubdir_to_prefix)$(prefix_to_exec_prefix)\" \
805e22b2 1925 @TARGET_SYSTEM_ROOT_DEFINE@ \
0fa54ff1 1926 $(VALGRIND_DRIVER_DEFINES) \
396044e4 1927 $(if $(SHLIB),$(if $(filter yes,@enable_shared@),-DENABLE_SHARED_LIBGCC)) \
a24a71cc 1928 -DCONFIGURE_SPECS="\"@CONFIGURE_SPECS@\""
21886706 1929
c1485012 1930CFLAGS-gcc.o += $(DRIVER_DEFINES)
21886706 1931
a1a7e9d5 1932specs.h : s-specs ; @true
1933s-specs : Makefile
108251d9 1934 lsf="$(lang_specs_files)"; for f in $$lsf; do \
1935 echo "#include \"$$f\""; \
a1a7e9d5 1936 done | sed 's|$(srcdir)/||' > tmp-specs.h
ed90d522 1937 $(SHELL) $(srcdir)/../move-if-change tmp-specs.h specs.h
a1a7e9d5 1938 $(STAMP) s-specs
1939
e8b212b8 1940optionlist: s-options ; @true
ff05e09e 1941s-options: $(ALL_OPT_FILES) Makefile $(srcdir)/opt-gather.awk
1942 $(AWK) -f $(srcdir)/opt-gather.awk $(ALL_OPT_FILES) > tmp-optionlist
e8b212b8 1943 $(SHELL) $(srcdir)/../move-if-change tmp-optionlist optionlist
0e6605c4 1944 $(STAMP) s-options
1945
1e127302 1946options.c: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opt-read.awk \
1947 $(srcdir)/optc-gen.awk
1948 $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/opt-read.awk \
1949 -f $(srcdir)/optc-gen.awk \
abe01860 1950 -v header_name="config.h system.h coretypes.h options.h tm.h" < $< > $@
e8b212b8 1951
0bfbe373 1952options-save.c: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opt-read.awk \
1953 $(srcdir)/optc-save-gen.awk
1954 $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/opt-read.awk \
1955 -f $(srcdir)/optc-save-gen.awk \
1956 -v header_name="config.h system.h coretypes.h tm.h" < $< > $@
1957
ff05e09e 1958options.h: s-options-h ; @true
1e127302 1959s-options-h: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opt-read.awk \
1960 $(srcdir)/opth-gen.awk
1961 $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/opt-read.awk \
1962 -f $(srcdir)/opth-gen.awk \
ff05e09e 1963 < $< > tmp-options.h
1964 $(SHELL) $(srcdir)/../move-if-change tmp-options.h options.h
1965 $(STAMP) $@
e8b212b8 1966
32e6d418 1967dumpvers: dumpvers.c
1968
fc3bd902 1969CFLAGS-version.o += -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
21886706 1970 -DREVISION=$(REVISION_s) \
1971 -DDEVPHASE=$(DEVPHASE_s) -DPKGVERSION=$(PKGVERSION_s) \
fc3bd902 1972 -DBUGURL=$(BUGURL_s)
21886706 1973
7bfefa9d 1974# lto-compress.o needs $(ZLIBINC) added to the include flags.
fc3bd902 1975CFLAGS-lto-compress.o += $(ZLIBINC)
21886706 1976
b384c0ce 1977bversion.h: s-bversion; @true
1978s-bversion: BASE-VER
1979 echo "#define BUILDING_GCC_MAJOR `echo $(BASEVER_c) | sed -e 's/^\([0-9]*\).*$$/\1/'`" > bversion.h
1980 echo "#define BUILDING_GCC_MINOR `echo $(BASEVER_c) | sed -e 's/^[0-9]*\.\([0-9]*\).*$$/\1/'`" >> bversion.h
1981 echo "#define BUILDING_GCC_PATCHLEVEL `echo $(BASEVER_c) | sed -e 's/^[0-9]*\.[0-9]*\.\([0-9]*\)$$/\1/'`" >> bversion.h
1982 echo "#define BUILDING_GCC_VERSION (BUILDING_GCC_MAJOR * 1000 + BUILDING_GCC_MINOR)" >> bversion.h
1983 $(STAMP) s-bversion
1984
fc3bd902 1985CFLAGS-toplev.o += -DTARGET_NAME=\"$(target_noncanonical)\"
b96c136c 1986
743d5ab7 1987pass-instances.def: $(srcdir)/passes.def $(srcdir)/gen-pass-instances.awk
1988 $(AWK) -f $(srcdir)/gen-pass-instances.awk \
1989 $(srcdir)/passes.def > pass-instances.def
1990
3965816e 1991$(out_object_file): $(out_file)
1992 $(COMPILE) $<
1993 $(POSTCOMPILE)
21886706 1994
c1485012 1995$(common_out_object_file): $(common_out_file)
1996 $(COMPILE) $<
1997 $(POSTCOMPILE)
2e9d8ccf 1998#\f
c6221df9 1999# Generate header and source files from the machine description,
32e6d418 2000# and compile them.
2001
e23a6527 2002.PRECIOUS: insn-config.h insn-flags.h insn-codes.h insn-constants.h \
32e6d418 2003 insn-emit.c insn-recog.c insn-extract.c insn-output.c insn-peep.c \
73ed0c67 2004 insn-attr.h insn-attr-common.h insn-attrtab.c insn-dfatab.c \
2005 insn-latencytab.c insn-preds.c
32e6d418 2006
96128417 2007# Dependencies for the md file. The first time through, we just assume
2008# the md file itself and the generated dependency file (in order to get
2009# it built). The second time through we have the dependency file.
2010-include mddeps.mk
2011MD_DEPS = s-mddeps $(md_file) $(MD_INCLUDES)
2012
2013s-mddeps: $(md_file) $(MD_INCLUDES) build/genmddeps$(build_exeext)
2014 $(RUN_GEN) build/genmddeps$(build_exeext) $(md_file) > tmp-mddeps
2015 $(SHELL) $(srcdir)/../move-if-change tmp-mddeps mddeps.mk
2016 $(STAMP) s-mddeps
2017
f196fb10 2018# For each of the files generated by running a generator program over
664c5888 2019# the machine description, the following static pattern rules run the
2020# generator program only if the machine description has changed,
2021# but touch the target file only when its contents actually change.
2022# The "; @true" construct forces Make to recheck the timestamp on
2023# the target file.
f196fb10 2024
808674b1 2025simple_rtl_generated_h = insn-attr.h insn-attr-common.h insn-codes.h \
2026 insn-config.h insn-flags.h
f196fb10 2027
73ed0c67 2028simple_rtl_generated_c = insn-automata.c insn-emit.c \
ee65118b 2029 insn-extract.c insn-output.c \
664c5888 2030 insn-peep.c insn-recog.c
2031
2032simple_generated_h = $(simple_rtl_generated_h) insn-constants.h
2033
15f255bd 2034simple_generated_c = $(simple_rtl_generated_c) insn-enums.c
664c5888 2035
2036$(simple_generated_h:insn-%.h=s-%) \
2037$(simple_generated_c:insn-%.c=s-%): s-%: $(MD_DEPS)
2038
2039$(simple_rtl_generated_h:insn-%.h=s-%) \
2040$(simple_rtl_generated_c:insn-%.c=s-%): s-%: insn-conditions.md
f196fb10 2041
2042$(simple_generated_h): insn-%.h: s-%; @true
2043
664c5888 2044$(simple_generated_h:insn-%.h=s-%): s-%: build/gen%$(build_exeext)
af908c02 2045 $(RUN_GEN) build/gen$*$(build_exeext) $(md_file) \
664c5888 2046 $(filter insn-conditions.md,$^) > tmp-$*.h
f196fb10 2047 $(SHELL) $(srcdir)/../move-if-change tmp-$*.h insn-$*.h
2048 $(STAMP) s-$*
2049
2050$(simple_generated_c): insn-%.c: s-%; @true
664c5888 2051$(simple_generated_c:insn-%.c=s-%): s-%: build/gen%$(build_exeext)
af908c02 2052 $(RUN_GEN) build/gen$*$(build_exeext) $(md_file) \
664c5888 2053 $(filter insn-conditions.md,$^) > tmp-$*.c
f196fb10 2054 $(SHELL) $(srcdir)/../move-if-change tmp-$*.c insn-$*.c
2055 $(STAMP) s-$*
2056
2057# gencheck doesn't read the machine description, and the file produced
2058# doesn't use the insn-* convention.
2059tree-check.h: s-check ; @true
2060s-check : build/gencheck$(build_exeext)
2061 $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h
2062 $(SHELL) $(srcdir)/../move-if-change tmp-check.h tree-check.h
2063 $(STAMP) s-check
b70bd542 2064
73ed0c67 2065# genattrtab produces three files: tmp-{attrtab.c,dfatab.c,latencytab.c}
2066insn-attrtab.c insn-dfatab.c insn-latencytab.c: s-attrtab ; @true
2067s-attrtab : $(MD_DEPS) build/genattrtab$(build_exeext) \
2068 insn-conditions.md
2069 $(RUN_GEN) build/genattrtab$(build_exeext) $(md_file) insn-conditions.md \
2070 -Atmp-attrtab.c -Dtmp-dfatab.c -Ltmp-latencytab.c
2071 $(SHELL) $(srcdir)/../move-if-change tmp-attrtab.c insn-attrtab.c
2072 $(SHELL) $(srcdir)/../move-if-change tmp-dfatab.c insn-dfatab.c
2073 $(SHELL) $(srcdir)/../move-if-change tmp-latencytab.c insn-latencytab.c
2074 $(STAMP) s-attrtab
2075
ee65118b 2076# genopinit produces two files.
2077insn-opinit.c insn-opinit.h: s-opinit ; @true
2078s-opinit: $(MD_DEPS) build/genopinit$(build_exeext) insn-conditions.md
2079 $(RUN_GEN) build/genopinit$(build_exeext) $(md_file) \
2080 insn-conditions.md -htmp-opinit.h -ctmp-opinit.c
2081 $(SHELL) $(srcdir)/../move-if-change tmp-opinit.h insn-opinit.h
2082 $(SHELL) $(srcdir)/../move-if-change tmp-opinit.c insn-opinit.c
2083 $(STAMP) s-opinit
2084
af908c02 2085# gencondmd doesn't use the standard naming convention.
21886706 2086build/gencondmd.c: s-conditions; @true
af908c02 2087s-conditions: $(MD_DEPS) build/genconditions$(build_exeext)
2088 $(RUN_GEN) build/genconditions$(build_exeext) $(md_file) > tmp-condmd.c
21886706 2089 $(SHELL) $(srcdir)/../move-if-change tmp-condmd.c build/gencondmd.c
af908c02 2090 $(STAMP) s-conditions
2091
2092insn-conditions.md: s-condmd; @true
2093s-condmd: build/gencondmd$(build_exeext)
2094 $(RUN_GEN) build/gencondmd$(build_exeext) > tmp-cond.md
2095 $(SHELL) $(srcdir)/../move-if-change tmp-cond.md insn-conditions.md
2096 $(STAMP) s-condmd
2097
2098
f196fb10 2099# These files are generated by running the same generator more than
2100# once with different options, so they have custom rules. The
2101# stampfile idiom is the same.
f196fb10 2102genrtl.h: s-genrtl-h; @true
b70bd542 2103
f196fb10 2104s-genrtl-h: build/gengenrtl$(build_exeext)
b6762859 2105 $(RUN_GEN) build/gengenrtl$(build_exeext) > tmp-genrtl.h
f196fb10 2106 $(SHELL) $(srcdir)/../move-if-change tmp-genrtl.h genrtl.h
2107 $(STAMP) s-genrtl-h
2108
2109insn-modes.c: s-modes; @true
2110insn-modes.h: s-modes-h; @true
2111min-insn-modes.c: s-modes-m; @true
47a2c1d4 2112
524a54cf 2113s-modes: build/genmodes$(build_exeext)
f196fb10 2114 $(RUN_GEN) build/genmodes$(build_exeext) > tmp-modes.c
2115 $(SHELL) $(srcdir)/../move-if-change tmp-modes.c insn-modes.c
2116 $(STAMP) s-modes
2117
2118s-modes-h: build/genmodes$(build_exeext)
524a54cf 2119 $(RUN_GEN) build/genmodes$(build_exeext) -h > tmp-modes.h
ed90d522 2120 $(SHELL) $(srcdir)/../move-if-change tmp-modes.h insn-modes.h
f196fb10 2121 $(STAMP) s-modes-h
2122
2123s-modes-m: build/genmodes$(build_exeext)
524a54cf 2124 $(RUN_GEN) build/genmodes$(build_exeext) -m > tmp-min-modes.c
ed90d522 2125 $(SHELL) $(srcdir)/../move-if-change tmp-min-modes.c min-insn-modes.c
f196fb10 2126 $(STAMP) s-modes-m
47a2c1d4 2127
f196fb10 2128insn-preds.c: s-preds; @true
2129tm-preds.h: s-preds-h; @true
a014ec0f 2130tm-constrs.h: s-constrs-h; @true
e23a6527 2131
376b1415 2132.PHONY: mddump
2133mddump: $(BUILD_RTL) $(MD_DEPS) build/genmddump$(build_exeext)
2134 $(RUN_GEN) build/genmddump$(build_exeext) $(md_file) > tmp-mddump.md
2135
96128417 2136s-preds: $(MD_DEPS) build/genpreds$(build_exeext)
524a54cf 2137 $(RUN_GEN) build/genpreds$(build_exeext) $(md_file) > tmp-preds.c
cbf464bd 2138 $(SHELL) $(srcdir)/../move-if-change tmp-preds.c insn-preds.c
e23a6527 2139 $(STAMP) s-preds
2140
f196fb10 2141s-preds-h: $(MD_DEPS) build/genpreds$(build_exeext)
2142 $(RUN_GEN) build/genpreds$(build_exeext) -h $(md_file) > tmp-preds.h
2143 $(SHELL) $(srcdir)/../move-if-change tmp-preds.h tm-preds.h
2144 $(STAMP) s-preds-h
cbf464bd 2145
a014ec0f 2146s-constrs-h: $(MD_DEPS) build/genpreds$(build_exeext)
2147 $(RUN_GEN) build/genpreds$(build_exeext) -c $(md_file) > tmp-constrs.h
2148 $(SHELL) $(srcdir)/../move-if-change tmp-constrs.h tm-constrs.h
2149 $(STAMP) s-constrs-h
2150
202d6e5f 2151target-hooks-def.h: s-target-hooks-def-h; @true
50a6486c 2152# make sure that when we build info files, the used tm.texi is up to date.
2153$(srcdir)/doc/tm.texi: s-tm-texi; @true
202d6e5f 2154
2155s-target-hooks-def-h: build/genhooks$(build_exeext)
c94b1d0e 2156 $(RUN_GEN) build/genhooks$(build_exeext) "Target Hook" \
2157 > tmp-target-hooks-def.h
202d6e5f 2158 $(SHELL) $(srcdir)/../move-if-change tmp-target-hooks-def.h \
2159 target-hooks-def.h
2160 $(STAMP) s-target-hooks-def-h
2161
c94b1d0e 2162c-family/c-target-hooks-def.h: s-c-target-hooks-def-h; @true
2163
2164s-c-target-hooks-def-h: build/genhooks$(build_exeext)
2165 $(RUN_GEN) build/genhooks$(build_exeext) "C Target Hook" \
2166 > tmp-c-target-hooks-def.h
2167 $(SHELL) $(srcdir)/../move-if-change tmp-c-target-hooks-def.h \
2168 c-family/c-target-hooks-def.h
2169 $(STAMP) s-c-target-hooks-def-h
2170
3e87b980 2171common/common-target-hooks-def.h: s-common-target-hooks-def-h; @true
2172
2173s-common-target-hooks-def-h: build/genhooks$(build_exeext)
2174 $(RUN_GEN) build/genhooks$(build_exeext) "Common Target Hook" \
2175 > tmp-common-target-hooks-def.h
2176 $(SHELL) $(srcdir)/../move-if-change tmp-common-target-hooks-def.h \
2177 common/common-target-hooks-def.h
2178 $(STAMP) s-common-target-hooks-def-h
2179
202d6e5f 2180# check if someone mistakenly only changed tm.texi.
50a6486c 2181# We use a different pathname here to avoid a circular dependency.
2182s-tm-texi: $(srcdir)/doc/../doc/tm.texi
2de5bbf2 2183
636142d8 2184# The tm.texi we want to compare against / check into svn should have
2185# unix-style line endings. To make this work on MinGW, remove \r.
2186# \r is not portable to Solaris tr, therefore we have a special
2187# case for ASCII. We use \r for other encodings like EBCDIC.
202d6e5f 2188s-tm-texi: build/genhooks$(build_exeext) $(srcdir)/doc/tm.texi.in
c94b1d0e 2189 $(RUN_GEN) build/genhooks$(build_exeext) -d \
202d6e5f 2190 $(srcdir)/doc/tm.texi.in > tmp-tm.texi
636142d8 2191 case `echo X|tr X '\101'` in \
2192 A) tr -d '\015' < tmp-tm.texi > tmp2-tm.texi ;; \
d3a16c52 2193 *) tr -d '\r' < tmp-tm.texi > tmp2-tm.texi ;; \
636142d8 2194 esac
2195 mv tmp2-tm.texi tmp-tm.texi
202d6e5f 2196 $(SHELL) $(srcdir)/../move-if-change tmp-tm.texi tm.texi
2197 @if cmp -s $(srcdir)/doc/tm.texi tm.texi; then \
2198 $(STAMP) $@; \
2199 elif test $(srcdir)/doc/tm.texi -nt $(srcdir)/doc/tm.texi.in \
c94b1d0e 2200 && ( test $(srcdir)/doc/tm.texi -nt $(srcdir)/target.def \
2201 || test $(srcdir)/doc/tm.texi -nt $(srcdir)/c-family/c-target.def \
3e87b980 2202 || test $(srcdir)/doc/tm.texi -nt $(srcdir)/common/common-target.def \
c94b1d0e 2203 ); then \
202d6e5f 2204 echo >&2 ; \
2205 echo You should edit $(srcdir)/doc/tm.texi.in rather than $(srcdir)/doc/tm.texi . >&2 ; \
2206 false; \
2207 else \
2208 echo >&2 ; \
2209 echo Verify that you have permission to grant a GFDL license for all >&2 ; \
2210 echo new text in tm.texi, then copy it to $(srcdir)/doc/tm.texi. >&2 ; \
2211 false; \
2212 fi
2213
9c85a98a 2214GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
2215 $(host_xm_file_list) \
d856c8a6 2216 $(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) $(srcdir)/bitmap.h \
32c2fdea 2217 $(srcdir)/alias.h $(srcdir)/coverage.c $(srcdir)/rtl.h \
96423453 2218 $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/tree-core.h \
2219 $(srcdir)/libfuncs.h $(SYMTAB_H) \
4dd3de56 2220 $(srcdir)/real.h $(srcdir)/function.h $(srcdir)/insn-addr.h $(srcdir)/hwint.h \
5efd9b45 2221 $(srcdir)/fixed-value.h \
db5a3693 2222 $(srcdir)/output.h $(srcdir)/cfgloop.h \
8d810329 2223 $(srcdir)/cselib.h $(srcdir)/basic-block.h $(srcdir)/ipa-ref.h $(srcdir)/cgraph.h \
cfbe30aa 2224 $(srcdir)/reload.h $(srcdir)/caller-save.c $(srcdir)/symtab.c \
639e4be4 2225 $(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \
5514adf9 2226 $(srcdir)/ipa-prop.c $(srcdir)/ipa-cp.c $(srcdir)/ipa-utils.h \
dcdf448e 2227 $(srcdir)/dbxout.c \
2228 $(srcdir)/dwarf2out.h \
2229 $(srcdir)/dwarf2asm.c \
2230 $(srcdir)/dwarf2cfi.c \
2231 $(srcdir)/dwarf2out.c \
75a70cf9 2232 $(srcdir)/tree-vect-generic.c \
570af75a 2233 $(srcdir)/dojump.c \
576cc2fe 2234 $(srcdir)/emit-rtl.c $(srcdir)/except.h $(srcdir)/explow.c $(srcdir)/expr.c \
d8f74faa 2235 $(srcdir)/expr.h \
576cc2fe 2236 $(srcdir)/function.c $(srcdir)/except.c \
929d2a90 2237 $(srcdir)/gcse.c $(srcdir)/godump.c \
ea1760a3 2238 $(srcdir)/lists.c $(srcdir)/optabs.c \
75f8637a 2239 $(srcdir)/profile.c $(srcdir)/mcf.c \
23a070f3 2240 $(srcdir)/reg-stack.c $(srcdir)/cfgrtl.c \
fcb807f8 2241 $(srcdir)/sdbout.c $(srcdir)/stor-layout.c \
32b8be60 2242 $(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \
75a70cf9 2243 $(srcdir)/gimple.h $(srcdir)/gimple.c \
2244 $(srcdir)/tree-mudflap.c $(srcdir)/tree-flow.h \
aed164c3 2245 $(srcdir)/tree-ssanames.c $(srcdir)/tree-eh.c $(srcdir)/tree-ssa-address.c \
75a70cf9 2246 $(srcdir)/tree-cfg.c \
2247 $(srcdir)/tree-dfa.c \
4ee9c684 2248 $(srcdir)/tree-iterator.c $(srcdir)/gimplify.c \
75a70cf9 2249 $(srcdir)/tree-chrec.h \
2250 $(srcdir)/tree-scalar-evolution.c \
fcbe34ba 2251 $(srcdir)/tree-ssa-operands.h \
ed4294da 2252 $(srcdir)/tree-profile.c $(srcdir)/tree-nested.c \
75a70cf9 2253 $(srcdir)/tree-parloops.c \
2254 $(srcdir)/omp-low.c \
a861fe52 2255 $(srcdir)/targhooks.c $(out_file) $(srcdir)/passes.c $(srcdir)/cgraphunit.c \
f41db742 2256 $(srcdir)/cgraphclones.c \
75a70cf9 2257 $(srcdir)/tree-ssa-propagate.c \
2258 $(srcdir)/tree-phinodes.c \
dd277d48 2259 $(srcdir)/tree-ssa-alias.h \
9e2e2283 2260 $(srcdir)/tree-ssanames.h \
8867b500 2261 $(srcdir)/ipa-prop.h \
4c0315d0 2262 $(srcdir)/trans-mem.c \
57305941 2263 $(srcdir)/lto-streamer.h \
821d4118 2264 $(srcdir)/target-globals.h \
a41f2a28 2265 $(srcdir)/ipa-inline.h \
b710ec85 2266 $(srcdir)/vtable-verify.c \
5d5c682b 2267 $(srcdir)/asan.c \
9e46467d 2268 $(srcdir)/ubsan.c \
5514adf9 2269 $(srcdir)/tsan.c $(srcdir)/ipa-devirt.c \
1f3233d1 2270 @all_gtfiles@
2271
2ac441f7 2272# Compute the list of GT header files from the corresponding C sources,
2273# possibly nested within config or language subdirectories. Match gengtype's
2274# behavior in this respect: gt-LANG-file.h for "file" anywhere within a LANG
2275# language subdir, gt-file.h otherwise (no subdir indication for config/
2276# related sources).
2277
2278GTFILES_H = $(subst /,-, \
2279 $(shell echo $(patsubst $(srcdir)/%,gt-%, \
2280 $(patsubst %.c,%.h, \
2281 $(filter %.c, $(GTFILES)))) \
fcbc7faf 2282 | sed -e "s|/[^ ]*/|/|g" -e "s|gt-config/|gt-|g"))
570af75a 2283
2284GTFILES_LANG_H = $(patsubst [%], gtype-%.h, $(filter [%], $(GTFILES)))
2285ALL_GTFILES_H := $(sort $(GTFILES_H) $(GTFILES_LANG_H))
2286
2287# $(GTFILES) may be too long to put on a command line, so we have to
2288# write it out to a file (taking care not to do that in a way that
2289# overflows a command line!) and then have gengtype read the file in.
16979163 2290
6d70c713 2291$(ALL_GTFILES_H) gtype-desc.c gtype-desc.h gtype.state: s-gtype ; @true
570af75a 2292
463ae493 2293### Common flags to gengtype [e.g. -v or -B backupdir]
2294GENGTYPE_FLAGS=
2295
570af75a 2296gtyp-input.list: s-gtyp-input ; @true
2297s-gtyp-input: Makefile
bdaa15c6 2298 @: $(call write_entries_to_file,$(GTFILES),tmp-gi.list)
570af75a 2299 $(SHELL) $(srcdir)/../move-if-change tmp-gi.list gtyp-input.list
2300 $(STAMP) s-gtyp-input
2301
2302s-gtype: build/gengtype$(build_exeext) $(filter-out [%], $(GTFILES)) \
2303 gtyp-input.list
463ae493 2304# First, parse all files and save a state file.
2305 $(RUN_GEN) build/gengtype$(build_exeext) $(GENGTYPE_FLAGS) \
6d70c713 2306 -S $(srcdir) -I gtyp-input.list -w tmp-gtype.state
463ae493 2307# Second, read the state file and generate all files. This ensure that
2308# gtype.state is correctly read:
6d70c713 2309 $(SHELL) $(srcdir)/../move-if-change tmp-gtype.state gtype.state
463ae493 2310 $(RUN_GEN) build/gengtype$(build_exeext) $(GENGTYPE_FLAGS) \
2311 -r gtype.state
1f3233d1 2312 $(STAMP) s-gtype
2313
7bedc3a0 2314generated_files = config.h tm.h $(TM_P_H) $(TM_H) multilib.h \
2315 $(simple_generated_h) specs.h \
2316 tree-check.h genrtl.h insn-modes.h tm-preds.h tm-constrs.h \
bbd12626 2317 $(ALL_GTFILES_H) gtype-desc.c gtype-desc.h gcov-iov.h \
2318 options.h target-hooks-def.h insn-opinit.h \
2319 common/common-target-hooks-def.h pass-instances.def \
2320 c-family/c-target-hooks-def.h
7bedc3a0 2321
2e9d8ccf 2322#\f
f196fb10 2323# How to compile object files to run on the build machine.
c061bf74 2324
21886706 2325build/%.o : # dependencies provided by explicit rule later
585d4848 2326 $(COMPILER_FOR_BUILD) -c $(BUILD_COMPILERFLAGS) $(BUILD_CPPFLAGS) \
2327 -o $@ $<
21886706 2328
1fdf44f0 2329## build/version.o is compiled by the $(COMPILER_FOR_BUILD) but needs
2330## several C macro definitions, just like version.o
2331build/version.o: version.c version.h \
2332 $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE)
2333 $(COMPILER_FOR_BUILD) -c $(BUILD_COMPILERFLAGS) $(BUILD_CPPFLAGS) \
2334 -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
2335 -DREVISION=$(REVISION_s) \
2336 -DDEVPHASE=$(DEVPHASE_s) -DPKGVERSION=$(PKGVERSION_s) \
2337 -DBUGURL=$(BUGURL_s) -o $@ $<
2338
21886706 2339# Header dependencies for the programs that generate source code.
2340# These are library modules...
2341build/errors.o : errors.c $(BCONFIG_H) $(SYSTEM_H) errors.h
2342build/gensupport.o: gensupport.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
2343 $(GTM_H) $(RTL_BASE_H) $(OBSTACK_H) errors.h $(HASHTAB_H) \
960ebfe7 2344 $(READ_MD_H) gensupport.h
21886706 2345build/ggc-none.o : ggc-none.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
2346 $(GGC_H)
2347build/min-insn-modes.o : min-insn-modes.c $(BCONFIG_H) $(SYSTEM_H) \
2348 $(MACHMODE_H)
2349build/print-rtl.o: print-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
2350 $(GTM_H) $(RTL_BASE_H)
960ebfe7 2351build/read-md.o: read-md.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
b638f5c8 2352 $(HASHTAB_H) errors.h $(READ_MD_H)
21886706 2353build/read-rtl.o: read-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
960ebfe7 2354 $(GTM_H) $(RTL_BASE_H) $(OBSTACK_H) $(HASHTAB_H) $(READ_MD_H) \
2355 gensupport.h
21886706 2356build/rtl.o: rtl.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) \
a7a46268 2357 $(RTL_H) $(GGC_H) errors.h
ea269688 2358build/vec.o : vec.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(VEC_H) \
92468061 2359 $(GGC_H) toplev.h $(DIAGNOSTIC_CORE_H)
21886706 2360build/gencondmd.o : build/gencondmd.c $(BCONFIG_H) $(SYSTEM_H) \
387a6c35 2361 coretypes.h $(GTM_H) insn-constants.h \
2362 $(filter-out insn-flags.h, $(RTL_H) $(TM_P_H) $(FUNCTION_H) $(REGS_H) \
92468061 2363 $(RECOG_H) output.h $(FLAGS_H) $(RESOURCE_H) toplev.h $(DIAGNOSTIC_CORE_H) reload.h \
387a6c35 2364 $(EXCEPT_H) tm-constrs.h)
f508ba97 2365# This pulls in tm-pred.h which contains inline functions wrapping up
2366# predicates from the back-end so those functions must be discarded.
2367# No big deal since gencondmd.c is a dummy file for non-GCC compilers.
2368build/gencondmd.o : \
2369 BUILD_CFLAGS := $(filter-out -fkeep-inline-functions, $(BUILD_CFLAGS))
805e22b2 2370
21886706 2371# ...these are the programs themselves.
2372build/genattr.o : genattr.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
960ebfe7 2373 coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
808674b1 2374build/genattr-common.o : genattr-common.c $(RTL_BASE_H) $(BCONFIG_H) \
2375 $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
21886706 2376build/genattrtab.o : genattrtab.c $(RTL_BASE_H) $(OBSTACK_H) \
2377 $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(GGC_H) \
f1f41a6c 2378 $(READ_MD_H) gensupport.h $(FNMATCH_H)
21886706 2379build/genautomata.o : genautomata.c $(RTL_BASE_H) $(OBSTACK_H) \
ea269688 2380 $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(VEC_H) \
2334f0df 2381 $(HASHTAB_H) gensupport.h $(FNMATCH_H)
b20df6d7 2382build/gencheck.o : gencheck.c all-tree.def $(BCONFIG_H) $(GTM_H) \
d5fe1e53 2383 $(SYSTEM_H) coretypes.h tree.def c-family/c-common.def \
2384 $(lang_tree_files) gimple.def
21886706 2385build/genchecksum.o : genchecksum.c $(BCONFIG_H) $(SYSTEM_H) $(MD5_H)
2386build/gencodes.o : gencodes.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
2387 coretypes.h $(GTM_H) errors.h gensupport.h
2388build/genconditions.o : genconditions.c $(RTL_BASE_H) $(BCONFIG_H) \
960ebfe7 2389 $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(HASHTAB_H) $(READ_MD_H) \
2390 gensupport.h
21886706 2391build/genconfig.o : genconfig.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
2392 coretypes.h $(GTM_H) errors.h gensupport.h
664c5888 2393build/genconstants.o : genconstants.c $(BCONFIG_H) $(SYSTEM_H) \
2394 coretypes.h errors.h $(READ_MD_H)
21886706 2395build/genemit.o : genemit.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
960ebfe7 2396 coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
15f255bd 2397build/genenums.o : genenums.c $(BCONFIG_H) $(SYSTEM_H) \
2398 coretypes.h errors.h $(READ_MD_H)
21886706 2399build/genextract.o : genextract.c $(RTL_BASE_H) $(BCONFIG_H) \
f1f41a6c 2400 $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
21886706 2401build/genflags.o : genflags.c $(RTL_BASE_H) $(OBSTACK_H) $(BCONFIG_H) \
960ebfe7 2402 $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
21886706 2403build/gengenrtl.o : gengenrtl.c $(BCONFIG_H) $(SYSTEM_H) rtl.def
c833363a 2404
2405# The gengtype generator program is special: Two versions are built.
2406# One is for the build machine, and one is for the host to allow
2407# plugins to define their types and generate the supporting GGC
2408# datastructures and routines with GTY markers.
2409# The host object files depend on CONFIG_H, and the build objects
2410# on BCONFIG_H. For the build objects, add -DGENERATOR_FILE manually,
2411# the build-%: rule doesn't apply to them.
2412
6d70c713 2413gengtype-lex.o build/gengtype-lex.o : gengtype-lex.c gengtype.h $(SYSTEM_H)
600368fe 2414gengtype-lex.o: $(CONFIG_H) $(BCONFIG_H)
c833363a 2415CFLAGS-gengtype-lex.o += -DGENERATOR_FILE
6d70c713 2416build/gengtype-lex.o: $(BCONFIG_H)
c833363a 2417
6d70c713 2418gengtype-parse.o build/gengtype-parse.o : gengtype-parse.c gengtype.h \
21886706 2419 $(SYSTEM_H)
6d70c713 2420gengtype-parse.o: $(CONFIG_H)
c833363a 2421CFLAGS-gengtype-parse.o += -DGENERATOR_FILE
6d70c713 2422build/gengtype-parse.o: $(BCONFIG_H)
c833363a 2423
6d70c713 2424gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
2425 gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
2426 $(XREGEX_H)
2427gengtype-state.o: $(CONFIG_H)
c833363a 2428CFLAGS-gengtype-state.o += -DGENERATOR_FILE
6d70c713 2429build/gengtype-state.o: $(BCONFIG_H)
c833363a 2430
6d70c713 2431gengtype.o build/gengtype.o : gengtype.c $(SYSTEM_H) gengtype.h \
2432 rtl.def insn-notes.def errors.h double-int.h version.h $(HASHTAB_H) \
8fda3262 2433 $(OBSTACK_H) $(XREGEX_H)
6d70c713 2434gengtype.o: $(CONFIG_H)
c833363a 2435CFLAGS-gengtype.o += -DGENERATOR_FILE
6d70c713 2436build/gengtype.o: $(BCONFIG_H)
c833363a 2437
21886706 2438build/genmddeps.o: genmddeps.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h \
664c5888 2439 errors.h $(READ_MD_H)
21886706 2440build/genmodes.o : genmodes.c $(BCONFIG_H) $(SYSTEM_H) errors.h \
2441 $(HASHTAB_H) machmode.def $(extra_modes_file)
2442build/genopinit.o : genopinit.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
ee65118b 2443 coretypes.h $(GTM_H) errors.h gensupport.h optabs.def
21886706 2444build/genoutput.o : genoutput.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
960ebfe7 2445 coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
21886706 2446build/genpeep.o : genpeep.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
92468061 2447 coretypes.h $(GTM_H) errors.h gensupport.h toplev.h $(DIAGNOSTIC_CORE_H)
21886706 2448build/genpreds.o : genpreds.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
960ebfe7 2449 coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h $(OBSTACK_H)
21886706 2450build/genrecog.o : genrecog.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
960ebfe7 2451 coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
c94b1d0e 2452build/genhooks.o : genhooks.c $(TARGET_DEF) $(C_TARGET_DEF) \
3e87b980 2453 $(COMMON_TARGET_DEF) $(BCONFIG_H) $(SYSTEM_H) errors.h
376b1415 2454build/genmddump.o : genmddump.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
2455 coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h
21886706 2456
f196fb10 2457# Compile the programs that generate insn-* from the machine description.
585d4848 2458# They are compiled with $(COMPILER_FOR_BUILD), and associated libraries,
f196fb10 2459# since they need to run on this machine
2460# even if GCC is being compiled to run on some other machine.
e23a6527 2461
664c5888 2462# All these programs use the RTL reader ($(BUILD_RTL)).
808674b1 2463genprogrtl = attr attr-common attrtab automata codes conditions config emit \
376b1415 2464 extract flags opinit output peep preds recog mddump
664c5888 2465$(genprogrtl:%=build/gen%$(build_exeext)): $(BUILD_RTL)
2466
2467# All these programs use the MD reader ($(BUILD_MD)).
15f255bd 2468genprogmd = $(genprogrtl) mddeps constants enums
664c5888 2469$(genprogmd:%=build/gen%$(build_exeext)): $(BUILD_MD)
2470
b0b2c910 2471# All these programs need to report errors.
2472genprogerr = $(genprogmd) genrtl modes gtype hooks
2473$(genprogerr:%=build/gen%$(build_exeext)): $(BUILD_ERRORS)
2474
2475# Remaining build programs.
2476genprog = $(genprogerr) check checksum condmd
af908c02 2477
f508ba97 2478# These programs need libs over and above what they get from the above list.
0f7f3d52 2479build/genautomata$(build_exeext) : BUILD_LIBS += -lm
583fa9e0 2480
343695df 2481# These programs are not linked with the MD reader.
1fdf44f0 2482build/gengtype$(build_exeext) : build/gengtype-lex.o build/gengtype-parse.o \
6d70c713 2483 build/gengtype-state.o build/version.o build/errors.o
2484
2485gengtype$(exeext) : gengtype.o gengtype-lex.o gengtype-parse.o \
2486 gengtype-state.o version.o errors.o $(LIBDEPS)
77eb3c2f 2487 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
2488 $(filter-out ($LIBDEPS), $^) $(LIBS)
b0b2c910 2489
2490# Rule for the generator programs:
2491$(genprog:%=build/gen%$(build_exeext)): build/gen%$(build_exeext): build/gen%.o $(BUILD_LIBDEPS)
70293f47 2492 +$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) -o $@ \
b0b2c910 2493 $(filter-out $(BUILD_LIBDEPS), $^) $(BUILD_LIBS)
1f3233d1 2494
c99a98bc 2495# Generated source files for gengtype. Prepend inclusion of
2496# bconfig.h because AIX requires _LARGE_FILES to be defined before
2497# any system header is included.
a6b4c5a9 2498gengtype-lex.c : gengtype-lex.l
e9992746 2499 -$(FLEX) $(FLEXFLAGS) -o$@ $< && { \
2500 echo '#include "bconfig.h"' > $@.tmp; \
2501 cat $@ >> $@.tmp; \
2502 mv $@.tmp $@; \
2503 }
bea4bad2 2504
21886706 2505#\f
2506# Remake internationalization support.
fc3bd902 2507CFLAGS-intl.o += -DLOCALEDIR=\"$(localedir)\"
21886706 2508
2e9d8ccf 2509#\f
f2397fc4 2510# Remake cpp.
32e6d418 2511
e2d3326d 2512PREPROCESSOR_DEFINES = \
2513 -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
d3036f42 2514 -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \
e2d3326d 2515 -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
36ddd5fe 2516 -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \
d58156a1 2517 -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
b91355a3 2518 -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
759d75c3 2519 -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
805e22b2 2520 -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
17acc97a 2521 -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
638454a1 2522 -DNATIVE_SYSTEM_HEADER_DIR=\"$(NATIVE_SYSTEM_HEADER_DIR)\" \
72d997cb 2523 -DPREFIX=\"$(prefix)/\" \
2524 -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
17acc97a 2525 @TARGET_SYSTEM_ROOT_DEFINE@
32e6d418 2526
fc3bd902 2527CFLAGS-cppbuiltin.o += $(PREPROCESSOR_DEFINES) -DBASEVER=$(BASEVER_s)
41acdfa4 2528
fc3bd902 2529CFLAGS-cppdefault.o += $(PREPROCESSOR_DEFINES)
21886706 2530
876dc5b0 2531# Note for the stamp targets, we run the program `true' instead of
2532# having an empty command (nothing following the semicolon).
2533
21886706 2534# gcov-iov.c is run on the build machine to generate gcov-iov.h from version.c
2535build/gcov-iov.o: gcov-iov.c $(BCONFIG_H) coretypes.h $(GTM_H) \
2536 $(SYSTEM_H) coretypes.h $(TM_H)
2537
524a54cf 2538build/gcov-iov$(build_exeext): build/gcov-iov.o
70293f47 2539 +$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) \
585d4848 2540 build/gcov-iov.o -o $@
524a54cf 2541
32e9529f 2542gcov-iov.h: s-iov
1af67e62 2543s-iov: build/gcov-iov$(build_exeext) $(BASEVER) $(DEVPHASE)
2544 build/gcov-iov$(build_exeext) '$(BASEVER_c)' '$(DEVPHASE_c)' \
2545 > tmp-gcov-iov.h
ed90d522 2546 $(SHELL) $(srcdir)/../move-if-change tmp-gcov-iov.h gcov-iov.h
32e9529f 2547 $(STAMP) s-iov
805e22b2 2548
0b4f4daf 2549GCOV_OBJS = gcov.o
be2828ce 2550gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
70293f47 2551 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
0b4f4daf 2552GCOV_DUMP_OBJS = gcov-dump.o
805e22b2 2553gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(LIBDEPS)
70293f47 2554 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_DUMP_OBJS) \
585d4848 2555 $(LIBS) -o $@
2e9d8ccf 2556#\f
d3036f42 2557# Build the include directories. The stamp files are stmp-* rather than
997d68fe 2558# s-* so that mostlyclean does not force the include directory to
2cfd79fe 2559# be rebuilt.
2560
d3036f42 2561# Build the include directories.
e59be7e3 2562stmp-int-hdrs: $(STMP_FIXINC) $(USER_H) fixinc_list
2cfd79fe 2563# Copy in the headers provided with gcc.
9281483c 2564#
2cfd79fe 2565# The sed command gets just the last file name component;
2566# this is necessary because VPATH could add a dirname.
2567# Using basename would be simpler, but some systems don't have it.
9281483c 2568#
220345e0 2569# The touch command is here to workaround an AIX/Linux NFS bug.
9281483c 2570#
2571# The move-if-change + cp -p twists for limits.h are intended to preserve
2572# the time stamp when we regenerate, to prevent pointless rebuilds during
2573# e.g. install-no-fixedincludes.
dc901594 2574 -if [ -d include ] ; then true; else mkdir include; chmod a+rx include; fi
d3036f42 2575 -if [ -d include-fixed ] ; then true; else mkdir include-fixed; chmod a+rx include-fixed; fi
c8763215 2576 for file in .. $(USER_H); do \
2577 if [ X$$file != X.. ]; then \
2578 realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
5ec97d31 2579 $(STAMP) include/$$realfile; \
1941d7da 2580 rm -f include/$$realfile; \
2581 cp $$file include; \
2582 chmod a+r include/$$realfile; \
c8763215 2583 fi; \
2cfd79fe 2584 done
ac0366be 2585 for file in .. $(USER_H_INC_NEXT_PRE); do \
2586 if [ X$$file != X.. ]; then \
2587 mv include/$$file include/x_$$file; \
2588 echo "#include_next <$$file>" >include/$$file; \
2589 cat include/x_$$file >>include/$$file; \
2590 rm -f include/x_$$file; \
2591 chmod a+r include/$$file; \
2592 fi; \
2593 done
2594 for file in .. $(USER_H_INC_NEXT_POST); do \
2595 if [ X$$file != X.. ]; then \
2596 echo "#include_next <$$file>" >>include/$$file; \
2597 chmod a+r include/$$file; \
2598 fi; \
2599 done
f3449a3c 2600 rm -f include/stdint.h
2601 if [ $(USE_GCC_STDINT) = wrap ]; then \
2602 rm -f include/stdint-gcc.h; \
2603 cp $(srcdir)/ginclude/stdint-gcc.h include/stdint-gcc.h; \
ca4b7618 2604 chmod a+r include/stdint-gcc.h; \
f3449a3c 2605 cp $(srcdir)/ginclude/stdint-wrap.h include/stdint.h; \
3564f003 2606 chmod a+r include/stdint.h; \
f3449a3c 2607 elif [ $(USE_GCC_STDINT) = provide ]; then \
2608 cp $(srcdir)/ginclude/stdint-gcc.h include/stdint.h; \
3564f003 2609 chmod a+r include/stdint.h; \
f3449a3c 2610 fi
6ea4242f 2611 set -e; for ml in `cat fixinc_list`; do \
2612 sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \
2613 multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
2614 fix_dir=include-fixed$${multi_dir}; \
2615 if $(LIMITS_H_TEST) ; then \
2616 cat $(srcdir)/limitx.h $(srcdir)/glimits.h $(srcdir)/limity.h > tmp-xlimits.h; \
2617 else \
2618 cat $(srcdir)/glimits.h > tmp-xlimits.h; \
2619 fi; \
2620 $(mkinstalldirs) $${fix_dir}; \
2621 chmod a+rx $${fix_dir} || true; \
9281483c 2622 $(SHELL) $(srcdir)/../move-if-change \
2623 tmp-xlimits.h tmp-limits.h; \
6ea4242f 2624 rm -f $${fix_dir}/limits.h; \
9281483c 2625 cp -p tmp-limits.h $${fix_dir}/limits.h; \
6ea4242f 2626 chmod a+r $${fix_dir}/limits.h; \
2627 done
d54b81e0 2628# Install the README
d3036f42 2629 rm -f include-fixed/README
2630 cp $(srcdir)/../fixincludes/README-fixinc include-fixed/README
2631 chmod a+r include-fixed/README
5ec97d31 2632 $(STAMP) $@
d54b81e0 2633
805e22b2 2634.PHONY: install-gcc-tooldir
2635install-gcc-tooldir:
ca08f0d3 2636 $(mkinstalldirs) $(DESTDIR)$(gcc_tooldir)
805e22b2 2637
7679bd15 2638macro_list: s-macro_list; @true
32abc985 2639s-macro_list : $(GCC_PASSES)
50e7e370 2640 echo | $(GCC_FOR_TARGET) -E -dM - | \
85cc1e72 2641 sed -n -e 's/^#define \([^_][a-zA-Z0-9_]*\).*/\1/p' \
2642 -e 's/^#define \(_[^_A-Z][a-zA-Z0-9_]*\).*/\1/p' | \
7679bd15 2643 sort -u > tmp-macro_list
2644 $(SHELL) $(srcdir)/../move-if-change tmp-macro_list macro_list
2645 $(STAMP) s-macro_list
50e7e370 2646
6ea4242f 2647fixinc_list: s-fixinc_list; @true
2648s-fixinc_list : $(GCC_PASSES)
2649# Build up a list of multilib directories and corresponding sysroot
2650# suffixes, in form sysroot;multilib.
2651 if $(GCC_FOR_TARGET) -print-sysroot-headers-suffix > /dev/null 2>&1; then \
2652 set -e; for ml in `$(GCC_FOR_TARGET) -print-multi-lib`; do \
2653 multi_dir=`echo $${ml} | sed -e 's/;.*$$//'`; \
2654 flags=`echo $${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
2655 sfx=`$(GCC_FOR_TARGET) $${flags} -print-sysroot-headers-suffix`; \
2656 if [ "$${multi_dir}" = "." ]; \
2657 then multi_dir=""; \
2658 else \
2659 multi_dir=/$${multi_dir}; \
2660 fi; \
2661 echo "$${sfx};$${multi_dir}"; \
2662 done; \
2663 else \
2664 echo ";"; \
2665 fi > tmp-fixinc_list
2666 $(SHELL) $(srcdir)/../move-if-change tmp-fixinc_list fixinc_list
2667 $(STAMP) s-fixinc_list
2668
6b9a84ac 2669# The line below is supposed to avoid accidentally matching the
2670# built-in suffix rule `.o:' to build fixincl out of fixincl.o. You'd
2671# expect fixincl to be newer than fixincl.o, such that this situation
2672# would never come up. As it turns out, if you use ccache with
2673# CCACHE_HARDLINK enabled, the compiler doesn't embed the current
2674# working directory in object files (-g absent, or -fno-working-dir
2675# present), and build and host are the same, fixincl for the host will
2676# build after fixincl for the build machine, getting a cache hit,
3ce7ff97 2677# thereby updating the timestamp of fixincl.o in the host tree.
6b9a84ac 2678# Because of CCACHE_HARDLINK, this will also update the timestamp in
2679# the build tree, and so fixincl in the build tree will appear to be
2680# out of date. Yuck.
2681../$(build_subdir)/fixincludes/fixincl: ; @ :
2682
2cfd79fe 2683# Build fixed copies of system files.
4a62cbb1 2684# Abort if no system headers available, unless building a crosscompiler.
2685# FIXME: abort unless building --without-headers would be more accurate and less ugly
6ea4242f 2686stmp-fixinc: gsyslimits.h macro_list fixinc_list \
c1eb9e31 2687 $(build_objdir)/fixincludes/fixincl \
2688 $(build_objdir)/fixincludes/fixinc.sh
d3036f42 2689 rm -rf include-fixed; mkdir include-fixed
2690 -chmod a+rx include-fixed
26526d23 2691 if [ -d ../prev-gcc ]; then \
2692 cd ../prev-gcc && \
ccdd426b 2693 $(MAKE) real-$(INSTALL_HEADERS_DIR) DESTDIR=`pwd`/../gcc/ \
26526d23 2694 libsubdir=. ; \
b7d4d520 2695 else \
6ea4242f 2696 set -e; for ml in `cat fixinc_list`; do \
2697 sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \
2698 multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
2699 fix_dir=include-fixed$${multi_dir}; \
2700 if ! $(inhibit_libc) && test ! -d ${SYSTEM_HEADER_DIR}; then \
2701 echo The directory that should contain system headers does not exist: >&2 ; \
2702 echo " ${SYSTEM_HEADER_DIR}" >&2 ; \
2703 tooldir_sysinc=`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`; \
2704 if test "x${SYSTEM_HEADER_DIR}" = "x$${tooldir_sysinc}"; \
2705 then sleep 1; else exit 1; fi; \
2706 fi; \
2707 $(mkinstalldirs) $${fix_dir}; \
2708 chmod a+rx $${fix_dir} || true; \
2709 (TARGET_MACHINE='$(target)'; srcdir=`cd $(srcdir); ${PWD_COMMAND}`; \
2710 SHELL='$(SHELL)'; MACRO_LIST=`${PWD_COMMAND}`/macro_list ; \
97f0faf7 2711 gcc_dir=`${PWD_COMMAND}` ; \
6ea4242f 2712 export TARGET_MACHINE srcdir SHELL MACRO_LIST && \
2713 cd $(build_objdir)/fixincludes && \
97f0faf7 2714 $(SHELL) ./fixinc.sh "$${gcc_dir}/$${fix_dir}" \
6ea4242f 2715 $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS) ); \
2716 rm -f $${fix_dir}/syslimits.h; \
2717 if [ -f $${fix_dir}/limits.h ]; then \
2718 mv $${fix_dir}/limits.h $${fix_dir}/syslimits.h; \
2719 else \
2720 cp $(srcdir)/gsyslimits.h $${fix_dir}/syslimits.h; \
2721 fi; \
2722 chmod a+r $${fix_dir}/syslimits.h; \
2723 done; \
50e7e370 2724 fi
5ec97d31 2725 $(STAMP) stmp-fixinc
2e9d8ccf 2726#\f
9281483c 2727
2728# Install with the gcc headers files, not the fixed include files, which we
2729# are typically not allowed to distribute. The general idea is to:
2730# - Get to "install" with a bare set of internal headers, not the
2731# fixed system ones,
2732# - Prevent rebuilds of what normally depends on the headers, which is
2733# useless for installation purposes and would rely on improper headers.
2734# - Restore as much of the original state as possible.
2735
2736.PHONY: install-no-fixedincludes
2737
2738install-no-fixedincludes:
2739 # Stash the current set of headers away, save stamps we're going to
2740 # alter explicitly, and arrange for fixincludes not to run next time
2741 # we trigger a headers rebuild.
2742 -rm -rf tmp-include
2743 -mv include tmp-include 2>/dev/null
2744 -mv include-fixed tmp-include-fixed 2>/dev/null
2745 -mv stmp-int-hdrs tmp-stmp-int-hdrs 2>/dev/null
2746 -mv stmp-fixinc tmp-stmp-fixinc 2>/dev/null
2747 -mkdir include
2748 -cp -p $(srcdir)/gsyslimits.h include/syslimits.h
2749 -touch stmp-fixinc
2750
2751 # Rebuild our internal headers, restore the original stamps so that
2752 # "install" doesn't trigger pointless rebuilds because of that update,
2753 # then do install
2754 $(MAKE) $(FLAGS_TO_PASS) stmp-int-hdrs
2755 -mv tmp-stmp-int-hdrs stmp-int-hdrs 2>/dev/null
2756 -mv tmp-stmp-fixinc stmp-fixinc 2>/dev/null
2757 $(MAKE) $(FLAGS_TO_PASS) install
2758
2759 # Restore the original set of maybe-fixed headers
2760 -rm -rf include; mv tmp-include include 2>/dev/null
2761 -rm -rf include-fixed; mv tmp-include-fixed include-fixed 2>/dev/null
2762
32e6d418 2763# Remake the info files.
2764
210263ee 2765doc: $(BUILD_INFO) $(GENERATED_MANPAGES)
ca6eabd1 2766
2767INFOFILES = doc/cpp.info doc/gcc.info doc/gccint.info \
2768 doc/gccinstall.info doc/cppinternals.info
2769
2770info: $(INFOFILES) lang.info @GENINSRC@ srcinfo lang.srcinfo
2771
2772srcinfo: $(INFOFILES)
2773 -cp -p $^ $(srcdir)/doc
089f59b9 2774
1af67e62 2775TEXI_CPP_FILES = cpp.texi fdl.texi cppenv.texi cppopts.texi \
2776 gcc-common.texi gcc-vers.texi
089f59b9 2777
1af67e62 2778TEXI_GCC_FILES = gcc.texi gcc-common.texi gcc-vers.texi frontends.texi \
2779 standards.texi invoke.texi extend.texi md.texi objc.texi \
2780 gcov.texi trouble.texi bugreport.texi service.texi \
eae7da65 2781 contribute.texi compat.texi funding.texi gnu.texi gpl_v3.texi \
8a92b4c3 2782 fdl.texi contrib.texi cppenv.texi cppopts.texi avr-mmcu.texi \
c1c67b4f 2783 implement-c.texi implement-cxx.texi arm-neon-intrinsics.texi
089f59b9 2784
50a6486c 2785# we explicitly use $(srcdir)/doc/tm.texi here to avoid confusion with
2786# the generated tm.texi; the latter might have a more recent timestamp,
2787# but we don't want to rebuild the info files unless the contents of
2788# the *.texi files have changed.
1af67e62 2789TEXI_GCCINT_FILES = gccint.texi gcc-common.texi gcc-vers.texi \
2790 contribute.texi makefile.texi configterms.texi options.texi \
50a6486c 2791 portability.texi interface.texi passes.texi rtl.texi md.texi \
2792 $(srcdir)/doc/tm.texi hostconfig.texi fragments.texi \
1af67e62 2793 configfiles.texi collect2.texi headerdirs.texi funding.texi \
eae7da65 2794 gnu.texi gpl_v3.texi fdl.texi contrib.texi languages.texi \
93d414c9 2795 sourcebuild.texi gty.texi libgcc.texi cfg.texi tree-ssa.texi \
33ef0630 2796 loop.texi generic.texi gimple.texi plugins.texi
089f59b9 2797
3a8843c6 2798TEXI_GCCINSTALL_FILES = install.texi install-old.texi fdl.texi \
ac30c31e 2799 gcc-common.texi gcc-vers.texi
089f59b9 2800
1af67e62 2801TEXI_CPPINT_FILES = cppinternals.texi gcc-common.texi gcc-vers.texi
2802
2803# gcc-vers.texi is generated from the version files.
2804gcc-vers.texi: $(BASEVER) $(DEVPHASE)
2805 (echo "@set version-GCC $(BASEVER_c)"; \
2806 if [ "$(DEVPHASE_c)" = "experimental" ]; \
2807 then echo "@set DEVELOPMENT"; \
2808 else echo "@clear DEVELOPMENT"; \
2809 fi) > $@T
fbf9447e 2810 $(build_file_translate) echo @set srcdir $(abs_srcdir) >> $@T
d25dc80e 2811 if [ -n "$(PKGVERSION)" ]; then \
2812 echo "@set VERSION_PACKAGE $(PKGVERSION)" >> $@T; \
2813 fi
2814 echo "@set BUGURL $(BUGURL_TEXI)" >> $@T; \
1af67e62 2815 mv -f $@T $@
2816
089f59b9 2817
51f93521 2818# The *.1, *.7, *.info, *.dvi, and *.pdf files are being generated from implicit
08c53a6e 2819# patterns. To use them, put each of the specific targets with its
089f59b9 2820# specific dependencies but no build commands.
1f3233d1 2821
ca6eabd1 2822doc/cpp.info: $(TEXI_CPP_FILES)
2823doc/gcc.info: $(TEXI_GCC_FILES)
2824doc/gccint.info: $(TEXI_GCCINT_FILES)
2825doc/cppinternals.info: $(TEXI_CPPINT_FILES)
f1dfae08 2826
ca6eabd1 2827doc/%.info: %.texi
634d5d15 2828 if [ x$(BUILD_INFO) = xinfo ]; then \
77a85ce7 2829 $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \
2830 -I $(gcc_docdir)/include -o $@ $<; \
634d5d15 2831 fi
215d428d 2832
1e94fc11 2833# Duplicate entry to handle renaming of gccinstall.info
ca6eabd1 2834doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES)
1e94fc11 2835 if [ x$(BUILD_INFO) = xinfo ]; then \
77a85ce7 2836 $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \
2837 -I $(gcc_docdir)/include -o $@ $<; \
1e94fc11 2838 fi
2839
ca6eabd1 2840doc/cpp.dvi: $(TEXI_CPP_FILES)
2841doc/gcc.dvi: $(TEXI_GCC_FILES)
2842doc/gccint.dvi: $(TEXI_GCCINT_FILES)
2843doc/cppinternals.dvi: $(TEXI_CPPINT_FILES)
1e94fc11 2844
51f93521 2845doc/cpp.pdf: $(TEXI_CPP_FILES)
2846doc/gcc.pdf: $(TEXI_GCC_FILES)
2847doc/gccint.pdf: $(TEXI_GCCINT_FILES)
2848doc/cppinternals.pdf: $(TEXI_CPPINT_FILES)
2849
85690e4d 2850$(build_htmldir)/cpp/index.html: $(TEXI_CPP_FILES)
2851$(build_htmldir)/gcc/index.html: $(TEXI_GCC_FILES)
2852$(build_htmldir)/gccint/index.html: $(TEXI_GCCINT_FILES)
2853$(build_htmldir)/cppinternals/index.html: $(TEXI_CPPINT_FILES)
61a98835 2854
ca6eabd1 2855dvi:: doc/gcc.dvi doc/gccint.dvi doc/gccinstall.dvi doc/cpp.dvi \
352ea6ae 2856 doc/cppinternals.dvi lang.dvi
627defc4 2857
ca6eabd1 2858doc/%.dvi: %.texi
1af67e62 2859 $(TEXI2DVI) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
03217bce 2860
1e94fc11 2861# Duplicate entry to handle renaming of gccinstall.dvi
ca6eabd1 2862doc/gccinstall.dvi: $(TEXI_GCCINSTALL_FILES)
1af67e62 2863 $(TEXI2DVI) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
f1dfae08 2864
ba5147c6 2865PDFFILES = doc/gcc.pdf doc/gccint.pdf doc/gccinstall.pdf doc/cpp.pdf \
2866 doc/cppinternals.pdf
2867
2868pdf:: $(PDFFILES) lang.pdf
51f93521 2869
2870doc/%.pdf: %.texi
2871 $(TEXI2PDF) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
2872
2873# Duplicate entry to handle renaming of gccinstall.pdf
2874doc/gccinstall.pdf: $(TEXI_GCCINSTALL_FILES)
2875 $(TEXI2PDF) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
2876
18f327f7 2877# List the directories or single hmtl files which are installed by
2878# install-html. The lang.html file triggers language fragments to build
fb433b0b 2879# html documentation.
18f327f7 2880HTMLS_INSTALL=$(build_htmldir)/cpp $(build_htmldir)/gcc \
2881 $(build_htmldir)/gccinstall $(build_htmldir)/gccint \
2882 $(build_htmldir)/cppinternals
2883
2884# List the html file targets.
2885HTMLS_BUILD=$(build_htmldir)/cpp/index.html $(build_htmldir)/gcc/index.html \
85690e4d 2886 $(build_htmldir)/gccinstall/index.html $(build_htmldir)/gccint/index.html \
2887 $(build_htmldir)/cppinternals/index.html lang.html
61a98835 2888
18f327f7 2889html:: $(HTMLS_BUILD)
85690e4d 2890
2891$(build_htmldir)/%/index.html: %.texi
61a98835 2892 $(mkinstalldirs) $(@D)
2893 rm -f $(@D)/*
2894 $(TEXI2HTML) -I $(abs_docdir) -I $(abs_docdir)/include -o $(@D) $<
2895
2896# Duplicate entry to handle renaming of gccinstall
85690e4d 2897$(build_htmldir)/gccinstall/index.html: $(TEXI_GCCINSTALL_FILES)
61a98835 2898 $(mkinstalldirs) $(@D)
2899 echo rm -f $(@D)/*
120a0e58 2900 SOURCEDIR=$(abs_docdir) \
2901 DESTDIR=$(@D) \
2902 $(SHELL) $(srcdir)/doc/install.texi2html
61a98835 2903
ca6eabd1 2904MANFILES = doc/gcov.1 doc/cpp.1 doc/gcc.1 doc/gfdl.7 doc/gpl.7 doc/fsf-funding.7
2905
d3c27322 2906generated-manpages: man
b510ee9c 2907
2908man: $(MANFILES) lang.man @GENINSRC@ srcman lang.srcman
ca6eabd1 2909
2910srcman: $(MANFILES)
2911 -cp -p $^ $(srcdir)/doc
7534b8df 2912
ca6eabd1 2913doc/%.1: %.pod
81fea989 2914 $(STAMP) $@
089f59b9 2915 -($(POD2MAN) --section=1 $< > $(@).T$$$$ && \
81fea989 2916 mv -f $(@).T$$$$ $@) || \
2917 (rm -f $(@).T$$$$ && exit 1)
81fea989 2918
ca6eabd1 2919doc/%.7: %.pod
81fea989 2920 $(STAMP) $@
089f59b9 2921 -($(POD2MAN) --section=7 $< > $(@).T$$$$ && \
81fea989 2922 mv -f $(@).T$$$$ $@) || \
2923 (rm -f $(@).T$$$$ && exit 1)
089f59b9 2924
2925%.pod: %.texi
2926 $(STAMP) $@
d25dc80e 2927 -$(TEXI2POD) -DBUGURL="$(BUGURL_TEXI)" $< > $@
089f59b9 2928
2929.INTERMEDIATE: cpp.pod gcc.pod gfdl.pod fsf-funding.pod
2930cpp.pod: cpp.texi cppenv.texi cppopts.texi
2931
2932# These next rules exist because the output name is not the same as
08c53a6e 2933# the input name, so our implicit %.pod rule will not work.
089f59b9 2934
b475d084 2935gcc.pod: invoke.texi cppenv.texi cppopts.texi gcc-vers.texi
089f59b9 2936 $(STAMP) $@
2937 -$(TEXI2POD) $< > $@
2938gfdl.pod: fdl.texi
2939 $(STAMP) $@
2940 -$(TEXI2POD) $< > $@
2941fsf-funding.pod: funding.texi
2942 $(STAMP) $@
2943 -$(TEXI2POD) $< > $@
eae7da65 2944gpl.pod: gpl_v3.texi
2945 $(STAMP) $@
2946 -$(TEXI2POD) $< > $@
7a16ce2c 2947
2e9d8ccf 2948#\f
32e6d418 2949# Deletion of files made during compilation.
2950# There are four levels of this:
a8514488 2951# `mostlyclean', `clean', `distclean' and `maintainer-clean'.
32e6d418 2952# `mostlyclean' is useful while working on a particular type of machine.
c6396a0b 2953# It deletes most, but not all, of the files made by compilation.
32e6d418 2954# It does not delete libgcc.a or its parts, so it won't have to be recompiled.
c6396a0b 2955# `clean' deletes everything made by running `make all'.
79f818d0 2956# `distclean' also deletes the files made by config.
a8514488 2957# `maintainer-clean' also deletes everything that could be regenerated
1f42ecdc 2958# automatically, except for `configure'.
2959# We remove as much from the language subdirectories as we can
73027c94 2960# (less duplicated code).
32e6d418 2961
1e12d536 2962mostlyclean: lang.mostlyclean
e3ca137a 2963 -rm -f $(MOSTLYCLEANFILES)
e11ec584 2964 -rm -f *$(objext)
d5a37d75 2965 -rm -f *$(coverageexts)
524a54cf 2966# Delete build programs
2967 -rm -f build/*
96128417 2968 -rm -f mddeps.mk
997d68fe 2969# Delete other built files.
0bfbe373 2970 -rm -f specs.h options.c options.h options-save.c
997d68fe 2971# Delete the stamp and temporary files.
2972 -rm -f s-* tmp-* stamp-* stmp-*
73027c94 2973 -rm -f */stamp-* */tmp-*
c6396a0b 2974# Delete debugging dump files.
713a4057 2975 -rm -f *.[0-9][0-9].* */*.[0-9][0-9].*
c6396a0b 2976# Delete some files made during installation.
f2397fc4 2977 -rm -f specs $(SPECS)
f8d49ce1 2978 -rm -f collect collect2 mips-tfile mips-tdump
c6396a0b 2979# Delete unwanted output files from TeX.
2980 -rm -f *.toc *.log *.vr *.fn *.cp *.tp *.ky *.pg
73027c94 2981 -rm -f */*.toc */*.log */*.vr */*.fn */*.cp */*.tp */*.ky */*.pg
79f818d0 2982# Delete sorted indices we don't actually use.
2983 -rm -f gcc.vrs gcc.kys gcc.tps gcc.pgs gcc.fns
c6396a0b 2984# Delete core dumps.
73027c94 2985 -rm -f core */core
570af75a 2986# Delete file generated for gengtype
2987 -rm -f gtyp-input.list
463ae493 2988# Delete files generated by gengtype
776c30b8 2989 -rm -f gtype-*
2990 -rm -f gt-*
463ae493 2991 -rm -f gtype.state
f1035767 2992# Delete genchecksum outputs
2993 -rm -f *-checksum.c
be5f9e46 2994# Delete lock-and-run bits
2995 -rm -rf linkfe.lck lock-stamp.*
32e6d418 2996
79f818d0 2997# Delete all files made by compilation
2998# that don't exist in the distribution.
1e12d536 2999clean: mostlyclean lang.clean
ad8617cf 3000 -rm -f libgcc.a libgcc_eh.a libgcov.a
6fb158d1 3001 -rm -f libgcc_s*
8bdf23ae 3002 -rm -f libunwind*
022a2799 3003 -rm -f config.h tconfig.h bconfig.h tm_p.h tm.h
e8b212b8 3004 -rm -f options.c options.h optionlist
83b8e55b 3005 -rm -f cs-*
ca6eabd1 3006 -rm -f doc/*.dvi
51f93521 3007 -rm -f doc/*.pdf
6ea4242f 3008# Delete the include directories.
3009 -rm -rf include include-fixed
d73a48cc 3010# Delete files used by the "multilib" facility (including libgcc subdirs).
f1ad3130 3011 -rm -f multilib.h tmpmultilib*
d73a48cc 3012 -if [ "x$(MULTILIB_DIRNAMES)" != x ] ; then \
3013 rm -rf $(MULTILIB_DIRNAMES); \
3014 else if [ "x$(MULTILIB_OPTIONS)" != x ] ; then \
3015 rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \
3016 fi ; fi
32e6d418 3017
79f818d0 3018# Delete all files that users would normally create
3019# while building and installing GCC.
1e12d536 3020distclean: clean lang.distclean
83b8e55b 3021 -rm -f auto-host.h auto-build.h
ec255163 3022 -rm -f cstamp-h
1f42ecdc 3023 -rm -f config.status config.run config.cache config.bak
160b6fa9 3024 -rm -f Make-lang Make-hooks Make-host Make-target
48121e86 3025 -rm -f Makefile *.oaux
58febf9e 3026 -rm -f gthr-default.h
1576dec7 3027 -rm -f TAGS */TAGS
b541ad9d 3028 -rm -f *.asm
45e01ea1 3029 -rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak
48121e86 3030 -rm -f testsuite/*.log testsuite/*.sum
e0d053a6 3031 -cd testsuite && rm -f x *.x *.x? *.exe *.rpo *.o *.s *.S *.c
805e22b2 3032 -cd testsuite && rm -f *.out *.gcov *$(coverageexts)
7f52823c 3033 -rm -rf ${QMTEST_DIR} stamp-qmtest
883c44aa 3034 -rm -f cxxmain.c
210263ee 3035 -rm -f .gdbinit configargs.h
7534b8df 3036 -rm -f gcov.pod
48121e86 3037# Delete po/*.gmo only if we are not building in the source directory.
3038 -if [ ! -f po/exgettext ]; then rm -f po/*.gmo; fi
19bc000d 3039 -rmdir ada cp f java objc intl po testsuite plugin 2>/dev/null
c6396a0b 3040
1f42ecdc 3041# Get rid of every file that's generated from some other file, except for `configure'.
32e6d418 3042# Most of these files ARE PRESENT in the GCC distribution.
1f42ecdc 3043maintainer-clean:
3044 @echo 'This command is intended for maintainers to use; it'
3045 @echo 'deletes files that may need special tools to rebuild.'
1e12d536 3046 $(MAKE) lang.maintainer-clean distclean
c94ba072 3047 -rm -f cpp.??s cpp.*aux
3048 -rm -f gcc.??s gcc.*aux
51f93521 3049 -rm -f $(gcc_docdir)/*.info $(gcc_docdir)/*.1 $(gcc_docdir)/*.7 $(gcc_docdir)/*.dvi $(gcc_docdir)/*.pdf
2e9d8ccf 3050#\f
2b7a4d59 3051# Entry points `install', `install-strip', and `uninstall'.
c6396a0b 3052# Also use `install-collect2' to install collect2 when the config files don't.
32e6d418 3053
2cfd79fe 3054# Copy the compiler files into directories where they will be run.
62268150 3055# Install the driver last so that the window when things are
3056# broken is small.
894a47b4 3057install: install-common $(INSTALL_HEADERS) \
1e12d536 3058 install-cpp install-man install-info install-@POSUB@ \
46215dc9 3059 install-driver install-lto-wrapper install-gcc-ar
32e6d418 3060
912f2b18 3061ifeq ($(enable_plugin),yes)
3062install: install-plugin
3063endif
3064
2b7a4d59 3065install-strip: override INSTALL_PROGRAM = $(INSTALL_STRIP_PROGRAM)
3066ifneq ($(STRIP),)
3067install-strip: STRIPPROG = $(STRIP)
3068export STRIPPROG
3069endif
3070install-strip: install
3071
3e2f90b9 3072# Handle cpp installation.
87b6be85 3073install-cpp: installdirs cpp$(exeext)
994974c8 3074 -rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext)
3075 -$(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext)
3076 -if [ x$(cpp_install_dir) != x ]; then \
3077 rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
3078 $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
3079 else true; fi
3e2f90b9 3080
0d5bce1b 3081# Create the installation directories.
9db45a87 3082# $(libdir)/gcc/include isn't currently searched by cpp.
0d5bce1b 3083installdirs:
ca08f0d3 3084 $(mkinstalldirs) $(DESTDIR)$(libsubdir)
3085 $(mkinstalldirs) $(DESTDIR)$(libexecsubdir)
3086 $(mkinstalldirs) $(DESTDIR)$(bindir)
3087 $(mkinstalldirs) $(DESTDIR)$(includedir)
3088 $(mkinstalldirs) $(DESTDIR)$(infodir)
ca08f0d3 3089 $(mkinstalldirs) $(DESTDIR)$(man1dir)
3090 $(mkinstalldirs) $(DESTDIR)$(man7dir)
32e6d418 3091
912f2b18 3092PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
92468061 3093 toplev.h $(DIAGNOSTIC_CORE_H) $(BASIC_BLOCK_H) $(GIMPLE_H) $(TREE_PASS_H) $(GCC_PLUGIN_H) \
eb3dd80d 3094 $(GGC_H) $(TREE_DUMP_H) $(PRETTY_PRINT_H) $(OPTS_H) $(PARAMS_H) \
a933e912 3095 $(tm_file_list) $(tm_include_list) $(tm_p_file_list) $(tm_p_include_list) \
3096 $(host_xm_file_list) $(host_xm_include_list) $(xm_include_list) \
02ea0cd9 3097 intl.h $(PLUGIN_VERSION_H) $(DIAGNOSTIC_H) ${C_TREE_H} \
6c536c4f 3098 $(C_COMMON_H) c-family/c-objc.h $(C_PRETTY_PRINT_H) \
69ee5dbb 3099 tree-iterator.h $(PLUGIN_H) $(TREE_SSA_H) langhooks.h incpath.h debug.h \
596981c8 3100 $(EXCEPT_H) tree-ssa-sccvn.h real.h output.h $(IPA_UTILS_H) \
1118ebc8 3101 $(C_PRAGMA_H) $(CPPLIB_H) $(FUNCTION_H) \
c34d1545 3102 cppdefault.h flags.h $(MD5_H) params.def params.h prefix.h tree-inline.h \
eb3dd80d 3103 $(GIMPLE_PRETTY_PRINT_H) realmpfr.h \
86642a49 3104 $(IPA_PROP_H) $(TARGET_H) $(RTL_H) $(TM_P_H) $(CFGLOOP_H) $(EMIT_RTL_H) \
3105 version.h
912f2b18 3106
c9036234 3107# generate the 'build fragment' b-header-vars
3108s-header-vars: Makefile
3109 rm -f tmp-header-vars
136fa403 3110# The first sed gets the list "header variables" as the list variables
3111# assigned in Makefile and having _H at the end of the name. "sed -n" proved
3112# more portable than a trailing "-e d" to filter out the uninteresting lines,
3113# in particular on ia64-hpux where "s/.../p" only prints if -n was requested
3114# as well.
3115 $(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;) \
c9036234 3116 $(SHELL) $(srcdir)/../move-if-change tmp-header-vars b-header-vars
3117 $(STAMP) s-header-vars
3118
6d70c713 3119# Install gengtype
3120install-gengtype: installdirs gengtype$(exeext) gtype.state
3121 $(mkinstalldirs) $(DESTDIR)$(plugin_resourcesdir)
3122 $(INSTALL_DATA) gtype.state $(DESTDIR)$(plugin_resourcesdir)/gtype.state
3123 $(mkinstalldirs) $(DESTDIR)$(plugin_bindir)
3124 $(INSTALL_PROGRAM) gengtype$(exeext) $(DESTDIR)$(plugin_bindir)/gengtype$(exeext)
3125
912f2b18 3126# Install the headers needed to build a plugin.
6d70c713 3127install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype
6ee97920 3128# We keep the directory structure for files in config or c-family and .def
3129# files. All other files are flattened to a single directory.
912f2b18 3130 $(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
f5763863 3131 headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`; \
537bb6bf 3132 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \
912f2b18 3133 for file in $$headers; do \
3134 if [ -f $$file ] ; then \
3135 path=$$file; \
3136 elif [ -f $(srcdir)/$$file ]; then \
3137 path=$(srcdir)/$$file; \
3138 else continue; \
3139 fi; \
3140 case $$path in \
6ee97920 3141 "$(srcdir)"/config/* | "$(srcdir)"/c-family/* | "$(srcdir)"/*.def ) \
b3c73487 3142 base=`echo "$$path" | sed -e "s|$$srcdirstrip/||"`;; \
912f2b18 3143 *) base=`basename $$path` ;; \
3144 esac; \
3145 dest=$(plugin_includedir)/$$base; \
19b30c2a 3146 echo $(INSTALL_DATA) $$path $(DESTDIR)$$dest; \
912f2b18 3147 dir=`dirname $$dest`; \
19b30c2a 3148 $(mkinstalldirs) $(DESTDIR)$$dir; \
3149 $(INSTALL_DATA) $$path $(DESTDIR)$$dest; \
912f2b18 3150 done
c9036234 3151 $(INSTALL_DATA) b-header-vars $(DESTDIR)$(plugin_includedir)/b-header-vars
912f2b18 3152
32e6d418 3153# Install the compiler executables built during cross compilation.
894a47b4 3154install-common: native lang.install-common installdirs
32e6d418 3155 for file in $(COMPILERS); do \
3156 if [ -f $$file ] ; then \
9db45a87 3157 rm -f $(DESTDIR)$(libexecsubdir)/$$file; \
3158 $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libexecsubdir)/$$file; \
32e6d418 3159 else true; \
3160 fi; \
3161 done
7151decb 3162 for file in $(EXTRA_PROGRAMS) $(COLLECT2) ..; do \
32e6d418 3163 if [ x"$$file" != x.. ]; then \
9db45a87 3164 rm -f $(DESTDIR)$(libexecsubdir)/$$file; \
3165 $(INSTALL_PROGRAM) $$file $(DESTDIR)$(libexecsubdir)/$$file; \
32e6d418 3166 else true; fi; \
3167 done
f394bd30 3168# We no longer install the specs file because its presence makes the
3169# driver slower, and because people who need it can recreate it by
3170# using -dumpspecs. We remove any old version because it would
3171# otherwise override the specs built into the driver.
f987497d 3172 rm -f $(DESTDIR)$(libsubdir)/specs
e2a2be99 3173# Install gcov if it was compiled.
2b55270a 3174 -if [ -f gcov$(exeext) ]; \
3175 then \
931f506f 3176 rm -f $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext); \
36f95905 3177 $(INSTALL_PROGRAM) gcov$(exeext) $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext); \
2b55270a 3178 fi
62268150 3179
d3c27322 3180# Install the driver program as $(target_noncanonical)-gcc,
955edcde 3181# $(target_noncanonical)-gcc-$(version), and also as gcc if native.
414d46fe 3182install-driver: installdirs xgcc$(exeext)
994974c8 3183 -rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
3184 -$(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
83e5b8a1 3185 -rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)$(exeext)
994974c8 3186 -( cd $(DESTDIR)$(bindir) && \
83e5b8a1 3187 $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-$(version)$(exeext) )
955edcde 3188 -if [ ! -f gcc-cross$(exeext) ] ; then \
d58156a1 3189 rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-tmp$(exeext); \
36f95905 3190 ( cd $(DESTDIR)$(bindir) && \
d58156a1 3191 $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-tmp$(exeext) && \
3192 mv -f $(target_noncanonical)-gcc-tmp$(exeext) $(GCC_TARGET_INSTALL_NAME)$(exeext) ); \
32e6d418 3193 fi
32e6d418 3194
a2aa0fc1 3195# Install the info files.
dff6b323 3196# $(INSTALL_DATA) might be a relative pathname, so we can't cd into srcdir
509d95a7 3197# to do the install.
e9d2d60f 3198install-info:: doc installdirs \
3199 $(DESTDIR)$(infodir)/cpp.info \
3200 $(DESTDIR)$(infodir)/gcc.info \
3201 $(DESTDIR)$(infodir)/cppinternals.info \
c5d817c0 3202 $(DESTDIR)$(infodir)/gccinstall.info \
352ea6ae 3203 $(DESTDIR)$(infodir)/gccint.info \
3204 lang.install-info
e9d2d60f 3205
ca6eabd1 3206$(DESTDIR)$(infodir)/%.info: doc/%.info installdirs
e9d2d60f 3207 rm -f $@
3208 if [ -f $< ]; then \
3209 for f in $(<)*; do \
c94ba072 3210 realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
36f95905 3211 $(INSTALL_DATA) $$f $(DESTDIR)$(infodir)/$$realfile; \
47743619 3212 chmod a-x $(DESTDIR)$(infodir)/$$realfile; \
c94ba072 3213 done; \
3214 else true; fi
509d95a7 3215 -if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
50ef8532 3216 if [ -f $@ ]; then \
3217 install-info --dir-file=$(DESTDIR)$(infodir)/dir $@; \
530e88cf 3218 else true; fi; \
89980492 3219 else true; fi;
a2aa0fc1 3220
ba5147c6 3221pdf__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
3222
3223install-pdf: $(PDFFILES) lang.install-pdf
3224 @$(NORMAL_INSTALL)
3225 test -z "$(pdfdir)/gcc" || $(mkinstalldirs) "$(DESTDIR)$(pdfdir)/gcc"
3226 @list='$(PDFFILES)'; for p in $$list; do \
3227 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
3228 f=$(pdf__strip_dir) \
3229 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/gcc/$$f'"; \
3230 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/gcc/$$f"; \
3231 done
3232
18f327f7 3233html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
32abc985 3234
fb433b0b 3235install-html: $(HTMLS_BUILD) lang.install-html
18f327f7 3236 @$(NORMAL_INSTALL)
581a3a99 3237 test -z "$(htmldir)" || $(mkinstalldirs) "$(DESTDIR)$(htmldir)"
18f327f7 3238 @list='$(HTMLS_INSTALL)'; for p in $$list; do \
3239 if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
3240 f=$(html__strip_dir) \
3241 if test -d "$$d$$p"; then \
581a3a99 3242 echo " $(mkinstalldirs) '$(DESTDIR)$(htmldir)/$$f'"; \
3243 $(mkinstalldirs) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
18f327f7 3244 echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
3245 $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
3246 else \
3247 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
3248 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
3249 fi; \
3250 done
3251
32e6d418 3252# Install the man pages.
01ac74a6 3253install-man: lang.install-man \
ca6eabd1 3254 $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext) \
f0738865 3255 $(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext) \
3256 $(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext) \
ca6eabd1 3257 $(DESTDIR)$(man7dir)/fsf-funding$(man7ext) \
3258 $(DESTDIR)$(man7dir)/gfdl$(man7ext) \
3259 $(DESTDIR)$(man7dir)/gpl$(man7ext)
3260
01ac74a6 3261$(DESTDIR)$(man7dir)/%$(man7ext): doc/%.7 installdirs
ca6eabd1 3262 -rm -f $@
3263 -$(INSTALL_DATA) $< $@
3264 -chmod a-x $@
3265
01ac74a6 3266$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext): doc/gcc.1 installdirs
ca6eabd1 3267 -rm -f $@
d3c27322 3268 -$(INSTALL_DATA) $< $@
ca6eabd1 3269 -chmod a-x $@
3270
01ac74a6 3271$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext): doc/cpp.1 installdirs
f0738865 3272 -rm -f $@
d3c27322 3273 -$(INSTALL_DATA) $< $@
f0738865 3274 -chmod a-x $@
3275
01ac74a6 3276$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): doc/gcov.1 installdirs
ca6eabd1 3277 -rm -f $@
d3c27322 3278 -$(INSTALL_DATA) $< $@
ca6eabd1 3279 -chmod a-x $@
32e6d418 3280
2cfd79fe 3281# Install all the header files built in the include subdirectory.
c872ef71 3282install-headers: $(INSTALL_HEADERS_DIR)
2cfd79fe 3283# Fix symlinks to absolute paths in the installed include directory to
3284# point to the installed directory, not the build directory.
ea4a6c81 3285# Don't need to use LN_S here since we really do need ln -s and no substitutes.
d3036f42 3286 -files=`cd $(DESTDIR)$(libsubdir)/include-fixed; find . -type l -print 2>/dev/null`; \
2cfd79fe 3287 if [ $$? -eq 0 ]; then \
d3036f42 3288 dir=`cd include-fixed; ${PWD_COMMAND}`; \
2cfd79fe 3289 for i in $$files; do \
d3036f42 3290 dest=`ls -ld $(DESTDIR)$(libsubdir)/include-fixed/$$i | sed -n 's/.*-> //p'`; \
2cfd79fe 3291 if expr "$$dest" : "$$dir.*" > /dev/null; then \
d3036f42 3292 rm -f $(DESTDIR)$(libsubdir)/include-fixed/$$i; \
3293 ln -s `echo $$i | sed "s|/[^/]*|/..|g" | sed 's|/..$$||'``echo "$$dest" | sed "s|$$dir||"` $(DESTDIR)$(libsubdir)/include-fixed/$$i; \
2cfd79fe 3294 fi; \
3295 done; \
3296 fi
32e6d418 3297
2cfd79fe 3298# Create or recreate the gcc private include file directory.
0d5bce1b 3299install-include-dir: installdirs
32abc985 3300 $(mkinstalldirs) $(DESTDIR)$(libsubdir)/include
d3036f42 3301 -rm -rf $(DESTDIR)$(libsubdir)/include-fixed
d3036f42 3302 mkdir $(DESTDIR)$(libsubdir)/include-fixed
d3036f42 3303 -chmod a+rx $(DESTDIR)$(libsubdir)/include-fixed
2cfd79fe 3304
ff84d87f 3305# Create or recreate the install-tools include file directory.
3306itoolsdir = $(libexecsubdir)/install-tools
3307itoolsdatadir = $(libsubdir)/install-tools
3308install-itoolsdirs: installdirs
3309 $(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include
3310 $(mkinstalldirs) $(DESTDIR)$(itoolsdir)
3311
2cfd79fe 3312# Install the include directory using tar.
f2397fc4 3313install-headers-tar: stmp-int-hdrs install-include-dir
aa2760ef 3314# We use `pwd`/include instead of just include to problems with CDPATH
3315# Unless a full pathname is provided, some shells would print the new CWD,
3316# found in CDPATH, corrupting the output. We could just redirect the
3317# output of `cd', but some shells lose on redirection within `()'s
7a8ca04a 3318 (cd `${PWD_COMMAND}`/include ; \
36f95905 3319 tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include; tar xpf - )
d3036f42 3320 (cd `${PWD_COMMAND}`/include-fixed ; \
3321 tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include-fixed; tar xpf - )
16db1e2d 3322# /bin/sh on some systems returns the status of the first tar,
3323# and that can lose with GNU tar which always writes a full block.
3324# So use `exit 0' to ignore its exit status.
2cfd79fe 3325
3326# Install the include directory using cpio.
f2397fc4 3327install-headers-cpio: stmp-int-hdrs install-include-dir
aa2760ef 3328# See discussion about the use of `pwd` above
7a8ca04a 3329 cd `${PWD_COMMAND}`/include ; \
36f95905 3330 find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include
d3036f42 3331 cd `${PWD_COMMAND}`/include-fixed ; \
3332 find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include-fixed
32e6d418 3333
ffe38693 3334# Install the include directory using cp.
f2397fc4 3335install-headers-cp: stmp-int-hdrs install-include-dir
36f95905 3336 cp -p -r include $(DESTDIR)$(libsubdir)
d3036f42 3337 cp -p -r include-fixed $(DESTDIR)$(libsubdir)
ffe38693 3338
ccdd426b 3339# Targets without dependencies, for use in prev-gcc during bootstrap.
3340real-install-headers-tar:
d3036f42 3341 (cd `${PWD_COMMAND}`/include-fixed ; \
3342 tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include-fixed; tar xpf - )
ccdd426b 3343
3344real-install-headers-cpio:
d3036f42 3345 cd `${PWD_COMMAND}`/include-fixed ; \
3346 find . -print | cpio -pdum $(DESTDIR)$(libsubdir)/include-fixed
ccdd426b 3347
3348real-install-headers-cp:
d3036f42 3349 cp -p -r include-fixed $(DESTDIR)$(libsubdir)
ccdd426b 3350
50e7e370 3351# Install supporting files for fixincludes to be run later.
f2397fc4 3352install-mkheaders: stmp-int-hdrs install-itoolsdirs \
6ea4242f 3353 macro_list fixinc_list
50e7e370 3354 $(INSTALL_DATA) $(srcdir)/gsyslimits.h \
3355 $(DESTDIR)$(itoolsdatadir)/gsyslimits.h
3356 $(INSTALL_DATA) macro_list $(DESTDIR)$(itoolsdatadir)/macro_list
6ea4242f 3357 $(INSTALL_DATA) fixinc_list $(DESTDIR)$(itoolsdatadir)/fixinc_list
3358 set -e; for ml in `cat fixinc_list`; do \
3359 multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
3360 $(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}; \
3361 $(INSTALL_DATA) include-fixed$${multidir}/limits.h $(DESTDIR)$(itoolsdatadir)/include$${multi_dir}/limits.h; \
3362 done
3363 $(INSTALL_SCRIPT) $(srcdir)/../mkinstalldirs \
36f95905 3364 $(DESTDIR)$(itoolsdir)/mkinstalldirs ; \
6ea4242f 3365 sysroot_headers_suffix='$${sysroot_headers_suffix}'; \
3366 echo 'SYSTEM_HEADER_DIR="'"$(SYSTEM_HEADER_DIR)"'"' \
9db45a87 3367 > $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
336ff1b3 3368 echo 'OTHER_FIXINCLUDES_DIRS="$(OTHER_FIXINCLUDES_DIRS)"' \
9db45a87 3369 >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
9db45a87 3370 echo 'STMP_FIXINC="$(STMP_FIXINC)"' \
3371 >> $(DESTDIR)$(itoolsdatadir)/mkheaders.conf
336ff1b3 3372
0c787992 3373# Use this target to install the program `collect2' under the name `collect2'.
0d5bce1b 3374install-collect2: collect2 installdirs
9db45a87 3375 $(INSTALL_PROGRAM) collect2$(exeext) $(DESTDIR)$(libexecsubdir)/collect2$(exeext)
c6396a0b 3376# Install the driver program as $(libsubdir)/gcc for collect2.
9db45a87 3377 $(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(libexecsubdir)/gcc$(exeext)
c6396a0b 3378
7bfefa9d 3379# Install lto-wrapper.
3380install-lto-wrapper: lto-wrapper$(exeext)
3381 $(INSTALL_PROGRAM) lto-wrapper$(exeext) $(DESTDIR)$(libexecsubdir)/lto-wrapper$(exeext)
329786f7 3382
3f9e8673 3383install-gcc-ar: installdirs gcc-ar$(exeext) gcc-nm$(exeext) gcc-ranlib$(exeext)
3384 for i in gcc-ar gcc-nm gcc-ranlib; do \
3385 install_name=`echo $$i|sed '$(program_transform_name)'` ;\
3386 target_install_name=$(target_noncanonical)-`echo $$i|sed '$(program_transform_name)'` ; \
3387 rm -f $(DESTDIR)$(bindir)/$$install_name$(exeext) ; \
3388 $(INSTALL_PROGRAM) $$i$(exeext) $(DESTDIR)$(bindir)/$$install_name$(exeext) ;\
3389 if test -f gcc-cross$(exeext); then \
46215dc9 3390 :; \
3391 else \
3f9e8673 3392 rm -f $(DESTDIR)$(bindir)/$$target_install_name$(exeext); \
46215dc9 3393 ( cd $(DESTDIR)$(bindir) && \
3f9e8673 3394 $(LN) $$install_name$(exeext) $$target_install_name$(exeext) ) ; \
46215dc9 3395 fi ; \
3396 done
3397
32e6d418 3398# Cancel installation by deleting the installed files.
1e12d536 3399uninstall: lang.uninstall
36f95905 3400 -rm -rf $(DESTDIR)$(libsubdir)
9db45a87 3401 -rm -rf $(DESTDIR)$(libexecsubdir)
36f95905 3402 -rm -rf $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
36f95905 3403 -rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext)
caa6c567 3404 -if [ x$(cpp_install_dir) != x ]; then \
36f95905 3405 rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
caa6c567 3406 else true; fi
36f95905 3407 -rm -rf $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext)
3408 -rm -rf $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext)
36f95905 3409 -rm -rf $(DESTDIR)$(man1dir)/cpp$(man1ext)
36f95905 3410 -rm -f $(DESTDIR)$(infodir)/cpp.info* $(DESTDIR)$(infodir)/gcc.info*
3411 -rm -f $(DESTDIR)$(infodir)/cppinternals.info* $(DESTDIR)$(infodir)/gccint.info*
46215dc9 3412 for i in ar nm ranlib ; do \
3413 install_name=`echo gcc-$$i|sed '$(program_transform_name)'`$(exeext) ;\
3414 target_install_name=$(target_noncanonical)-`echo gcc-$$i|sed '$(program_transform_name)'`$(exeext) ; \
3415 rm -f $(DESTDIR)$(bindir)/$$install_name ; \
3416 rm -f $(DESTDIR)$(bindir)/$$target_install_name ; \
3417 done
2e9d8ccf 3418#\f
c6221df9 3419# These targets are for the dejagnu testsuites. The file site.exp
6c08487b 3420# contains global variables that all the testsuites will use.
3421
6c08487b 3422target_subdir = @target_subdir@
3423
3424site.exp: ./config.status Makefile
3425 @echo "Making a new config file..."
a49d1bae 3426 -@rm -f ./site.tmp
5ec97d31 3427 @$(STAMP) site.exp
6c08487b 3428 -@mv site.exp site.bak
a49d1bae 3429 @echo "## these variables are automatically generated by make ##" > ./site.tmp
3430 @echo "# Do not edit here. If you wish to override these values" >> ./site.tmp
3431 @echo "# add them to the last section" >> ./site.tmp
3432 @echo "set rootme \"`${PWD_COMMAND}`\"" >> ./site.tmp
3433 @echo "set srcdir \"`cd ${srcdir}; ${PWD_COMMAND}`\"" >> ./site.tmp
3434 @echo "set host_triplet $(host)" >> ./site.tmp
3435 @echo "set build_triplet $(build)" >> ./site.tmp
3436 @echo "set target_triplet $(target)" >> ./site.tmp
3437 @echo "set target_alias $(target_noncanonical)" >> ./site.tmp
3438 @echo "set libiconv \"$(LIBICONV)\"" >> ./site.tmp
6c08487b 3439# CFLAGS is set even though it's empty to show we reserve the right to set it.
a49d1bae 3440 @echo "set CFLAGS \"\"" >> ./site.tmp
3441 @echo "set CXXFLAGS \"\"" >> ./site.tmp
3442 @echo "set HOSTCC \"$(CC)\"" >> ./site.tmp
3443 @echo "set HOSTCFLAGS \"$(CFLAGS)\"" >> ./site.tmp
224d9f3d 3444# TEST_ALWAYS_FLAGS are flags that should be passed to every compilation.
3445# They are passed first to allow individual tests to override them.
3446 @echo "set TEST_ALWAYS_FLAGS \"$(SYSROOT_CFLAGS_FOR_TARGET)\"" >> ./site.tmp
c158ae09 3447# When running the tests we set GCC_EXEC_PREFIX to the install tree so that
3448# files that have already been installed there will be found. The -B option
3449# overrides it, so use of GCC_EXEC_PREFIX will not result in using GCC files
3450# from the install tree.
a49d1bae 3451 @echo "set TEST_GCC_EXEC_PREFIX \"$(libdir)/gcc/\"" >> ./site.tmp
3452 @echo "set TESTING_IN_BUILD_TREE 1" >> ./site.tmp
3453 @echo "set HAVE_LIBSTDCXX_V3 1" >> ./site.tmp
9227b6fc 3454 @if test "@enable_plugin@" = "yes" ; then \
a49d1bae 3455 echo "set ENABLE_PLUGIN 1" >> ./site.tmp; \
3456 echo "set PLUGINCC \"$(PLUGINCC)\"" >> ./site.tmp; \
3457 echo "set PLUGINCFLAGS \"$(PLUGINCFLAGS)\"" >> ./site.tmp; \
3458 echo "set GMPINC \"$(GMPINC)\"" >> ./site.tmp; \
9227b6fc 3459 fi
7bfefa9d 3460 @if test "@enable_lto@" = "yes" ; then \
a49d1bae 3461 echo "set ENABLE_LTO 1" >> ./site.tmp; \
7bfefa9d 3462 fi
6c08487b 3463# If newlib has been configured, we need to pass -B to gcc so it can find
3464# newlib's crt0.o if it exists. This will cause a "path prefix not used"
3465# message if it doesn't, but the testsuite is supposed to ignore the message -
3466# it's too difficult to tell when to and when not to pass -B (not all targets
3467# have crt0's). We could only add the -B if ../newlib/crt0.o exists, but that
3468# seems like too selective a test.
3469# ??? Another way to solve this might be to rely on linker scripts. Then
3470# theoretically the -B won't be needed.
3471# We also need to pass -L ../ld so that the linker can find ldscripts.
109d4e8d 3472 @if [ -d $(objdir)/../$(target_subdir)/newlib ] \
4f442f07 3473 && [ "${host}" != "${target}" ]; then \
a49d1bae 3474 echo "set newlib_cflags \"-I$(objdir)/../$(target_subdir)/newlib/targ-include -I\$$srcdir/../newlib/libc/include\"" >> ./site.tmp; \
3475 echo "set newlib_ldflags \"-B$(objdir)/../$(target_subdir)/newlib/\"" >> ./site.tmp; \
3476 echo "append CFLAGS \" \$$newlib_cflags\"" >> ./site.tmp; \
3477 echo "append CXXFLAGS \" \$$newlib_cflags\"" >> ./site.tmp; \
3478 echo "append LDFLAGS \" \$$newlib_ldflags\"" >> ./site.tmp; \
6c08487b 3479 else true; \
3480 fi
3481 @if [ -d $(objdir)/../ld ] ; then \
a49d1bae 3482 echo "append LDFLAGS \" -L$(objdir)/../ld\"" >> ./site.tmp; \
6c08487b 3483 else true; \
3484 fi
a49d1bae 3485 echo "set tmpdir $(objdir)/testsuite" >> ./site.tmp
3486 @echo "set srcdir \"\$${srcdir}/testsuite\"" >> ./site.tmp
2a04f36a 3487 @if [ "X$(ALT_CC_UNDER_TEST)" != "X" ] ; then \
a49d1bae 3488 echo "set ALT_CC_UNDER_TEST \"$(ALT_CC_UNDER_TEST)\"" >> ./site.tmp; \
2a04f36a 3489 else true; \
3490 fi
9745a094 3491 @if [ "X$(ALT_CXX_UNDER_TEST)" != "X" ] ; then \
a49d1bae 3492 echo "set ALT_CXX_UNDER_TEST \"$(ALT_CXX_UNDER_TEST)\"" >> ./site.tmp; \
9745a094 3493 else true; \
3494 fi
3495 @if [ "X$(COMPAT_OPTIONS)" != "X" ] ; then \
a49d1bae 3496 echo "set COMPAT_OPTIONS \"$(COMPAT_OPTIONS)\"" >> ./site.tmp; \
9745a094 3497 else true; \
3498 fi
a49d1bae 3499 @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./site.tmp
3500 @cat ./site.tmp > site.exp
6c08487b 3501 @cat site.bak | sed \
3502 -e '1,/^## All variables above are.*##/ d' >> site.exp
a49d1bae 3503 -@rm -f ./site.tmp
6c08487b 3504
e53d55e7 3505CHECK_TARGETS = @check_languages@
21fa82cb 3506
6c08487b 3507check: $(CHECK_TARGETS)
3508
a0d20ccb 3509check-subtargets: $(patsubst %,%-subtargets,$(CHECK_TARGETS))
3510
567bfdbb 3511# The idea is to parallelize testing of multilibs, for example:
9469a2e2 3512# make -j3 check-gcc//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}
567bfdbb 3513# will run 3 concurrent sessions of check-gcc, eventually testing
3514# all 10 combinations. GNU make is required, as is a shell that expands
3515# alternations within braces.
71a3866b 3516lang_checks_parallel = $(lang_checks:=//%)
3517$(lang_checks_parallel): site.exp
9469a2e2 3518 target=`echo "$@" | sed 's,//.*,,'`; \
3519 variant=`echo "$@" | sed 's,^[^/]*//,,'`; \
567bfdbb 3520 vardots=`echo "$$variant" | sed 's,/,.,g'`; \
3521 $(MAKE) TESTSUITEDIR="testsuite.$$vardots" \
cb0b036f 3522 RUNTESTFLAGS="--target_board=$$variant $(RUNTESTFLAGS)" \
567bfdbb 3523 "$$target"
3524
3525TESTSUITEDIR = testsuite
3526
3527$(TESTSUITEDIR)/site.exp: site.exp
632ec442 3528 -test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR)
567bfdbb 3529 -rm -f $@
1b374b02 3530 sed '/set tmpdir/ s|testsuite$$|$(TESTSUITEDIR)|' < site.exp > $@
567bfdbb 3531
a0d20ccb 3532# This is only used for check-% targets that aren't parallelized.
3533$(filter-out $(lang_checks_parallelized),$(lang_checks)): check-% : site.exp
19bc000d 3534 -test -d plugin || mkdir plugin
632ec442 3535 -test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR)
6c24ebbe 3536 test -d $(TESTSUITEDIR)/$* || mkdir $(TESTSUITEDIR)/$*
7a8ca04a 3537 -(rootme=`${PWD_COMMAND}`; export rootme; \
3538 srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
6c24ebbe 3539 cd $(TESTSUITEDIR)/$*; \
3540 rm -f tmp-site.exp; \
1b374b02 3541 sed '/set tmpdir/ s|testsuite$$|$(TESTSUITEDIR)/$*|' \
6c24ebbe 3542 < ../../site.exp > tmp-site.exp; \
cadadacb 3543 $(SHELL) $${srcdir}/../move-if-change tmp-site.exp site.exp; \
5c872430 3544 EXPECT=${EXPECT} ; export EXPECT ; \
3545 if [ -f $${rootme}/../expect/expect ] ; then \
cadadacb 3546 TCL_LIBRARY=`cd .. ; cd $${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
5c872430 3547 export TCL_LIBRARY ; fi ; \
c061bf74 3548 $(RUNTEST) --tool $* $(RUNTESTFLAGS))
5c872430 3549
a0d20ccb 3550$(patsubst %,%-subtargets,$(filter-out $(lang_checks_parallelized),$(lang_checks))): check-%-subtargets:
3551 @echo check-$*
3552
3553check_p_tool=$(firstword $(subst _, ,$*))
3554check_p_vars=$(check_$(check_p_tool)_parallelize)
3555check_p_subno=$(word 2,$(subst _, ,$*))
3556check_p_comma=,
3557check_p_subwork=$(subst $(check_p_comma), ,$(if $(check_p_subno),$(word $(check_p_subno),$(check_p_vars))))
3558check_p_numbers=1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
3559check_p_subdir=$(subst _,,$*)
3560check_p_subdirs=$(wordlist 1,$(words $(check_$*_parallelize)),$(check_p_numbers))
3561
3562# For parallelized check-% targets, this decides whether parallelization
3563# is desirable (if -jN is used and RUNTESTFLAGS doesn't contain anything
a7313276 3564# but optional --target_board or --extra_opts arguments). If desirable,
a0d20ccb 3565# recursive make is run with check-parallel-$lang{,1,2,3,4,5} etc. goals,
3566# which can be executed in parallel, as they are run in separate directories.
3567# check-parallel-$lang{1,2,3,4,5} etc. goals invoke runtest with the longest
3568# running *.exp files from the testsuite, as determined by check_$lang_parallelize
3569# variable. The check-parallel-$lang goal in that case invokes runtest with
3570# all the remaining *.exp files not handled by the separate goals.
3571# Afterwards contrib/dg-extract-results.sh is used to merge the sum and log
3572# files. If parallelization isn't desirable, only one recursive make
3573# is run with check-parallel-$lang goal and check_$lang_parallelize variable
3574# cleared to say that no additional arguments beyond $(RUNTESTFLAGS)
3575# should be passed to runtest.
3576#
3577# To parallelize some language check, add the corresponding check-$lang
3578# to lang_checks_parallelized variable and define check_$lang_parallelize
3579# variable (see above check_gcc_parallelize description).
3580$(lang_checks_parallelized): check-% : site.exp
a7313276 3581 @if [ -z "$(filter-out --target_board=%,$(filter-out --extra_opts%,$(RUNTESTFLAGS)))" ] \
a0d20ccb 3582 && [ "$(filter -j, $(MFLAGS))" = "-j" ]; then \
cb0b036f 3583 $(MAKE) TESTSUITEDIR="$(TESTSUITEDIR)" RUNTESTFLAGS="$(RUNTESTFLAGS)" \
a0d20ccb 3584 check-parallel-$* \
3585 $(patsubst %,check-parallel-$*_%, $(check_p_subdirs)); \
3586 for file in $(TESTSUITEDIR)/$*/$* \
3587 $(patsubst %,$(TESTSUITEDIR)/$*%/$*,$(check_p_subdirs));\
3588 do \
3589 mv -f $$file.sum $$file.sum.sep; mv -f $$file.log $$file.log.sep; \
3590 done; \
3591 $(SHELL) $(srcdir)/../contrib/dg-extract-results.sh \
3592 $(TESTSUITEDIR)/$*/$*.sum.sep \
3593 $(patsubst %,$(TESTSUITEDIR)/$*%/$*.sum.sep,$(check_p_subdirs)) \
3594 > $(TESTSUITEDIR)/$*/$*.sum; \
3595 $(SHELL) $(srcdir)/../contrib/dg-extract-results.sh -L \
3596 $(TESTSUITEDIR)/$*/$*.log.sep \
3597 $(patsubst %,$(TESTSUITEDIR)/$*%/$*.log.sep,$(check_p_subdirs)) \
3598 > $(TESTSUITEDIR)/$*/$*.log; \
3599 else \
cb0b036f 3600 $(MAKE) TESTSUITEDIR="$(TESTSUITEDIR)" RUNTESTFLAGS="$(RUNTESTFLAGS)" \
a0d20ccb 3601 check_$*_parallelize= check-parallel-$*; \
3602 fi
3603
3604# Just print the parallelized subtargets for those that want to split
3605# the testing across machines.
3606$(patsubst %,%-subtargets,$(lang_checks_parallelized)): check-%-subtargets:
3607 @echo check-parallel-$* \
3608 $(patsubst %,check-parallel-$*_%, $(check_p_subdirs))
3609
3610# In the if [ -n "$(check_p_subno)" ] case runtest should be given the name of
3611# the given *.exp file(s). See comment above check_gcc_parallelize variable
3612# for details on the content of these variables.
3613#
3614# In the elif [ -n "$(check_p_vars)" ] case runtest should be given
3615# names of all the *.exp files for this tool that aren't already handled by
3616# other goals. First it finds all the *.exp files for this tool, then
3617# prunes those already specified in check_$lang_parallelize or duplicates.
3618#
3619# Otherwise check-$lang isn't parallelized and runtest is invoked just with
3620# the $(RUNTESTFLAGS) arguments.
3621check-parallel-% : site.exp
19bc000d 3622 -test -d plugin || mkdir plugin
a0d20ccb 3623 -test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR)
3624 test -d $(TESTSUITEDIR)/$(check_p_subdir) || mkdir $(TESTSUITEDIR)/$(check_p_subdir)
3625 -(rootme=`${PWD_COMMAND}`; export rootme; \
3626 srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
3627 cd $(TESTSUITEDIR)/$(check_p_subdir); \
3628 rm -f tmp-site.exp; \
1b374b02 3629 sed '/set tmpdir/ s|testsuite$$|$(TESTSUITEDIR)/$(check_p_subdir)|' \
a0d20ccb 3630 < ../../site.exp > tmp-site.exp; \
3631 $(SHELL) $${srcdir}/../move-if-change tmp-site.exp site.exp; \
3632 EXPECT=${EXPECT} ; export EXPECT ; \
3633 if [ -f $${rootme}/../expect/expect ] ; then \
3634 TCL_LIBRARY=`cd .. ; cd $${srcdir}/../tcl/library ; ${PWD_COMMAND}` ; \
3635 export TCL_LIBRARY ; fi ; \
a0d20ccb 3636 runtestflags= ; \
3637 if [ -n "$(check_p_subno)" ] ; then \
3638 runtestflags="$(check_p_subwork)"; \
3639 elif [ -n "$(check_p_vars)" ] ; then \
3640 parts="`echo ' $(strip $(subst $(check_p_comma), ,$(check_p_vars))) ' \
3641 | sed 's/=[^ ]* / /g'`"; \
3642 for part in `find $$srcdir/testsuite/$(check_p_tool)* -name \*.exp` ; do \
3643 part=`basename $$part` ; \
3644 case " $$parts $$runtestflags " in \
3645 *" $$part "*) ;; \
3646 *) runtestflags="$$runtestflags $$part" ;; \
3647 esac ; \
3648 done ; \
3649 fi ; \
3650 $(RUNTEST) --tool $(check_p_tool) $(RUNTESTFLAGS) $$runtestflags)
3651
7f52823c 3652# QMTest targets
3653
3654# The path to qmtest.
3655QMTEST_PATH=qmtest
3656
3657# The flags to pass to qmtest.
3658QMTESTFLAGS=
3659
3660# The flags to pass to "qmtest run".
cb770a56 3661QMTESTRUNFLAGS=-f none --result-stream dejagnu_stream.DejaGNUStream
7f52823c 3662
3663# The command to use to invoke qmtest.
3664QMTEST=${QMTEST_PATH} ${QMTESTFLAGS}
3665
3666# The tests (or suites) to run.
cb770a56 3667QMTEST_GPP_TESTS=g++
7f52823c 3668
3669# The subdirectory of the OBJDIR that will be used to store the QMTest
3670# test database configuration and that will be used for temporary
3671# scratch space during QMTest's execution.
2940220d 3672QMTEST_DIR=qmtestsuite
7f52823c 3673
3674# Create the QMTest database configuration.
3675${QMTEST_DIR} stamp-qmtest:
cb770a56 3676 ${QMTEST} -D ${QMTEST_DIR} create-tdb \
3677 -c gcc_database.GCCDatabase \
a0d20ccb 3678 -a srcdir=`cd ${srcdir}/testsuite && ${PWD_COMMAND}` && \
cb770a56 3679 $(STAMP) stamp-qmtest
7f52823c 3680
3681# Create the QMTest context file.
3682${QMTEST_DIR}/context: stamp-qmtest
cb770a56 3683 rm -f $@
3684 echo "CompilerTable.languages=c cplusplus" >> $@
3685 echo "CompilerTable.c_kind=GCC" >> $@
3686 echo "CompilerTable.c_path=${objdir}/xgcc" >> $@
3687 echo "CompilerTable.c_options=-B${objdir}/" >> $@
3688 echo "CompilerTable.cplusplus_kind=GCC" >> $@
3e54888f 3689 echo "CompilerTable.cplusplus_path=${objdir}/xg++" >> $@
cb770a56 3690 echo "CompilerTable.cplusplus_options=-B${objdir}/" >> $@
d58156a1 3691 echo "DejaGNUTest.target=${target_noncanonical}" >> $@
7f52823c 3692
3693# Run the G++ testsuite using QMTest.
cb770a56 3694qmtest-g++: ${QMTEST_DIR}/context
7f52823c 3695 cd ${QMTEST_DIR} && ${QMTEST} run ${QMTESTRUNFLAGS} -C context \
cb770a56 3696 -o g++.qmr ${QMTEST_GPP_TESTS}
7f52823c 3697
3698# Use the QMTest GUI.
3699qmtest-gui: ${QMTEST_DIR}/context
3700 cd ${QMTEST_DIR} && ${QMTEST} gui -C context
3701
7f52823c 3702.PHONY: qmtest-g++
3703
aa870c1b 3704# Run Paranoia on real.c.
3705
a7a46268 3706paranoia.o: $(srcdir)/../contrib/paranoia.cc $(CONFIG_H) $(SYSTEM_H) $(TREE_H)
dd350d42 3707 g++ -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $< $(OUTPUT_OPTION)
aa870c1b 3708
3709paranoia: paranoia.o real.o $(LIBIBERTY)
3710 g++ -o $@ paranoia.o real.o $(LIBIBERTY)
3711
32e6d418 3712# These exist for maintenance purposes.
3713
3714# Update the tags table.
c835a482 3715TAGS: lang.tags
39aebbc3 3716 (cd $(srcdir); \
3717 incs= ; \
3718 list='$(SUBDIRS)'; for dir in $$list; do \
3719 if test -f $$dir/TAGS; then \
3720 incs="$$incs --include $$dir/TAGS.sub"; \
3721 fi; \
3722 done; \
d44856e9 3723 etags -o TAGS.sub c-family/*.h c-family/*.c *.h *.c; \
39aebbc3 3724 etags --include TAGS.sub $$incs)
32e6d418 3725
f55a1a89 3726# -----------------------------------------------------
67881e18 3727# Rules for generating translated message descriptions.
3728# Disabled by autoconf if the tools are not available.
f55a1a89 3729# -----------------------------------------------------
67881e18 3730
3731XGETTEXT = @XGETTEXT@
3732GMSGFMT = @GMSGFMT@
3733MSGMERGE = msgmerge
49688a56 3734CATALOGS = $(patsubst %,po/%,@CATALOGS@)
67881e18 3735
c1fd6dd4 3736.PHONY: build- install- build-po install-po update-po
67881e18 3737
3738# Dummy rules to deal with dependencies produced by use of
3739# "build-@POSUB@" and "install-@POSUB@" above, when NLS is disabled.
3740build-: ; @true
3741install-: ; @true
3742
3743build-po: $(CATALOGS)
3744
3745# This notation should be acceptable to all Make implementations used
3746# by people who are interested in updating .po files.
3747update-po: $(CATALOGS:.gmo=.pox)
3748
48c772de 3749# N.B. We do not attempt to copy these into $(srcdir). The snapshot
3750# script does that.
67881e18 3751.po.gmo:
e7ae053d 3752 $(mkinstalldirs) po
7e5b3e48 3753 $(GMSGFMT) --statistics -o $@ $<
67881e18 3754
48c772de 3755# The new .po has to be gone over by hand, so we deposit it into
3756# build/po with a different extension.
1af67e62 3757# If build/po/gcc.pot exists, use it (it was just created),
428a0ce6 3758# else use the one in srcdir.
67881e18 3759.po.pox:
e7ae053d 3760 $(mkinstalldirs) po
1af67e62 3761 $(MSGMERGE) $< `if test -f po/gcc.pot; \
3762 then echo po/gcc.pot; \
3763 else echo $(srcdir)/po/gcc.pot; fi` -o $@
67881e18 3764
48c772de 3765# This rule has to look for .gmo modules in both srcdir and
3766# the cwd, and has to check that we actually have a catalog
3767# for each language, in case they weren't built or included
3768# with the distribution.
67881e18 3769install-po:
ca08f0d3 3770 $(mkinstalldirs) $(DESTDIR)$(datadir)
e34242a4 3771 cats="$(CATALOGS)"; for cat in $$cats; do \
48c772de 3772 lang=`basename $$cat | sed 's/\.gmo$$//'`; \
3773 if [ -f $$cat ]; then :; \
3774 elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \
3775 else continue; \
3776 fi; \
67881e18 3777 dir=$(localedir)/$$lang/LC_MESSAGES; \
ca08f0d3 3778 echo $(mkinstalldirs) $(DESTDIR)$$dir; \
3779 $(mkinstalldirs) $(DESTDIR)$$dir || exit 1; \
1af67e62 3780 echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \
3781 $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \
67881e18 3782 done
3783
3784# Rule for regenerating the message template (gcc.pot).
3785# Instead of forcing everyone to edit POTFILES.in, which proved impractical,
3786# this rule has no dependencies and always regenerates gcc.pot. This is
3787# relatively harmless since the .po files do not directly depend on it.
3788# Note that exgettext has an awk script embedded in it which requires a
3789# fairly modern (POSIX-compliant) awk.
428a0ce6 3790# The .pot file is left in the build directory.
1af67e62 3791gcc.pot: po/gcc.pot
b1fcce27 3792po/gcc.pot: force
e7ae053d 3793 $(mkinstalldirs) po
6bc11008 3794 $(MAKE) srcextra
67881e18 3795 AWK=$(AWK) $(SHELL) $(srcdir)/po/exgettext \
1af67e62 3796 $(XGETTEXT) gcc $(srcdir)
ea38f4be 3797
b8bd120b 3798#\f
3799
3800# Dependency information.
3801
ea38f4be 3802# In order for parallel make to really start compiling the expensive
3803# objects from $(OBJS) as early as possible, build all their
3804# prerequisites strictly before all objects.
3805$(ALL_HOST_OBJS) : | $(generated_files)
b8bd120b 3806
3807# Include the auto-generated dependencies for all host objects.
3808DEPFILES = \
3809 $(foreach obj,$(ALL_HOST_OBJS),\
3810 $(dir $(obj))$(DEPDIR)/$(patsubst %.o,%.Po,$(notdir $(obj))))
3811-include $(DEPFILES)