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