]> git.ipfire.org Git - thirdparty/gcc.git/blame - Makefile.tpl
Process new C++17 and C++20 headers with Doxygen
[thirdparty/gcc.git] / Makefile.tpl
CommitLineData
f507a3cb 1[+ AutoGen5 template -*- Mode: Makefile -*-
2a1ac811 2in
3+]
4
5# Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'.
6#
7# Makefile for directory with subdirs to build.
8# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
4dc4ff49 9# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
4b072aaf 10# Free Software Foundation
2a1ac811 11#
12# This file is free software; you can redistribute it and/or modify
13# it under the terms of the GNU General Public License as published by
4b072aaf 14# the Free Software Foundation; either version 3 of the License, or
2a1ac811 15# (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
4b072aaf 23# along with this program; see the file COPYING3. If not see
24# <http://www.gnu.org/licenses/>.
2a1ac811 25#
26
6e7d0937 27# First, test for a proper version of make, but only where one is required.
28
29@if gcc
30ifeq (,$(.VARIABLES)) # The variable .VARIABLES, new with 3.80, is never empty.
31$(error GNU make version 3.80 or newer is required.)
32endif
33@endif gcc
34
f7ca337f 35# -------------------------------
36# Standard Autoconf-set variables
37# -------------------------------
805e22b2 38VPATH=@srcdir@
805e22b2 39
b30fcfae 40build_alias=@build_noncanonical@
d45318b3 41build_vendor=@build_vendor@
42build_os=@build_os@
ab8cf29b 43build=@build@
b30fcfae 44host_alias=@host_noncanonical@
d45318b3 45host_vendor=@host_vendor@
46host_os=@host_os@
ab8cf29b 47host=@host@
b30fcfae 48target_alias=@target_noncanonical@
d45318b3 49target_vendor=@target_vendor@
50target_os=@target_os@
ab8cf29b 51target=@target@
805e22b2 52
f7ca337f 53program_transform_name = @program_transform_name@
0311ff84 54
55prefix = @prefix@
56exec_prefix = @exec_prefix@
57
f7ca337f 58srcdir = @srcdir@
59
0311ff84 60bindir = @bindir@
61sbindir = @sbindir@
62libexecdir = @libexecdir@
63datadir = @datadir@
64sysconfdir = @sysconfdir@
65sharedstatedir = @sharedstatedir@
66localstatedir = @localstatedir@
67libdir = @libdir@
68includedir = @includedir@
69oldincludedir = @oldincludedir@
70infodir = @infodir@
e0dbdbbf 71datarootdir = @datarootdir@
72docdir = @docdir@
130effca 73pdfdir = @pdfdir@
e0dbdbbf 74htmldir = @htmldir@
0311ff84 75mandir = @mandir@
2a1ac811 76man1dir = $(mandir)/man1
77man2dir = $(mandir)/man2
78man3dir = $(mandir)/man3
79man4dir = $(mandir)/man4
80man5dir = $(mandir)/man5
81man6dir = $(mandir)/man6
82man7dir = $(mandir)/man7
83man8dir = $(mandir)/man8
84man9dir = $(mandir)/man9
2a1ac811 85
450e6c84 86INSTALL = @INSTALL@
87INSTALL_PROGRAM = @INSTALL_PROGRAM@
88INSTALL_SCRIPT = @INSTALL_SCRIPT@
89INSTALL_DATA = @INSTALL_DATA@
599a3eac 90LN = @LN@
91LN_S = @LN_S@
57c7de11 92MAINT = @MAINT@
93MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
94MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
2a1ac811 95
f7ca337f 96# -------------------------------------------------
97# Miscellaneous non-standard autoconf-set variables
98# -------------------------------------------------
2a1ac811 99
f7ca337f 100# The gcc driver likes to know the arguments it was configured with.
101TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@
2a1ac811 102
f7ca337f 103tooldir = @tooldir@
104build_tooldir = @build_tooldir@
2a1ac811 105
f7ca337f 106# This is the name of the environment variable used for the path to
107# the libraries.
108RPATH_ENVVAR = @RPATH_ENVVAR@
2a1ac811 109
7d804f04 110# On targets where RPATH_ENVVAR is PATH, a subdirectory of the GCC build path
111# is used instead of the directory itself to avoid including built
112# executables in PATH.
113GCC_SHLIB_SUBDIR = @GCC_SHLIB_SUBDIR@
114
f7ca337f 115# Build programs are put under this directory.
116BUILD_SUBDIR = @build_subdir@
117# This is set by the configure script to the arguments to use when configuring
118# directories built for the build system.
c15fb64c 119BUILD_CONFIGARGS = @build_configargs@ --with-build-subdir="$(BUILD_SUBDIR)"
2f8725b0 120
7ab76cec 121# Linker flags to use on the host, for stage1 or when not
122# bootstrapping.
123STAGE1_LDFLAGS = @stage1_ldflags@
124
125# Libraries to use on the host, for stage1 or when not bootstrapping.
126STAGE1_LIBS = @stage1_libs@
127
128# Linker flags to use for stage2 and later.
129POSTSTAGE1_LDFLAGS = @poststage1_ldflags@
130
131# Libraries to use for stage2 and later.
132POSTSTAGE1_LIBS = @poststage1_libs@
133
2f8725b0 134# This is the list of variables to export in the environment when
135# configuring any subdirectory. It must also be exported whenever
136# recursing into a build directory in case that directory's Makefile
137# re-runs configure.
138BASE_EXPORTS = \
139 FLEX="$(FLEX)"; export FLEX; \
140 LEX="$(LEX)"; export LEX; \
141 BISON="$(BISON)"; export BISON; \
142 YACC="$(YACC)"; export YACC; \
143 M4="$(M4)"; export M4; \
b181f265 144 SED="$(SED)"; export SED; \
5576729b 145 AWK="$(AWK)"; export AWK; \
2f8725b0 146 MAKEINFO="$(MAKEINFO)"; export MAKEINFO;
147
27e3aebd 148# This is the list of variables to export in the environment when
2f8725b0 149# configuring subdirectories for the build system.
27e3aebd 150BUILD_EXPORTS = \
2f8725b0 151 $(BASE_EXPORTS) \
27e3aebd 152 AR="$(AR_FOR_BUILD)"; export AR; \
153 AS="$(AS_FOR_BUILD)"; export AS; \
154 CC="$(CC_FOR_BUILD)"; export CC; \
155 CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
156 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
157 CXX="$(CXX_FOR_BUILD)"; export CXX; \
158 CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
27e3aebd 159 GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
5ff5b630 160 GOC="$(GOC_FOR_BUILD)"; export GOC; \
161 GOCFLAGS="$(GOCFLAGS_FOR_BUILD)"; export GOCFLAGS; \
03385ed3 162 GDC="$(GDC_FOR_BUILD)"; export GDC; \
163 GDCFLAGS="$(GDCFLAGS_FOR_BUILD)"; export GDCFLAGS; \
27e3aebd 164 DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
165 LD="$(LD_FOR_BUILD)"; export LD; \
166 LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
167 NM="$(NM_FOR_BUILD)"; export NM; \
168 RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
2590e4db 169 WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
75d6a0a9 170 WINDMC="$(WINDMC_FOR_BUILD)"; export WINDMC;
f7ca337f 171
9841cd80 172# These variables must be set on the make command line for directories
39933134 173# built for the build system to override those in BASE_FLAGS_TO_PASS.
9841cd80 174EXTRA_BUILD_FLAGS = \
175 CFLAGS="$(CFLAGS_FOR_BUILD)" \
176 LDFLAGS="$(LDFLAGS_FOR_BUILD)"
177
f7ca337f 178# This is the list of directories to built for the host system.
179SUBDIRS = @configdirs@
1fda3360 180TARGET_CONFIGDIRS = @target_configdirs@
f7ca337f 181# This is set by the configure script to the arguments to use when configuring
182# directories built for the host system.
183HOST_CONFIGARGS = @host_configargs@
c1eb9e31 184# Host programs are put under this directory, which is . except if building
185# with srcdir=..
186HOST_SUBDIR = @host_subdir@
27e3aebd 187# This is the list of variables to export in the environment when
f5aebe3e 188# configuring subdirectories for the host system. We need to pass
189# some to the GCC configure because of its hybrid host/target nature.
27e3aebd 190HOST_EXPORTS = \
2f8725b0 191 $(BASE_EXPORTS) \
27e3aebd 192 CC="$(CC)"; export CC; \
3bed0958 193 ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
27e3aebd 194 CFLAGS="$(CFLAGS)"; export CFLAGS; \
195 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
196 CXX="$(CXX)"; export CXX; \
197 CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
bd1f9655 198 GFORTRAN="$(GFORTRAN)"; export GFORTRAN; \
5ff5b630 199 GOC="$(GOC)"; export GOC; \
03385ed3 200 GDC="$(GDC)"; export GDC; \
27e3aebd 201 AR="$(AR)"; export AR; \
202 AS="$(AS)"; export AS; \
203 CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
ab686415 204 CXX_FOR_BUILD="$(CXX_FOR_BUILD)"; export CXX_FOR_BUILD; \
27e3aebd 205 DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
206 LD="$(LD)"; export LD; \
7ab76cec 207 LDFLAGS="$(STAGE1_LDFLAGS) $(LDFLAGS)"; export LDFLAGS; \
27e3aebd 208 NM="$(NM)"; export NM; \
209 RANLIB="$(RANLIB)"; export RANLIB; \
210 WINDRES="$(WINDRES)"; export WINDRES; \
75d6a0a9 211 WINDMC="$(WINDMC)"; export WINDMC; \
27e3aebd 212 OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
1e6242a4 213 OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
16706a2e 214 OTOOL="$(OTOOL)"; export OTOOL; \
3f71364d 215 READELF="$(READELF)"; export READELF; \
f5aebe3e 216 AR_FOR_TARGET="$(AR_FOR_TARGET)"; export AR_FOR_TARGET; \
217 AS_FOR_TARGET="$(AS_FOR_TARGET)"; export AS_FOR_TARGET; \
218 GCC_FOR_TARGET="$(GCC_FOR_TARGET)"; export GCC_FOR_TARGET; \
219 LD_FOR_TARGET="$(LD_FOR_TARGET)"; export LD_FOR_TARGET; \
220 NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \
221 OBJDUMP_FOR_TARGET="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP_FOR_TARGET; \
fc740d70 222 OBJCOPY_FOR_TARGET="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY_FOR_TARGET; \
16706a2e 223 OTOOL_FOR_TARGET="$(OTOOL_FOR_TARGET)"; export OTOOL_FOR_TARGET; \
f5aebe3e 224 RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \
3f71364d 225 READELF_FOR_TARGET="$(READELF_FOR_TARGET)"; export READELF_FOR_TARGET; \
27e3aebd 226 TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
7ab76cec 227 HOST_LIBS="$(STAGE1_LIBS)"; export HOST_LIBS; \
27e3aebd 228 GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
d389b7e3 229 GMPINC="$(HOST_GMPINC)"; export GMPINC; \
429cca51 230 ISLLIBS="$(HOST_ISLLIBS)"; export ISLLIBS; \
87e20041 231 ISLINC="$(HOST_ISLINC)"; export ISLINC; \
215cfab2 232 LIBELFLIBS="$(HOST_LIBELFLIBS)"; export LIBELFLIBS; \
233 LIBELFINC="$(HOST_LIBELFINC)"; export LIBELFINC; \
877f47a9 234 XGCC_FLAGS_FOR_TARGET="$(XGCC_FLAGS_FOR_TARGET)"; export XGCC_FLAGS_FOR_TARGET; \
8283f873 235@if gcc-bootstrap
236 $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
237@endif gcc-bootstrap
85115a11 238 $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
27e3aebd 239
eea1ae23 240POSTSTAGE1_CXX_EXPORT = \
241 CXX='$(CXX)'; export CXX; \
242 CXX_FOR_BUILD='$(CXX_FOR_BUILD)'; export CXX_FOR_BUILD;
243@if target-libstdc++-v3-bootstrap
244# Override the above if we're bootstrapping C++.
245POSTSTAGE1_CXX_EXPORT = \
3e54888f 246 CXX="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xg++$(exeext) \
eea1ae23 247 -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ -nostdinc++ \
cb885d9b 248 -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
18540031 249 -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \
48d33b51 250 `if $(LEAN); then echo ' -isystem '; else echo ' -I'; fi`$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \
251 `if $(LEAN); then echo ' -isystem '; else echo ' -I'; fi`$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \
252 `if $(LEAN); then echo ' -isystem '; else echo ' -I'; fi`$$s/libstdc++-v3/libsupc++ \
18540031 253 -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
254 -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs"; \
255 export CXX; \
eea1ae23 256 CXX_FOR_BUILD="$$CXX"; export CXX_FOR_BUILD;
257@endif target-libstdc++-v3-bootstrap
258
27e3aebd 259# Similar, for later GCC stages.
12fb418d 260POSTSTAGE1_HOST_EXPORTS = \
1b53fe78 261 $(HOST_EXPORTS) \
c1eb9e31 262 CC="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
bd1f9655 263 -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ \
264 $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
265 CC_FOR_BUILD="$$CC"; export CC_FOR_BUILD; \
eea1ae23 266 $(POSTSTAGE1_CXX_EXPORT) \
870e466f 267 $(LTO_EXPORTS) \
03385ed3 268 GDC="$$r/$(HOST_SUBDIR)/prev-gcc/gdc$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/ \
269 -B$(build_tooldir)/bin/ $(GDC_FLAGS_FOR_TARGET) \
270 -B$$r/prev-$(TARGET_SUBDIR)/libphobos/src \
271 -I$$r/prev-$(TARGET_SUBDIR)/libphobos/libdruntime -I$$s/libphobos/libdruntime \
272 -L$$r/prev-$(TARGET_SUBDIR)/libphobos/src/.libs \
273 -L$$r/prev-$(TARGET_SUBDIR)/libphobos/libdruntime/.libs"; \
274 export GDC; \
275 GDC_FOR_BUILD="$$GDC"; export GDC_FOR_BUILD; \
7ab76cec 276 GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND; \
277 LDFLAGS="$(POSTSTAGE1_LDFLAGS) $(BOOT_LDFLAGS)"; export LDFLAGS; \
278 HOST_LIBS="$(POSTSTAGE1_LIBS)"; export HOST_LIBS;
f7ca337f 279
f7ca337f 280# Target libraries are put under this directory:
281TARGET_SUBDIR = @target_subdir@
282# This is set by the configure script to the arguments to use when configuring
283# directories built for the target.
c15fb64c 284TARGET_CONFIGARGS = @target_configargs@ --with-target-subdir="$(TARGET_SUBDIR)"
27e3aebd 285# This is the list of variables to export in the environment when
1ab7bcf0 286# configuring subdirectories for the target system.
27e3aebd 287BASE_TARGET_EXPORTS = \
2f8725b0 288 $(BASE_EXPORTS) \
27e3aebd 289 AR="$(AR_FOR_TARGET)"; export AR; \
f5aebe3e 290 AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \
bd1f9655 291 CC="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
292 CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
27e3aebd 293 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
cac4ee55 294 CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
bd1f9655 295 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
bd1f9655 296 GFORTRAN="$(GFORTRAN_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GFORTRAN; \
5ff5b630 297 GOC="$(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GOC; \
03385ed3 298 GDC="$(GDC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GDC; \
27e3aebd 299 DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
f5aebe3e 300 LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \
27e3aebd 301 LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
9fec3fa8 302 LIPO="$(LIPO_FOR_TARGET)"; export LIPO; \
f5aebe3e 303 NM="$(COMPILER_NM_FOR_TARGET)"; export NM; \
ae74ffb7 304 OBJDUMP="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP; \
fc740d70 305 OBJCOPY="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY; \
16706a2e 306 OTOOL="$(OTOOL_FOR_TARGET)"; export OTOOL; \
27e3aebd 307 RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
3f71364d 308 READELF="$(READELF_FOR_TARGET)"; export READELF; \
9fec3fa8 309 STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \
d389b7e3 310 WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
75d6a0a9 311 WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \
1ab7bcf0 312@if gcc-bootstrap
313 $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
314@endif gcc-bootstrap
1fda3360 315 $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
316 TARGET_CONFIGDIRS="$(TARGET_CONFIGDIRS)"; export TARGET_CONFIGDIRS;
27e3aebd 317
318RAW_CXX_TARGET_EXPORTS = \
319 $(BASE_TARGET_EXPORTS) \
320 CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
bd1f9655 321 CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
27e3aebd 322
323NORMAL_TARGET_EXPORTS = \
324 $(BASE_TARGET_EXPORTS) \
bd1f9655 325 CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
f7ca337f 326
4ee9c684 327# Where to find GMP
328HOST_GMPLIBS = @gmplibs@
329HOST_GMPINC = @gmpinc@
330
71130ef8 331# Where to find isl
429cca51 332HOST_ISLLIBS = @isllibs@
87e20041 333HOST_ISLINC = @islinc@
255b6be7 334
7bfefa9d 335# Where to find libelf
336HOST_LIBELFLIBS = @libelflibs@
337HOST_LIBELFINC = @libelfinc@
338
f7ca337f 339# ----------------------------------------------
340# Programs producing files for the BUILD machine
341# ----------------------------------------------
342
c36c585e 343SHELL = @SHELL@
f7ca337f 344
345# pwd command to use. Allow user to override default by setting PWDCMD in
346# the environment to account for automounters. The make variable must not
347# be called PWDCMD, otherwise the value set here is passed to make
348# subprocesses and overrides the setting from the user's environment.
7a8ca04a 349# Don't use PWD since it is a common shell environment variable and we
350# don't want to corrupt it.
351PWD_COMMAND = $${PWDCMD-pwd}
f7ca337f 352
353# compilers to use to create programs which must be run in the build
354# environment.
93c5e793 355AR_FOR_BUILD = @AR_FOR_BUILD@
356AS_FOR_BUILD = @AS_FOR_BUILD@
f7ca337f 357CC_FOR_BUILD = @CC_FOR_BUILD@
d8e9ea04 358CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
93c5e793 359CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@
360CXX_FOR_BUILD = @CXX_FOR_BUILD@
361DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@
93c5e793 362GFORTRAN_FOR_BUILD = @GFORTRAN_FOR_BUILD@
5ff5b630 363GOC_FOR_BUILD = @GOC_FOR_BUILD@
03385ed3 364GDC_FOR_BUILD = @GDC_FOR_BUILD@
93c5e793 365LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
366LD_FOR_BUILD = @LD_FOR_BUILD@
367NM_FOR_BUILD = @NM_FOR_BUILD@
368RANLIB_FOR_BUILD = @RANLIB_FOR_BUILD@
369WINDMC_FOR_BUILD = @WINDMC_FOR_BUILD@
370WINDRES_FOR_BUILD = @WINDRES_FOR_BUILD@
f7ca337f 371
372# Special variables passed down in EXTRA_GCC_FLAGS. They are defined
373# here so that they can be overridden by Makefile fragments.
f7ca337f 374BUILD_PREFIX = @BUILD_PREFIX@
375BUILD_PREFIX_1 = @BUILD_PREFIX_1@
2a1ac811 376
2b64d19b 377# Flags to pass to stage2 and later makes. They are defined
378# here so that they can be overridden by Makefile fragments.
379BOOT_CFLAGS= -g -O2
9d44a802 380BOOT_LDFLAGS=
1410e798 381BOOT_ADAFLAGS= -gnatpg
2b64d19b 382
b181f265 383AWK = @AWK@
384SED = @SED@
f5aebe3e 385BISON = @BISON@
386YACC = @YACC@
387FLEX = @FLEX@
388LEX = @LEX@
389M4 = @M4@
390MAKEINFO = @MAKEINFO@
391EXPECT = @EXPECT@
392RUNTEST = @RUNTEST@
2a1ac811 393
5ce6daa3 394AUTO_PROFILE = gcc-auto-profile -c 10000000
b4c71cbb 395
2a1ac811 396# This just becomes part of the MAKEINFO definition passed down to
397# sub-makes. It lets flags be given on the command line while still
398# using the makeinfo from the object tree.
516b2e07 399# (Default to avoid splitting info files by setting the threshold high.)
400MAKEINFOFLAGS = --split-size=5000000
2a1ac811 401
f7ca337f 402# ---------------------------------------------
403# Programs producing files for the HOST machine
404# ---------------------------------------------
2a1ac811 405
f7ca337f 406AS = @AS@
f7ca337f 407AR = @AR@
408AR_FLAGS = rc
f7ca337f 409CC = @CC@
f7ca337f 410CXX = @CXX@
f7ca337f 411DLLTOOL = @DLLTOOL@
f7ca337f 412LD = @LD@
f5aebe3e 413LIPO = @LIPO@
414NM = @NM@
0c8a85c6 415OBJDUMP = @OBJDUMP@
16706a2e 416OTOOL = @OTOOL@
f7ca337f 417RANLIB = @RANLIB@
3f71364d 418READELF = @READELF@
f5aebe3e 419STRIP = @STRIP@
f7ca337f 420WINDRES = @WINDRES@
75d6a0a9 421WINDMC = @WINDMC@
2a1ac811 422
03385ed3 423GDC = @GDC@
a18b2c54 424GNATBIND = @GNATBIND@
425GNATMAKE = @GNATMAKE@
426
f5aebe3e 427CFLAGS = @CFLAGS@
44db1fbc 428LDFLAGS = @LDFLAGS@
f5aebe3e 429LIBCFLAGS = $(CFLAGS)
430CXXFLAGS = @CXXFLAGS@
431LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
5ff5b630 432GOCFLAGS = $(CFLAGS)
03385ed3 433GDCFLAGS = $(CFLAGS)
f7ca337f 434
b4c71cbb 435CREATE_GCOV = create_gcov
436
bd1f9655 437TFLAGS =
438
439# Defaults for all stages; some are overridden below.
440
441STAGE_CFLAGS = $(BOOT_CFLAGS)
442STAGE_TFLAGS = $(TFLAGS)
443STAGE_CONFIGURE_FLAGS=@stage2_werror_flag@
444
445[+ FOR bootstrap-stage +]
446# Defaults for stage [+id+]; some are overridden below.
447STAGE[+id+]_CFLAGS = $(STAGE_CFLAGS)
eea1ae23 448STAGE[+id+]_CXXFLAGS = $(CXXFLAGS)
449@if target-libstdc++-v3-bootstrap
450# Override the above if we're bootstrapping C++.
451STAGE[+id+]_CXXFLAGS = $(STAGE[+id+]_CFLAGS)
452@endif target-libstdc++-v3-bootstrap
bd1f9655 453STAGE[+id+]_TFLAGS = $(STAGE_TFLAGS)
2b15d2ba 454STAGE[+id+]_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
bd1f9655 455[+ ENDFOR bootstrap-stage +]
456
45b5d9f5 457# By default, C and C++ are the only stage1 languages, because they are the
458# only ones we require to build with the bootstrap compiler, and also the
459# only ones useful for building stage2.
39f34cfc 460
bd1f9655 461STAGE1_CFLAGS = @stage1_cflags@
eea1ae23 462STAGE1_CHECKING = @stage1_checking@
463STAGE1_LANGUAGES = @stage1_languages@
bd1f9655 464# * We force-disable intermodule optimizations, even if
465# --enable-intermodule was passed, since the installed compiler
466# probably can't handle them. Luckily, autoconf always respects
467# the last argument when conflicting --enable arguments are passed.
468# * Likewise, we force-disable coverage flags, since the installed
469# compiler probably has never heard of them.
e0fad718 470# * We also disable -Wformat, since older GCCs don't understand newer %s.
bd1f9655 471STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
e0fad718 472 --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
473 --disable-build-format-warnings
39f34cfc 474
2beea61e 475# When using the slow stage1 compiler disable IL verification and forcefully
476# enable it when using the stage2 compiler instead. As we later compare
477# stage2 and stage3 we are merely avoid doing redundant work, plus we apply
478# checking when building all target libraries for release builds.
479STAGE1_TFLAGS += -fno-checking
480STAGE2_CFLAGS += -fno-checking
481STAGE2_TFLAGS += -fno-checking
f07f7f41 482STAGE3_CFLAGS += -fchecking=1
483STAGE3_TFLAGS += -fchecking=1
2beea61e 484
bd1f9655 485STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
486STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
5b542315 487
f07f7f41 488STAGEtrain_CFLAGS = $(filter-out -fchecking=1,$(STAGE3_CFLAGS))
489STAGEtrain_TFLAGS = $(filter-out -fchecking=1,$(STAGE3_TFLAGS))
696cfb66 490
491STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use
492STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS)
c898f165 493
b4c71cbb 494STAGEautoprofile_CFLAGS = $(STAGE2_CFLAGS) -g
495STAGEautoprofile_TFLAGS = $(STAGE2_TFLAGS)
496
497STAGEautofeedback_CFLAGS = $(STAGE3_CFLAGS)
498STAGEautofeedback_TFLAGS = $(STAGE3_TFLAGS)
499
5b542315 500do-compare = @do_compare@
501do-compare3 = $(do-compare)
5b542315 502
f7ca337f 503# -----------------------------------------------
504# Programs producing files for the TARGET machine
505# -----------------------------------------------
2a1ac811 506
f7ca337f 507AR_FOR_TARGET=@AR_FOR_TARGET@
805e22b2 508AS_FOR_TARGET=@AS_FOR_TARGET@
bd1f9655 509CC_FOR_TARGET=$(STAGE_CC_WRAPPER) @CC_FOR_TARGET@
ef8184c7 510
f7ca337f 511# If GCC_FOR_TARGET is not overriden on the command line, then this
512# variable is passed down to the gcc Makefile, where it is used to
513# build libgcc2.a. We define it here so that it can itself be
514# overridden on the command line.
bd1f9655 515GCC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCC_FOR_TARGET@
516CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @CXX_FOR_TARGET@
517RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@
bd1f9655 518GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@
5ff5b630 519GOC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GOC_FOR_TARGET@
03385ed3 520GDC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GDC_FOR_TARGET@
805e22b2 521DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
f7ca337f 522LD_FOR_TARGET=@LD_FOR_TARGET@
f7ca337f 523
9fec3fa8 524LIPO_FOR_TARGET=@LIPO_FOR_TARGET@
f7ca337f 525NM_FOR_TARGET=@NM_FOR_TARGET@
ae74ffb7 526OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@
fc740d70 527OBJCOPY_FOR_TARGET=@OBJCOPY_FOR_TARGET@
16706a2e 528OTOOL_FOR_TARGET=@OTOOL_FOR_TARGET@
805e22b2 529RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
3f71364d 530READELF_FOR_TARGET=@READELF_FOR_TARGET@
9fec3fa8 531STRIP_FOR_TARGET=@STRIP_FOR_TARGET@
f7ca337f 532WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@
75d6a0a9 533WINDMC_FOR_TARGET=@WINDMC_FOR_TARGET@
2a1ac811 534
f5aebe3e 535COMPILER_AS_FOR_TARGET=@COMPILER_AS_FOR_TARGET@
536COMPILER_LD_FOR_TARGET=@COMPILER_LD_FOR_TARGET@
537COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_TARGET@
538
c898f165 539CFLAGS_FOR_TARGET = @CFLAGS_FOR_TARGET@
540CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@
c898f165 541
f5aebe3e 542LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
543LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
ed9516f5 544LDFLAGS_FOR_TARGET = @LDFLAGS_FOR_TARGET@
5ff5b630 545GOCFLAGS_FOR_TARGET = -O2 -g
03385ed3 546GDCFLAGS_FOR_TARGET = -O2 -g
f7ca337f 547
bd1f9655 548FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
549SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
550DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@
551
552XGCC_FLAGS_FOR_TARGET = $(FLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)
553
f7ca337f 554# ------------------------------------
555# Miscellaneous targets and flag lists
556# ------------------------------------
557
2a1ac811 558# The first rule in the file had better be this one. Don't put any above it.
559# This lives here to allow makefile fragments to contain dependencies.
8283f873 560all:
2a1ac811 561
2a1ac811 562#### host and target specific makefile fragments come in here.
71ab34df 563@target_makefile_frag@
564@alphaieee_frag@
565@ospace_frag@
566@host_makefile_frag@
2a1ac811 567###
568
85115a11 569# This is the list of directories that may be needed in RPATH_ENVVAR
1235ba90 570# so that programs built for the target machine work.
85115a11 571TARGET_LIB_PATH = [+ FOR target_modules +][+
572 IF lib_path +]$(TARGET_LIB_PATH_[+module+])[+ ENDIF lib_path +][+
573 ENDFOR target_modules +]$(HOST_LIB_PATH_gcc)
574[+ FOR target_modules +][+ IF lib_path +]
575@if target-[+module+]
576TARGET_LIB_PATH_[+module+] = $$r/$(TARGET_SUBDIR)/[+module+]/[+lib_path+]:
577@endif target-[+module+]
578[+ ENDIF lib_path +][+ ENDFOR target_modules +]
579
580
581# This is the list of directories that may be needed in RPATH_ENVVAR
582# so that programs built for the host machine work.
583HOST_LIB_PATH = [+ FOR host_modules +][+
584 IF lib_path +]$(HOST_LIB_PATH_[+module+])[+ ENDIF lib_path +][+
585 ENDFOR host_modules +]
586
587# Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch
588@if gcc
7d804f04 589HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc$(GCC_SHLIB_SUBDIR):$$r/$(HOST_SUBDIR)/prev-gcc$(GCC_SHLIB_SUBDIR):
85115a11 590@endif gcc
591
592[+ FOR host_modules +][+ IF lib_path +]
593@if [+module+]
594HOST_LIB_PATH_[+module+] = \
595 $$r/$(HOST_SUBDIR)/[+module+]/[+lib_path+]:[+ IF bootstrap
596 +]$$r/$(HOST_SUBDIR)/prev-[+module+]/[+lib_path+]:[+ ENDIF bootstrap +]
597@endif [+module+]
598[+ ENDIF lib_path +][+ ENDFOR host_modules +]
599
174d231c 600CXX_FOR_TARGET_FLAG_TO_PASS = \
601 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)"
602@if target-libstdc++-v3
603# CXX_FOR_TARGET is tricky to get right for target libs that require a
604# functional C++ compiler. When we recurse, if we expand
605# CXX_FOR_TARGET before configuring libstdc++-v3, we won't get
606# libstdc++ include flags from the script. Instead, we get an
607# -funconfigured-* word, so that we'll get errors if this invalid C++
608# command line is used for anything, but also so that we can use the
609# word to decide whether or not to pass on this CXX_FOR_TARGET. If we
610# don't pass it on, sub-make will use the default definition, that
611# re-expands it at the time of use, so we'll get it right when we need
612# it. One potential exception is the expansion of CXX_FOR_TARGET
613# passed down as part of CXX within TARGET_FLAGS, but this wouldn't
614# really work, for C++ host programs can't depend on the current-stage
615# C++ target library.
616CXX_FOR_TARGET_FLAG_TO_PASS = \
617 $(shell if echo "$(CXX_FOR_TARGET)" | grep " -funconfigured-" > /dev/null; then :; else echo '"CXX_FOR_TARGET=$(CXX_FOR_TARGET)"'; fi)
618@endif target-libstdc++-v3
619
45b5d9f5 620# Flags to pass down to all sub-makes. STAGE*FLAGS,
621# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them
622# overrideable (for a bootstrap build stage1 also builds gcc.info).
26526d23 623BASE_FLAGS_TO_PASS =[+ FOR flags_to_pass +][+ IF optional +] \
624 "`echo '[+flag+]=$([+flag+])' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"[+ ELSE optional +] \
bd1f9655 625 "[+flag+]=$([+flag+])"[+ ENDIF optional+][+ ENDFOR flags_to_pass +][+ FOR bootstrap-stage +] \
626 "STAGE[+id+]_CFLAGS=$(STAGE[+id+]_CFLAGS)" \
eea1ae23 627 "STAGE[+id+]_CXXFLAGS=$(STAGE[+id+]_CXXFLAGS)" \
e976dfb8 628 "STAGE[+id+]_GENERATOR_CFLAGS=$(STAGE[+id+]_GENERATOR_CFLAGS)" \
bd1f9655 629 "STAGE[+id+]_TFLAGS=$(STAGE[+id+]_TFLAGS)"[+ ENDFOR bootstrap-stage +] \
174d231c 630 $(CXX_FOR_TARGET_FLAG_TO_PASS) \
bd1f9655 631 "TFLAGS=$(TFLAGS)" \
3a6fbbb0 632 "CONFIG_SHELL=$(SHELL)" \
cdcc70f1 633 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
634 $(if $(LSAN_OPTIONS),"LSAN_OPTIONS=$(LSAN_OPTIONS)")
2a1ac811 635
ef8184c7 636# We leave this in just in case, but it is not needed anymore.
637RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS)
599a3eac 638
2a1ac811 639# Flags to pass down to most sub-makes, in which we're building with
640# the host environment.
2a1ac811 641EXTRA_HOST_FLAGS = \
642 'AR=$(AR)' \
643 'AS=$(AS)' \
644 'CC=$(CC)' \
645 'CXX=$(CXX)' \
646 'DLLTOOL=$(DLLTOOL)' \
bd1f9655 647 'GFORTRAN=$(GFORTRAN)' \
5ff5b630 648 'GOC=$(GOC)' \
03385ed3 649 'GDC=$(GDC)' \
2a1ac811 650 'LD=$(LD)' \
f5aebe3e 651 'LIPO=$(LIPO)' \
2a1ac811 652 'NM=$(NM)' \
0c8a85c6 653 'OBJDUMP=$(OBJDUMP)' \
16706a2e 654 'OTOOL=$(OTOOL)' \
224ed654 655 'RANLIB=$(RANLIB)' \
3f71364d 656 'READELF=$(READELF)' \
f5aebe3e 657 'STRIP=$(STRIP)' \
75d6a0a9 658 'WINDRES=$(WINDRES)' \
b4c71cbb 659 'WINDMC=$(WINDMC)' \
660 'CREATE_GCOV=$(CREATE_GCOV)'
2a1ac811 661
662FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
663
13687c85 664# Flags to pass to stage1 or when not bootstrapping.
665
666STAGE1_FLAGS_TO_PASS = \
667 LDFLAGS="$${LDFLAGS}" \
668 HOST_LIBS="$${HOST_LIBS}"
669
39f34cfc 670# Flags to pass to stage2 and later makes.
671
672POSTSTAGE1_FLAGS_TO_PASS = \
7ab76cec 673 CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
674 CXX="$${CXX}" CXX_FOR_BUILD="$${CXX_FOR_BUILD}" \
03385ed3 675 GDC="$${GDC}" GDC_FOR_BUILD="$${GDC_FOR_BUILD}" \
7ab76cec 676 GNATBIND="$${GNATBIND}" \
eea1ae23 677 LDFLAGS="$${LDFLAGS}" \
678 HOST_LIBS="$${HOST_LIBS}" \
870e466f 679 $(LTO_FLAGS_TO_PASS) \
39f34cfc 680 "`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
681
53eea98c 682@if gcc-bootstrap
683EXTRA_HOST_EXPORTS = if [ $(current_stage) != stage1 ]; then \
684 $(POSTSTAGE1_HOST_EXPORTS) \
215cfab2 685 fi;
53eea98c 686
687EXTRA_BOOTSTRAP_FLAGS = CC="$$CC" CXX="$$CXX" LDFLAGS="$$LDFLAGS"
688@endif gcc-bootstrap
689
2a1ac811 690# Flags to pass down to makes which are built with the target environment.
83f96a51 691# The double $ decreases the length of the command line; those variables
692# are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. The
c898f165 693# *_CFLAGS_FOR_TARGET variables are not passed down and most often empty,
694# so we expand them here.
2a1ac811 695EXTRA_TARGET_FLAGS = \
696 'AR=$$(AR_FOR_TARGET)' \
83f96a51 697 'AS=$(COMPILER_AS_FOR_TARGET)' \
bd1f9655 698 'CC=$$(CC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
699 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
41a4aa66 700 'CXX=$$(CXX_FOR_TARGET) -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
701 -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \
702 $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
bd1f9655 703 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
2a1ac811 704 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
bd1f9655 705 'GFORTRAN=$$(GFORTRAN_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
5ff5b630 706 'GOC=$$(GOC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
707 'GOCFLAGS=$$(GOCFLAGS_FOR_TARGET)' \
03385ed3 708 'GDC=$$(GDC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
709 'GDCFLAGS=$$(GDCFLAGS_FOR_TARGET)' \
83f96a51 710 'LD=$(COMPILER_LD_FOR_TARGET)' \
29327bb4 711 'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \
bd1f9655 712 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
713 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
83f96a51 714 'NM=$(COMPILER_NM_FOR_TARGET)' \
ae74ffb7 715 'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \
fc740d70 716 'OBJCOPY=$$(OBJCOPY_FOR_TARGET)' \
2a1ac811 717 'RANLIB=$$(RANLIB_FOR_TARGET)' \
3f71364d 718 'READELF=$$(READELF_FOR_TARGET)' \
75d6a0a9 719 'WINDRES=$$(WINDRES_FOR_TARGET)' \
bd1f9655 720 'WINDMC=$$(WINDMC_FOR_TARGET)' \
721 'XGCC_FLAGS_FOR_TARGET=$(XGCC_FLAGS_FOR_TARGET)' \
41a4aa66 722 'STAGE1_LDFLAGS=$$(POSTSTAGE1_LDFLAGS)' \
723 'STAGE1_LIBS=$$(POSTSTAGE1_LIBS)' \
bd1f9655 724 "TFLAGS=$$TFLAGS"
2a1ac811 725
726TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
727
728# Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
729# unfortunately needs the native compiler and the target ar and
730# ranlib.
731# If any variables are added here, they must be added to do-*, below.
ff2e99a4 732# The BUILD_* variables are a special case, which are used for the gcc
2a1ac811 733# cross-building scheme.
734EXTRA_GCC_FLAGS = \
2a1ac811 735 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
75fc7adc 736 "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
4dc4ff49 737 "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
2a1ac811 738
70356f61 739GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS)
2a1ac811 740
bd1f9655 741@if gcc
719faf1c 742BUILD_CONFIG = @BUILD_CONFIG@
bd1f9655 743ifneq ($(BUILD_CONFIG),)
744include $(foreach CONFIG, $(BUILD_CONFIG), $(srcdir)/config/$(CONFIG).mk)
745endif
746@endif gcc
747
6f4f34a7 748.PHONY: configure-host
6caa530d 749configure-host: [+
6f4f34a7 750 FOR host_modules +] \
751 maybe-configure-[+module+][+
752 ENDFOR host_modules +]
753.PHONY: configure-target
754configure-target: [+
755 FOR target_modules +] \
756 maybe-configure-target-[+module+][+
757 ENDFOR target_modules +]
2a1ac811 758
54f0538b 759# The target built for a native non-bootstrap build.
760.PHONY: all
8283f873 761all:
762@if gcc-bootstrap
f5aebe3e 763 [ -f stage_final ] || echo stage3 > stage_final
8283f873 764 @r=`${PWD_COMMAND}`; export r; \
765 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
83f96a51 766 $(MAKE) $(RECURSE_FLAGS_TO_PASS) `cat stage_final`-bubble
8283f873 767@endif gcc-bootstrap
83f96a51 768 @: $(MAKE); $(unstage)
8283f873 769 @r=`${PWD_COMMAND}`; export r; \
770 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
bd1f9655 771@if gcc-bootstrap
4156fd9a 772 if [ -f stage_last ]; then \
a36217d3 773 TFLAGS="$(STAGE$(shell test ! -f stage_last || sed s,^stage,, stage_last)_TFLAGS)"; \
f5aebe3e 774 $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target; \
8283f873 775 else \
bd1f9655 776@endif gcc-bootstrap
bc1e0bea 777 $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target \
778@if gcc-bootstrap
779 ; \
9d247ee8 780 fi \
bc1e0bea 781@endif gcc-bootstrap
9d247ee8 782 && :
6f4f34a7 783
2f8725b0 784.PHONY: all-build
26526d23 785[+ FOR build_modules +]
786all-build: maybe-all-build-[+module+][+ ENDFOR build_modules +]
787
6f4f34a7 788.PHONY: all-host
26526d23 789[+ FOR host_modules +][+ IF bootstrap +]
790@if [+module+]-no-bootstrap[+ ENDIF bootstrap +]
791all-host: maybe-all-[+module+][+ IF bootstrap +]
792@endif [+module+]-no-bootstrap[+ ENDIF bootstrap +][+ ENDFOR host_modules +]
793
6f4f34a7 794.PHONY: all-target
26526d23 795[+ FOR target_modules +][+ IF bootstrap +]
0a2e6193 796@if target-[+module+]-no-bootstrap[+ ENDIF bootstrap +]
26526d23 797all-target: maybe-all-target-[+module+][+ IF bootstrap +]
0a2e6193 798@endif target-[+module+]-no-bootstrap[+
799 ENDIF bootstrap +][+ ENDFOR target_modules +]
2a1ac811 800
801# Do a target for all the subdirectories. A ``make do-X'' will do a
802# ``make X'' in all subdirectories (because, in general, there is a
803# dependency (below) of X upon do-X, a ``make X'' will also do this,
804# but it may do additional work as well).
805e22b2 805[+ FOR recursive_targets +]
ffe98fac 806.PHONY: do-[+make_target+]
8283f873 807do-[+make_target+]:
83f96a51 808 @: $(MAKE); $(unstage)
e025d06f 809 @r=`${PWD_COMMAND}`; export r; \
810 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
811 $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+make_target+]-host \
8283f873 812 [+make_target+]-target
8283f873 813
ff2e99a4 814
815.PHONY: [+make_target+]-host
26526d23 816[+ FOR host_modules +]
817[+make_target+]-host: maybe-[+make_target+]-[+module+][+ ENDFOR host_modules +]
ff2e99a4 818
819.PHONY: [+make_target+]-target
26526d23 820[+ FOR target_modules +]
821[+make_target+]-target: maybe-[+make_target+]-target-[+module+][+ ENDFOR target_modules +]
805e22b2 822[+ ENDFOR recursive_targets +]
823
2a1ac811 824# Here are the targets which correspond to the do-X targets.
825
130effca 826.PHONY: info installcheck dvi pdf html
827.PHONY: install-info install-pdf install-html
2a1ac811 828.PHONY: clean distclean mostlyclean maintainer-clean realclean
829.PHONY: local-clean local-distclean local-maintainer-clean
830info: do-info
831installcheck: do-installcheck
832dvi: do-dvi
51f93521 833pdf: do-pdf
956942fa 834html: do-html
2a1ac811 835
20672016 836# Make sure makeinfo is built before we do a `make info', if we're
837# in fact building texinfo.
838do-info: maybe-all-texinfo
2a1ac811 839
840install-info: do-install-info dir.info
7a8ca04a 841 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
215cfab2 842 if [ -f dir.info ]; then \
843 $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info; \
844 else true; fi
2a1ac811 845
130effca 846install-pdf: do-install-pdf
847
e0dbdbbf 848install-html: do-install-html
849
2a1ac811 850local-clean:
851 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
852
853local-distclean:
854 -rm -f Makefile config.status config.cache mh-frag mt-frag
f1907b88 855 -rm -f maybedep.tmp serdep.tmp stage_final
2a1ac811 856 -if [ "$(TARGET_SUBDIR)" != "." ]; then \
857 rm -rf $(TARGET_SUBDIR); \
858 else true; fi
170853d0 859 -rm -rf $(BUILD_SUBDIR)
c1eb9e31 860 -if [ "$(HOST_SUBDIR)" != "." ]; then \
861 rm -rf $(HOST_SUBDIR); \
862 else true; fi
2a1ac811 863 -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
864 -rm -f texinfo/doc/Makefile texinfo/po/POTFILES
865 -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
866 -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null
f1907b88 867 -rmdir fastjar gcc gnattools gotools libcc1 libiberty 2>/dev/null
868 -rmdir texinfo zlib 2>/dev/null
68815256 869 -find . -name config.cache -exec rm -f {} \; \; 2>/dev/null
2a1ac811 870
871local-maintainer-clean:
872 @echo "This command is intended for maintainers to use;"
873 @echo "it deletes files that may require special tools to rebuild."
874
875clean: do-clean local-clean
876mostlyclean: do-mostlyclean local-clean
877distclean: do-distclean local-clean local-distclean
878maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
879maintainer-clean: local-distclean
880realclean: maintainer-clean
881
2a1ac811 882# Check target.
883
884.PHONY: check do-check
465fccaf 885check: do-check
2a1ac811 886
805e22b2 887# Only include modules actually being configured and built.
8283f873 888.PHONY: check-host
889check-host: [+
4d9c9c81 890 FOR host_modules +] \
891 maybe-check-[+module+][+
8283f873 892 ENDFOR host_modules +]
893
894.PHONY: check-target
895check-target: [+
4d9c9c81 896 FOR target_modules +] \
897 maybe-check-target-[+module+][+
8283f873 898 ENDFOR target_modules +]
899
900do-check:
83f96a51 901 @: $(MAKE); $(unstage)
e025d06f 902 @r=`${PWD_COMMAND}`; export r; \
903 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
904 $(MAKE) $(RECURSE_FLAGS_TO_PASS) check-host check-target
2a1ac811 905
906# Automated reporting of test results.
907
908warning.log: build.log
909 $(srcdir)/contrib/warn_summary build.log > $@
910
911mail-report.log:
912 if test x'$(BOOT_CFLAGS)' != x''; then \
913 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
914 fi; \
915 $(srcdir)/contrib/test_summary -t >$@
916 chmod +x $@
917 echo If you really want to send e-mail, run ./$@ now
918
919mail-report-with-warnings.log: warning.log
920 if test x'$(BOOT_CFLAGS)' != x''; then \
921 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
922 fi; \
923 $(srcdir)/contrib/test_summary -t -i warning.log >$@
924 chmod +x $@
925 echo If you really want to send e-mail, run ./$@ now
926
d10a337d 927# Local Vim config
928
929$(srcdir)/.local.vimrc:
c8ddf81f 930 $(LN_S) contrib/vimrc $@
d10a337d 931
932$(srcdir)/.lvimrc:
c8ddf81f 933 $(LN_S) contrib/vimrc $@
d10a337d 934
935vimrc: $(srcdir)/.local.vimrc $(srcdir)/.lvimrc
936
937.PHONY: vimrc
938
d666ba1d 939# clang-format config
940
941$(srcdir)/.clang-format:
942 $(LN_S) contrib/clang-format $@
943
944clang-format: $(srcdir)/.clang-format
945
946.PHONY: clang-format
947
2a1ac811 948# Installation targets.
949
805e22b2 950.PHONY: install uninstall
8283f873 951install:
83f96a51 952 @: $(MAKE); $(unstage)
e025d06f 953 @r=`${PWD_COMMAND}`; export r; \
954 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
955 $(MAKE) $(RECURSE_FLAGS_TO_PASS) installdirs install-host install-target
6f4f34a7 956
4d9c9c81 957.PHONY: install-host-nogcc
958install-host-nogcc: [+
ea8d3d75 959 FOR host_modules +][+ IF (not (= (get "module") "gcc")) +] \
960 maybe-install-[+module+][+ ENDIF +][+
4d9c9c81 961 ENDFOR host_modules +]
962
6f4f34a7 963.PHONY: install-host
6caa530d 964install-host: [+
6f4f34a7 965 FOR host_modules +] \
966 maybe-install-[+module+][+
967 ENDFOR host_modules +]
4d9c9c81 968
6f4f34a7 969.PHONY: install-target
970install-target: [+
971 FOR target_modules +] \
972 maybe-install-target-[+module+][+
973 ENDFOR target_modules +]
2a1ac811 974
975uninstall:
976 @echo "the uninstall target is not supported in this tree"
977
2a1ac811 978.PHONY: install.all
979install.all: install-no-fixedincludes
215cfab2 980 @if [ -f ./gcc/Makefile ]; then \
981 r=`${PWD_COMMAND}`; export r; \
83f96a51 982 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1b53fe78 983 $(HOST_EXPORTS) \
ca86fd55 984 (cd ./gcc && \
215cfab2 985 $(MAKE) $(FLAGS_TO_PASS) install-headers); \
2a1ac811 986 else \
215cfab2 987 true; \
2a1ac811 988 fi
989
9281483c 990# install-no-fixedincludes is used to allow the elaboration of binary packages
991# suitable for distribution, where we cannot include the fixed system header
992# files.
2a1ac811 993.PHONY: install-no-fixedincludes
4d9c9c81 994install-no-fixedincludes: installdirs install-host-nogcc \
9281483c 995 install-target gcc-install-no-fixedincludes
2a1ac811 996
2b7a4d59 997.PHONY: install-strip
998install-strip:
999 @: $(MAKE); $(unstage)
1000 @r=`${PWD_COMMAND}`; export r; \
1001 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1002 $(MAKE) $(RECURSE_FLAGS_TO_PASS) installdirs install-strip-host install-strip-target
1003
1004.PHONY: install-strip-host
1005install-strip-host: [+
1006 FOR host_modules +] \
1007 maybe-install-strip-[+module+][+
1008 ENDFOR host_modules +]
1009
1010.PHONY: install-strip-target
1011install-strip-target: [+
1012 FOR target_modules +] \
1013 maybe-install-strip-target-[+module+][+
1014 ENDFOR target_modules +]
1015
1016
805e22b2 1017### other supporting targets
2a1ac811 1018
805e22b2 1019MAKEDIRS= \
1020 $(DESTDIR)$(prefix) \
1021 $(DESTDIR)$(exec_prefix)
1022.PHONY: installdirs
1023installdirs: mkinstalldirs
1024 $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
1025
1026dir.info: do-install-info
215cfab2 1027 if [ -f $(srcdir)/texinfo/gen-info-dir ]; then \
1028 $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new; \
1029 mv -f dir.info.new dir.info; \
1030 else true; \
2a1ac811 1031 fi
1032
805e22b2 1033dist:
1034 @echo "Building a full distribution of this tree isn't done"
1035 @echo "via 'make dist'. Check out the etc/ subdirectory"
1036
1037etags tags: TAGS
1038
1039# Right now this just builds TAGS in each subdirectory. emacs19 has the
1040# ability to use several tags files at once, so there is probably no need
1041# to combine them into one big TAGS file (like CVS 1.3 does). We could
1042# (if we felt like it) have this Makefile write a piece of elisp which
1043# the user could load to tell emacs19 where all the TAGS files we just
1044# built are.
1045TAGS: do-TAGS
1046
c15fb64c 1047# ------------------------------------
1048# Macros for configure and all targets
1049# ------------------------------------
1050
1051[+ DEFINE configure +]
1052.PHONY: configure-[+prefix+][+module+] maybe-configure-[+prefix+][+module+]
1053maybe-configure-[+prefix+][+module+]:
13935149 1054@if gcc-bootstrap
1055configure-[+prefix+][+module+]: stage_current
1056@endif gcc-bootstrap
c15fb64c 1057@if [+prefix+][+module+]
1058maybe-configure-[+prefix+][+module+]: configure-[+prefix+][+module+]
13935149 1059configure-[+prefix+][+module+]: [+ IF bootstrap +][+ ELSE +]
26526d23 1060 @: $(MAKE); $(unstage)[+ ENDIF bootstrap +]
1061 @r=`${PWD_COMMAND}`; export r; \
83f96a51 1062 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
26526d23 1063 [+ IF check_multilibs
1064 +]echo "Checking multilib configuration for [+module+]..."; \
215cfab2 1065 $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]; \
1066 $(CC_FOR_TARGET) --print-multi-lib > [+subdir+]/[+module+]/multilib.tmp 2> /dev/null; \
83f96a51 1067 if test -r [+subdir+]/[+module+]/multilib.out; then \
1068 if cmp -s [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; then \
1069 rm -f [+subdir+]/[+module+]/multilib.tmp; \
1070 else \
1071 rm -f [+subdir+]/[+module+]/Makefile; \
1072 mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
1073 fi; \
1074 else \
1075 mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
26526d23 1076 fi; \
1077 [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \
215cfab2 1078 $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]; \
eea1ae23 1079 [+exports+] [+extra_exports+] \
c15fb64c 1080 echo Configuring in [+subdir+]/[+module+]; \
1081 cd "[+subdir+]/[+module+]" || exit 1; \
602d002b 1082 case $(srcdir) in \
c1eb9e31 1083 /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
c15fb64c 1084 *) topdir=`echo [+subdir+]/[+module+]/ | \
c1eb9e31 1085 sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
602d002b 1086 esac; \
bf0001d4 1087 module_srcdir=[+? module_srcdir (get "module_srcdir") (get "module")+]; \
c15fb64c 1088 [+ IF no-config-site +]rm -f no-such-file || : ; \
bf0001d4 1089 CONFIG_SITE=no-such-file [+ ENDIF +]$(SHELL) \
1090 $$s/$$module_srcdir/configure \
1091 --srcdir=$${topdir}/$$module_srcdir \
d45318b3 1092 [+args+] --build=${build_alias} --host=[+host_alias+] \
bf0001d4 1093 --target=[+target_alias+] [+extra_configure_flags+] \
602d002b 1094 || exit 1
c15fb64c 1095@endif [+prefix+][+module+]
12fb418d 1096
1097[+ IF bootstrap +]
1098[+ FOR bootstrap_stage +]
1099.PHONY: configure-stage[+id+]-[+prefix+][+module+] maybe-configure-stage[+id+]-[+prefix+][+module+]
1100maybe-configure-stage[+id+]-[+prefix+][+module+]:
83f96a51 1101@if [+prefix+][+module+]-bootstrap
12fb418d 1102maybe-configure-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
83f96a51 1103configure-stage[+id+]-[+prefix+][+module+]:
26526d23 1104 @[ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start
83f96a51 1105 @$(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]
26526d23 1106 @r=`${PWD_COMMAND}`; export r; \
12fb418d 1107 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
bd1f9655 1108 TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
26526d23 1109 [+ IF check_multilibs
1110 +]echo "Checking multilib configuration for [+module+]..."; \
215cfab2 1111 $(CC_FOR_TARGET) --print-multi-lib > [+subdir+]/[+module+]/multilib.tmp 2> /dev/null; \
83f96a51 1112 if test -r [+subdir+]/[+module+]/multilib.out; then \
1113 if cmp -s [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; then \
1114 rm -f [+subdir+]/[+module+]/multilib.tmp; \
1115 else \
1116 rm -f [+subdir+]/[+module+]/Makefile; \
1117 mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
1118 fi; \
1119 else \
1120 mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
26526d23 1121 fi; \
1122 [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \
12fb418d 1123 [+exports+][+ IF prev +] \
bd1f9655 1124 [+poststage1_exports+][+ ENDIF prev +][+ IF prefix +] \
1125 CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
1126 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
1127 LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS;[+ ELSE prefix +] \
1128 CFLAGS="$(STAGE[+id+]_CFLAGS)"; export CFLAGS; \
eea1ae23 1129 CXXFLAGS="$(STAGE[+id+]_CXXFLAGS)"; export CXXFLAGS;[+ IF prev +] \
bd1f9655 1130 LIBCFLAGS="$(STAGE[+id+]_CFLAGS)"[+ ELSE prev +] \
eea1ae23 1131 LIBCFLAGS="$(LIBCFLAGS)"[+ ENDIF prev +]; export LIBCFLAGS;[+
1132 ENDIF prefix +] [+extra_exports+] \
215cfab2 1133 echo Configuring stage [+id+] in [+subdir+]/[+module+]; \
1134 $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]; \
12fb418d 1135 cd [+subdir+]/[+module+] || exit 1; \
1136 case $(srcdir) in \
1137 /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
1138 *) topdir=`echo [+subdir+]/[+module+]/ | \
1139 sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
1140 esac; \
bf0001d4 1141 module_srcdir=[+? module_srcdir (get "module_srcdir") (get "module")+]; \
1142 $(SHELL) $$s/$$module_srcdir/configure \
1143 --srcdir=$${topdir}/$$module_srcdir \
d45318b3 1144 [+args+] --build=${build_alias} --host=[+host_alias+] \
bf0001d4 1145 --target=[+target_alias+] \
215cfab2 1146 [+ IF prev +]--with-build-libsubdir=$(HOST_SUBDIR)[+ ENDIF prev +] \
bd1f9655 1147 $(STAGE[+id+]_CONFIGURE_FLAGS)[+ IF extra_configure_flags +] \
1148 [+extra_configure_flags+][+ ENDIF extra_configure_flags +]
83f96a51 1149@endif [+prefix+][+module+]-bootstrap
12fb418d 1150[+ ENDFOR bootstrap_stage +]
1151[+ ENDIF bootstrap +]
c15fb64c 1152[+ ENDDEF +]
1153
1154[+ DEFINE all +]
1155.PHONY: all-[+prefix+][+module+] maybe-all-[+prefix+][+module+]
1156maybe-all-[+prefix+][+module+]:
13935149 1157@if gcc-bootstrap
1158all-[+prefix+][+module+]: stage_current
1159@endif gcc-bootstrap
c15fb64c 1160@if [+prefix+][+module+]
1161TARGET-[+prefix+][+module+]=[+
d45318b3 1162 IF all_target +][+all_target+][+ ELSE +]all[+ ENDIF all_target +]
c15fb64c 1163maybe-all-[+prefix+][+module+]: all-[+prefix+][+module+]
13935149 1164all-[+prefix+][+module+]: configure-[+prefix+][+module+][+ IF bootstrap +][+ ELSE +]
26526d23 1165 @: $(MAKE); $(unstage)[+ ENDIF bootstrap +]
1166 @r=`${PWD_COMMAND}`; export r; \
7a8ca04a 1167 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
eea1ae23 1168 [+exports+] [+extra_exports+] \
c15fb64c 1169 (cd [+subdir+]/[+module+] && \
13687c85 1170 $(MAKE) $(BASE_FLAGS_TO_PASS) [+args+] [+stage1_args+] [+extra_make_flags+] \
c898f165 1171 $(TARGET-[+prefix+][+module+]))
c15fb64c 1172@endif [+prefix+][+module+]
12fb418d 1173
1174[+ IF bootstrap +]
1175[+ FOR bootstrap_stage +]
1176.PHONY: all-stage[+id+]-[+prefix+][+module+] maybe-all-stage[+id+]-[+prefix+][+module+]
1177.PHONY: clean-stage[+id+]-[+prefix+][+module+] maybe-clean-stage[+id+]-[+prefix+][+module+]
1178maybe-all-stage[+id+]-[+prefix+][+module+]:
1179maybe-clean-stage[+id+]-[+prefix+][+module+]:
83f96a51 1180@if [+prefix+][+module+]-bootstrap
12fb418d 1181maybe-all-stage[+id+]-[+prefix+][+module+]: all-stage[+id+]-[+prefix+][+module+]
1182all-stage[+id+]: all-stage[+id+]-[+prefix+][+module+]
8283f873 1183TARGET-stage[+id+]-[+prefix+][+module+] = $(TARGET-[+prefix+][+module+])
12fb418d 1184all-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
26526d23 1185 @[ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start
12fb418d 1186 @r=`${PWD_COMMAND}`; export r; \
1187 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
bd1f9655 1188 TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
12fb418d 1189 [+exports+][+ IF prev +] \
eea1ae23 1190 [+poststage1_exports+][+ ENDIF prev +] [+extra_exports+] \
12fb418d 1191 cd [+subdir+]/[+module+] && \
b4c71cbb 1192 [+autoprofile+] \
bd1f9655 1193 $(MAKE) $(BASE_FLAGS_TO_PASS)[+ IF prefix +] \
1194 CFLAGS="$(CFLAGS_FOR_TARGET)" \
1195 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \
1196 LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"[+ ELSE prefix +] \
1197 CFLAGS="$(STAGE[+id+]_CFLAGS)" \
e976dfb8 1198 GENERATOR_CFLAGS="$(STAGE[+id+]_GENERATOR_CFLAGS)" \
eea1ae23 1199 CXXFLAGS="$(STAGE[+id+]_CXXFLAGS)"[+ IF prev +] \
bd1f9655 1200 LIBCFLAGS="$(STAGE[+id+]_CFLAGS)"[+ ELSE prev +] \
1201 LIBCFLAGS="$(LIBCFLAGS)"[+ ENDIF prev +][+ ENDIF prefix +] \
1202 CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
1203 CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
1204 LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
13687c85 1205 [+args+] [+IF prev +][+poststage1_args+][+ ELSE prev +] \
1206 [+stage1_args+][+ ENDIF prev +] [+extra_make_flags+] \
b4c71cbb 1207 TFLAGS="$(STAGE[+id+]_TFLAGS)" [+profile_data+] \
8283f873 1208 $(TARGET-stage[+id+]-[+prefix+][+module+])
12fb418d 1209
1210maybe-clean-stage[+id+]-[+prefix+][+module+]: clean-stage[+id+]-[+prefix+][+module+]
1211clean-stage[+id+]: clean-stage[+id+]-[+prefix+][+module+]
1212clean-stage[+id+]-[+prefix+][+module+]:
f94784f4 1213 @if [ $(current_stage) = stage[+id+] ]; then \
1214 [ -f [+subdir+]/[+module+]/Makefile ] || exit 0; \
1215 else \
1216 [ -f [+subdir+]/stage[+id+]-[+module+]/Makefile ] || exit 0; \
1217 $(MAKE) stage[+id+]-start; \
1218 fi; \
12fb418d 1219 cd [+subdir+]/[+module+] && \
13687c85 1220 $(MAKE) [+args+] [+ IF prev +][+poststage1_args+][+ ELSE prev +] \
1221 [+stage1_args+][+ ENDIF prev +] [+extra_make_flags+] clean
83f96a51 1222@endif [+prefix+][+module+]-bootstrap
12fb418d 1223
1224[+ ENDFOR bootstrap_stage +]
1225[+ ENDIF bootstrap +]
c15fb64c 1226[+ ENDDEF +]
1227
1228# --------------------------------------
1229# Modules which run on the build machine
1230# --------------------------------------
1231[+ FOR build_modules +]
1232[+ configure prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)"
d45318b3 1233 host_alias=(get "host" "${build_alias}")
1234 target_alias=(get "target" "${target_alias}")
c15fb64c 1235 args="$(BUILD_CONFIGARGS)" no-config-site=true +]
1236
9841cd80 1237[+ all prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)"
1238 args="$(EXTRA_BUILD_FLAGS)" +]
c15fb64c 1239[+ ENDFOR build_module +]
805e22b2 1240
1241# --------------------------------------
1242# Modules which run on the host machine
1243# --------------------------------------
1244[+ FOR host_modules +]
12fb418d 1245[+ configure prefix="" subdir="$(HOST_SUBDIR)"
1246 exports="$(HOST_EXPORTS)"
1247 poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)"
d45318b3 1248 host_alias=(get "host" "${host_alias}")
1249 target_alias=(get "target" "${target_alias}")
c15fb64c 1250 args="$(HOST_CONFIGARGS)" +]
2a1ac811 1251
12fb418d 1252[+ all prefix="" subdir="$(HOST_SUBDIR)"
1253 exports="$(HOST_EXPORTS)"
1254 poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)"
c898f165 1255 args="$(EXTRA_HOST_FLAGS)"
13687c85 1256 stage1_args="$(STAGE1_FLAGS_TO_PASS)"
12fb418d 1257 poststage1_args="$(POSTSTAGE1_FLAGS_TO_PASS)" +]
805e22b2 1258
4d9c9c81 1259.PHONY: check-[+module+] maybe-check-[+module+]
1260maybe-check-[+module+]:
01b41571 1261@if [+module+]
1262maybe-check-[+module+]: check-[+module+]
805e22b2 1263[+ IF no_check +]
805e22b2 1264check-[+module+]:
1265[+ ELIF no_check_cross +]
805e22b2 1266# This module is only tested in a native toolchain.
1267check-[+module+]:
83f96a51 1268 @: $(MAKE); $(unstage)
215cfab2 1269 @if [ '$(host)' = '$(target)' ]; then \
7a8ca04a 1270 r=`${PWD_COMMAND}`; export r; \
1271 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
53eea98c 1272 $(HOST_EXPORTS) [+ IF bootstrap +]$(EXTRA_HOST_EXPORTS)[+
1273 ENDIF bootstrap +] \
c1eb9e31 1274 (cd $(HOST_SUBDIR)/[+module+] && \
53eea98c 1275 $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+][+
1276 IF bootstrap +] $(EXTRA_BOOTSTRAP_FLAGS)[+ ENDIF bootstrap +] check)
602d002b 1277 fi
1278[+ ELSE check +]
602d002b 1279check-[+module+]:
83f96a51 1280 @: $(MAKE); $(unstage)
7a8ca04a 1281 @r=`${PWD_COMMAND}`; export r; \
1282 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
53eea98c 1283 $(HOST_EXPORTS) [+ IF bootstrap +]$(EXTRA_HOST_EXPORTS)[+
1284 ENDIF bootstrap +] \
c1eb9e31 1285 (cd $(HOST_SUBDIR)/[+module+] && \
53eea98c 1286 $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+][+
1287 IF bootstrap +] $(EXTRA_BOOTSTRAP_FLAGS)[+ ENDIF bootstrap +] check)
805e22b2 1288[+ ENDIF no_check +]
01b41571 1289@endif [+module+]
805e22b2 1290
805e22b2 1291.PHONY: install-[+module+] maybe-install-[+module+]
1292maybe-install-[+module+]:
01b41571 1293@if [+module+]
1294maybe-install-[+module+]: install-[+module+]
4d9c9c81 1295[+ IF no_install +]
805e22b2 1296install-[+module+]:
1297[+ ELSE install +]
805e22b2 1298install-[+module+]: installdirs
83f96a51 1299 @: $(MAKE); $(unstage)
7a8ca04a 1300 @r=`${PWD_COMMAND}`; export r; \
1301 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
27e3aebd 1302 $(HOST_EXPORTS) \
c1eb9e31 1303 (cd $(HOST_SUBDIR)/[+module+] && \
39c05b8e 1304 $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] install)
805e22b2 1305[+ ENDIF no_install +]
01b41571 1306@endif [+module+]
9621e512 1307
2b7a4d59 1308.PHONY: install-strip-[+module+] maybe-install-strip-[+module+]
1309maybe-install-strip-[+module+]:
1310@if [+module+]
1311maybe-install-strip-[+module+]: install-strip-[+module+]
1312[+ IF no_install +]
1313install-strip-[+module+]:
1314[+ ELSE install +]
1315install-strip-[+module+]: installdirs
1316 @: $(MAKE); $(unstage)
1317 @r=`${PWD_COMMAND}`; export r; \
1318 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1319 $(HOST_EXPORTS) \
1320 (cd $(HOST_SUBDIR)/[+module+] && \
1321 $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] install-strip)
1322[+ ENDIF no_install +]
1323@endif [+module+]
1324
51f93521 1325# Other targets (info, dvi, pdf, etc.)
9621e512 1326[+ FOR recursive_targets +]
1327.PHONY: maybe-[+make_target+]-[+module+] [+make_target+]-[+module+]
1328maybe-[+make_target+]-[+module+]:
01b41571 1329@if [+module+]
1330maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+]
9621e512 1331[+ IF (match-value? = "missing" (get "make_target") ) +]
1332# [+module+] doesn't support [+make_target+].
1333[+make_target+]-[+module+]:
1334[+ ELSE +]
1335[+make_target+]-[+module+]: [+
1336 FOR depend +]\
1337 [+depend+]-[+module+] [+
1338 ENDFOR depend +]
83f96a51 1339 @[+ IF bootstrap +][+ ELSE +]: $(MAKE); $(unstage)
8283f873 1340 @[+ ENDIF bootstrap +][ -f ./[+module+]/Makefile ] || exit 0; \
9621e512 1341 r=`${PWD_COMMAND}`; export r; \
1342 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
27e3aebd 1343 $(HOST_EXPORTS) \
6caa530d 1344 for flag in $(EXTRA_HOST_FLAGS) [+extra_make_flags+]; do \
9621e512 1345 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
1346 done; \
215cfab2 1347 echo "Doing [+make_target+] in [+module+]"; \
c1eb9e31 1348 (cd $(HOST_SUBDIR)/[+module+] && \
9621e512 1349 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
1350 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
1351 "RANLIB=$${RANLIB}" \
75d6a0a9 1352 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
6caa530d 1353 [+make_target+]) \
9621e512 1354 || exit 1
1355[+ ENDIF +]
01b41571 1356@endif [+module+]
9621e512 1357[+ ENDFOR recursive_targets +]
805e22b2 1358[+ ENDFOR host_modules +]
1359
1360# ---------------------------------------
1361# Modules which run on the target machine
1362# ---------------------------------------
1363[+ FOR target_modules +]
805e22b2 1364
c15fb64c 1365[+ IF raw_cxx +]
1366[+ configure prefix="target-" subdir="$(TARGET_SUBDIR)"
83f96a51 1367 check_multilibs=true
c15fb64c 1368 exports="$(RAW_CXX_TARGET_EXPORTS)"
d45318b3 1369 host_alias=(get "host" "${target_alias}")
1370 target_alias=(get "target" "${target_alias}")
c15fb64c 1371 args="$(TARGET_CONFIGARGS)" no-config-site=true +]
1372
1373[+ all prefix="target-" subdir="$(TARGET_SUBDIR)"
1374 exports="$(RAW_CXX_TARGET_EXPORTS)"
c898f165 1375 args="$(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'" +]
c15fb64c 1376[+ ELSE +]
1377[+ configure prefix="target-" subdir="$(TARGET_SUBDIR)"
83f96a51 1378 check_multilibs=true
c15fb64c 1379 exports="$(NORMAL_TARGET_EXPORTS)"
d45318b3 1380 host_alias=(get "host" "${target_alias}")
1381 target_alias=(get "target" "${target_alias}")
c15fb64c 1382 args="$(TARGET_CONFIGARGS)" no-config-site=true +]
1383
1384[+ all prefix="target-" subdir="$(TARGET_SUBDIR)"
1385 exports="$(NORMAL_TARGET_EXPORTS)"
c898f165 1386 args="$(EXTRA_TARGET_FLAGS)" +]
c15fb64c 1387[+ ENDIF +]
4d9c9c81 1388
1389.PHONY: check-target-[+module+] maybe-check-target-[+module+]
1390maybe-check-target-[+module+]:
01b41571 1391@if target-[+module+]
1392maybe-check-target-[+module+]: check-target-[+module+]
805e22b2 1393[+ IF no_check +]
1394# Dummy target for uncheckable module.
805e22b2 1395check-target-[+module+]:
1396[+ ELSE check +]
805e22b2 1397check-target-[+module+]:
83f96a51 1398 @: $(MAKE); $(unstage)
7a8ca04a 1399 @r=`${PWD_COMMAND}`; export r; \
85115a11 1400 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
27e3aebd 1401IF raw_cxx +]
1402 $(RAW_CXX_TARGET_EXPORTS) \[+
1403ELSE normal_cxx +]
1404 $(NORMAL_TARGET_EXPORTS) \[+
1405ENDIF raw_cxx +]
602d002b 1406 (cd $(TARGET_SUBDIR)/[+module+] && \
1407 $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
1408 IF raw_cxx
1409 +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+
1410 ENDIF raw_cxx
1b53fe78 1411 +] [+extra_make_flags+] check)
805e22b2 1412[+ ENDIF no_check +]
01b41571 1413@endif target-[+module+]
4d9c9c81 1414
805e22b2 1415.PHONY: install-target-[+module+] maybe-install-target-[+module+]
1416maybe-install-target-[+module+]:
01b41571 1417@if target-[+module+]
1418maybe-install-target-[+module+]: install-target-[+module+]
4d9c9c81 1419[+ IF no_install +]
805e22b2 1420# Dummy target for uninstallable.
1421install-target-[+module+]:
1422[+ ELSE install +]
805e22b2 1423install-target-[+module+]: installdirs
83f96a51 1424 @: $(MAKE); $(unstage)
7a8ca04a 1425 @r=`${PWD_COMMAND}`; export r; \
85115a11 1426 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
27e3aebd 1427IF raw_cxx +]
1428 $(RAW_CXX_TARGET_EXPORTS) \[+
1429ELSE normal_cxx +]
1430 $(NORMAL_TARGET_EXPORTS) \[+
1431ENDIF raw_cxx +]
602d002b 1432 (cd $(TARGET_SUBDIR)/[+module+] && \
1b53fe78 1433 $(MAKE) $(TARGET_FLAGS_TO_PASS) [+extra_make_flags+] install)
805e22b2 1434[+ ENDIF no_install +]
01b41571 1435@endif target-[+module+]
9621e512 1436
2b7a4d59 1437.PHONY: install-strip-target-[+module+] maybe-install-strip-target-[+module+]
1438maybe-install-strip-target-[+module+]:
1439@if target-[+module+]
1440maybe-install-strip-target-[+module+]: install-strip-target-[+module+]
1441[+ IF no_install +]
1442# Dummy target for uninstallable.
1443install-strip-target-[+module+]:
1444[+ ELSE install +]
1445install-strip-target-[+module+]: installdirs
1446 @: $(MAKE); $(unstage)
1447 @r=`${PWD_COMMAND}`; export r; \
1448 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
1449IF raw_cxx +]
1450 $(RAW_CXX_TARGET_EXPORTS) \[+
1451ELSE normal_cxx +]
1452 $(NORMAL_TARGET_EXPORTS) \[+
1453ENDIF raw_cxx +]
1454 (cd $(TARGET_SUBDIR)/[+module+] && \
1455 $(MAKE) $(TARGET_FLAGS_TO_PASS) [+extra_make_flags+] install-strip)
1456[+ ENDIF no_install +]
1457@endif target-[+module+]
1458
51f93521 1459# Other targets (info, dvi, pdf, etc.)
9621e512 1460[+ FOR recursive_targets +]
1461.PHONY: maybe-[+make_target+]-target-[+module+] [+make_target+]-target-[+module+]
1462maybe-[+make_target+]-target-[+module+]:
01b41571 1463@if target-[+module+]
1464maybe-[+make_target+]-target-[+module+]: [+make_target+]-target-[+module+]
9621e512 1465[+ IF (match-value? = "missing" (get "make_target") ) +]
1466# [+module+] doesn't support [+make_target+].
1467[+make_target+]-target-[+module+]:
1468[+ ELSE +]
1469[+make_target+]-target-[+module+]: [+
1470 FOR depend +]\
1471 [+depend+]-target-[+module+] [+
1472 ENDFOR depend +]
83f96a51 1473 @: $(MAKE); $(unstage)
215cfab2 1474 @[ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] || exit 0; \
9621e512 1475 r=`${PWD_COMMAND}`; export r; \
85115a11 1476 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
27e3aebd 1477IF raw_cxx +]
1478 $(RAW_CXX_TARGET_EXPORTS) \[+
1479ELSE normal_cxx +]
1480 $(NORMAL_TARGET_EXPORTS) \[+
1481ENDIF raw_cxx +]
215cfab2 1482 echo "Doing [+make_target+] in $(TARGET_SUBDIR)/[+module+]"; \
9621e512 1483 for flag in $(EXTRA_TARGET_FLAGS); do \
1484 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
1485 done; \
1486 (cd $(TARGET_SUBDIR)/[+module+] && \
1487 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
1488 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
1489 "RANLIB=$${RANLIB}" \
75d6a0a9 1490 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
1b53fe78 1491 [+extra_make_flags+] [+make_target+]) \
9621e512 1492 || exit 1
1493[+ ENDIF +]
01b41571 1494@endif target-[+module+]
9621e512 1495[+ ENDFOR recursive_targets +]
805e22b2 1496[+ ENDFOR target_modules +]
2a1ac811 1497
55df1c00 1498@if target-libgomp
1499.PHONY: check-target-libgomp-c++
1500check-target-libgomp-c++:
1501 $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) c++.exp" check-target-libgomp
1502
13532559 1503.PHONY: check-target-libgomp-fortran
1504check-target-libgomp-fortran:
1505 $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) fortran.exp" check-target-libgomp
1506
55df1c00 1507@endif target-libgomp
1508
1509@if target-libitm
1510.PHONY: check-target-libitm-c++
1511check-target-libitm-c++:
1512 $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) c++.exp" check-target-libitm
1513
1514@endif target-libitm
1515
805e22b2 1516# ----------
1517# GCC module
1518# ----------
2a1ac811 1519
54f0538b 1520@if gcc-no-bootstrap
2a1ac811 1521.PHONY: cross
a1ad7483 1522cross: all-build all-gas all-ld
7a8ca04a 1523 @r=`${PWD_COMMAND}`; export r; \
1524 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1b53fe78 1525 $(HOST_EXPORTS) \
2a1ac811 1526 echo "Building the C and C++ compiler"; \
1527 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
7a8ca04a 1528 @r=`${PWD_COMMAND}`; export r; \
215cfab2 1529 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
2a1ac811 1530 echo "Building runtime libraries"; \
599a3eac 1531 $(MAKE) $(RECURSE_FLAGS_TO_PASS) LANGUAGES="c c++" all
54f0538b 1532@endif gcc-no-bootstrap
2a1ac811 1533
01b41571 1534@if gcc
21a0251d 1535[+ FOR languages +]
1536.PHONY: check-gcc-[+language+] check-[+language+]
1537check-gcc-[+language+]:
1538 r=`${PWD_COMMAND}`; export r; \
1539 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1540 $(HOST_EXPORTS) \
1541 (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) [+gcc-check-target+]);
87969c8c 1542check-[+language+]: check-gcc-[+language+][+ FOR lib-check-target +] [+ lib-check-target +][+ ENDFOR lib-check-target +]
21a0251d 1543[+ ENDFOR languages +]
2a1ac811 1544
9281483c 1545# The gcc part of install-no-fixedincludes, which relies on an intimate
1546# knowledge of how a number of gcc internal targets (inter)operate. Delegate.
1547.PHONY: gcc-install-no-fixedincludes
1548gcc-install-no-fixedincludes:
805e22b2 1549 @if [ -f ./gcc/Makefile ]; then \
7a8ca04a 1550 r=`${PWD_COMMAND}`; export r; \
9281483c 1551 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1b53fe78 1552 $(HOST_EXPORTS) \
9281483c 1553 (cd ./gcc \
1554 && $(MAKE) $(GCC_FLAGS_TO_PASS) install-no-fixedincludes); \
805e22b2 1555 else true; fi
01b41571 1556@endif gcc
9621e512 1557
2d64c2fd 1558# ---------------------
1559# GCC bootstrap support
1560# ---------------------
1561
6caa530d 1562# We track the current stage (the one in 'gcc') in the stage_current file.
1563# stage_last instead tracks the stage that was built last. These targets
1564# are dummy when toplevel bootstrap is not active.
1565
8283f873 1566# While making host and target tools, symlinks to the final stage must be
83f96a51 1567# there, so $(unstage) should be run at various points. To avoid excessive
1568# recursive invocations of make, we "inline" them using a variable. These
1569# must be referenced as ": $(MAKE) ; $(unstage)" rather than "$(unstage)"
1570# to avoid warnings from the GNU Make job server.
8283f873 1571
1572unstage = :
1573stage = :
26526d23 1574current_stage = ""
8283f873 1575
6caa530d 1576@if gcc-bootstrap
f0903548 1577unstage = if [ -f stage_last ]; then [ -f stage_current ] || $(MAKE) `cat stage_last`-start || exit 1; else :; fi
9d44a802 1578stage = if [ -f stage_current ]; then $(MAKE) `cat stage_current`-end || exit 1; else :; fi
26526d23 1579current_stage = "`cat stage_current 2> /dev/null`"
6caa530d 1580@endif gcc-bootstrap
1581
8283f873 1582.PHONY: unstage stage
1583unstage:
83f96a51 1584 @: $(MAKE); $(unstage)
6caa530d 1585stage:
83f96a51 1586 @: $(MAKE); $(stage)
6caa530d 1587
0c8a85c6 1588# Disable commands for lean bootstrap.
1589LEAN = false
1590
5965d276 1591# We name the build directories for the various stages "stage1-gcc",
1592# "stage2-gcc","stage3-gcc", etc.
1593
1594# Since the 'compare' process will fail (on debugging information) if any
1595# directory names are different, we need to link the gcc directory for
83f96a51 1596# the previous stage to a constant name ('prev-gcc'), and to make the name of
5965d276 1597# the build directories constant as well. For the latter, we use naked names
1598# like 'gcc', because the scripts in that directory assume it. We use
1599# mv on platforms where symlinks to directories do not work or are not
1600# reliable.
1601
2d64c2fd 1602# 'touch' doesn't work right on some platforms.
1603STAMP = echo timestamp >
1604
5965d276 1605# We only want to compare .o files, so set this!
1606objext = .o
2d64c2fd 1607
5965d276 1608[+ FOR bootstrap-stage +]
54f0538b 1609.PHONY: stage[+id+]-start stage[+id+]-end
5965d276 1610
599a3eac 1611stage[+id+]-start::
83f96a51 1612 @: $(MAKE); $(stage); \
215cfab2 1613 echo stage[+id+] > stage_current; \
c1eb9e31 1614 echo stage[+id+] > stage_last; \
83f96a51 1615 $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)[+
c1eb9e31 1616 FOR host_modules +][+ IF bootstrap +]
a1ad7483 1617@if [+ module +]
c1eb9e31 1618 @cd $(HOST_SUBDIR); [ -d stage[+id+]-[+module+] ] || \
1619 mkdir stage[+id+]-[+module+]; \
215cfab2 1620 mv stage[+id+]-[+module+] [+module+][+ IF prev +]; \
0c8a85c6 1621 mv stage[+prev+]-[+module+] prev-[+module+] || test -f stage[+prev+]-lean [+ ENDIF prev +]
83f96a51 1622@endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
1623 @[ -d stage[+id+]-$(TARGET_SUBDIR) ] || \
1624 mkdir stage[+id+]-$(TARGET_SUBDIR); \
215cfab2 1625 mv stage[+id+]-$(TARGET_SUBDIR) $(TARGET_SUBDIR)[+ IF prev +]; \
0c8a85c6 1626 mv stage[+prev+]-$(TARGET_SUBDIR) prev-$(TARGET_SUBDIR) || test -f stage[+prev+]-lean [+ ENDIF prev +]
5965d276 1627
0c8a85c6 1628stage[+id+]-end:: [+ FOR host_modules +][+ IF bootstrap +]
a1ad7483 1629@if [+ module +]
215cfab2 1630 @if test -d $(HOST_SUBDIR)/[+module+]; then \
1631 cd $(HOST_SUBDIR); mv [+module+] stage[+id+]-[+module+][+ IF prev +]; \
1632 mv prev-[+module+] stage[+prev+]-[+module+]; : [+ ENDIF prev +]; \
83f96a51 1633 fi
1634@endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
215cfab2 1635 @if test -d $(TARGET_SUBDIR); then \
1636 mv $(TARGET_SUBDIR) stage[+id+]-$(TARGET_SUBDIR)[+ IF prev +]; \
1637 mv prev-$(TARGET_SUBDIR) stage[+prev+]-$(TARGET_SUBDIR); : [+ ENDIF prev +]; \
83f96a51 1638 fi
0c8a85c6 1639 rm -f stage_current
5965d276 1640
abe109c5 1641# Bubble a bug fix through all the stages up to stage [+id+]. They are
83f96a51 1642# remade, but not reconfigured. The next stage (if any) will not be
168ee878 1643# reconfigured either.
54f0538b 1644.PHONY: stage[+id+]-bubble
0c8a85c6 1645stage[+id+]-bubble:: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +]
e025d06f 1646 @r=`${PWD_COMMAND}`; export r; \
1647 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1648 if test -f stage[+id+]-lean [+
215cfab2 1649 IF prev +]|| test -f stage[+prev+]-lean [+ ENDIF prev +]; then \
1650 echo Skipping rebuild of stage[+id+]; \
3c782584 1651 else \
0c8a85c6 1652 $(MAKE) stage[+id+]-start; \[+IF lean +]
1653 if $(LEAN); then \
215cfab2 1654 rm -rf stage[+lean+]-*; \
1655 $(STAMP) stage[+lean+]-lean; \
0c8a85c6 1656 fi; \[+ ENDIF lean +]
8283f873 1657 $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage[+id+]; \
f5aebe3e 1658 fi[+ IF compare-target +]
9d44a802 1659 $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+compare-target+][+ ENDIF compare-target +]
a1ad7483 1660
2b64d19b 1661.PHONY: all-stage[+id+] clean-stage[+id+]
2b64d19b 1662do-clean: clean-stage[+id+]
2d64c2fd 1663
a1ad7483 1664# FIXME: Will not need to be conditional when toplevel bootstrap is the
1665# only possibility, but now it conflicts with no-bootstrap rules
1666@if gcc-bootstrap
5965d276 1667[+ IF compare-target +]
3c782584 1668[+compare-target+]:
e025d06f 1669 @r=`${PWD_COMMAND}`; export r; \
1670 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1671 if test -f stage[+prev+]-lean; then \
215cfab2 1672 echo Cannot compare object files as stage [+prev+] was deleted.; \
1673 exit 0; \
3c782584 1674 fi; \
83f96a51 1675 : $(MAKE); $(stage); \
215cfab2 1676 rm -f .bad_compare; \
1677 echo Comparing stages [+prev+] and [+id+]; \
77b633a0 1678 sed=`echo stage[+id+] | sed 's,^stage,,;s,.,.,g'`; \
1679 files=`find stage[+id+]-* -name "*$(objext)" -print | \
215cfab2 1680 sed -n s,^stage$$sed-,,p`; \
81fd0440 1681 for file in $${files} ${extra-compare}; do \
77b633a0 1682 f1=$$r/stage[+prev+]-$$file; f2=$$r/stage[+id+]-$$file; \
1683 if test ! -f $$f1; then continue; fi; \
5b542315 1684 $(do-[+compare-target+]) > /dev/null 2>&1; \
8283f873 1685 if test $$? -eq 1; then \
1686 case $$file in \
6fe86052 1687 @compare_exclusions@) \
8283f873 1688 echo warning: $$file differs ;; \
1689 *) \
1690 echo $$file differs >> .bad_compare ;; \
215cfab2 1691 esac; \
1692 fi; \
1693 done; \
2d64c2fd 1694 if [ -f .bad_compare ]; then \
1695 echo "Bootstrap comparison failure!"; \
1696 cat .bad_compare; \
1697 exit 1; \
1698 else \
26526d23 1699 echo Comparison successful.; \
215cfab2 1700 fi; \
3c782584 1701 $(STAMP) [+compare-target+][+ IF prev +]
0c8a85c6 1702 if $(LEAN); then \
1703 rm -rf stage[+prev+]-*; \
1704 $(STAMP) stage[+prev+]-lean; \
1705 fi[+ ENDIF prev +]
5965d276 1706[+ ENDIF compare-target +]
1707
1708[+ IF bootstrap-target +]
0c8a85c6 1709.PHONY: [+bootstrap-target+] [+bootstrap-target+]-lean
f5aebe3e 1710[+bootstrap-target+]:
1711 echo stage[+id+] > stage_final
1712 @r=`${PWD_COMMAND}`; export r; \
1713 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1714 $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage[+id+]-bubble
83f96a51 1715 @: $(MAKE); $(unstage)
f5aebe3e 1716 @r=`${PWD_COMMAND}`; export r; \
1717 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
bd1f9655 1718 TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
f5aebe3e 1719 $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
0c8a85c6 1720
1721[+bootstrap-target+]-lean:
1722 echo stage[+id+] > stage_final
1723 @r=`${PWD_COMMAND}`; export r; \
1724 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1725 $(MAKE) $(RECURSE_FLAGS_TO_PASS) LEAN=: stage[+id+]-bubble
1726 @: $(MAKE); $(unstage)
1727 @r=`${PWD_COMMAND}`; export r; \
1728 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
bd1f9655 1729 TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
0c8a85c6 1730 $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
5965d276 1731[+ ENDIF bootstrap-target +]
1732
2b64d19b 1733# Rules to wipe a stage and all the following ones, also used for cleanstrap
599a3eac 1734[+ IF prev +]distclean-stage[+prev+]:: distclean-stage[+id+] [+ ENDIF prev +]
2b64d19b 1735.PHONY: distclean-stage[+id+]
599a3eac 1736distclean-stage[+id+]::
83f96a51 1737 @: $(MAKE); $(stage)
021ff58f 1738 @test "`cat stage_last`" != stage[+id+] || rm -f stage_last
3c782584 1739 rm -rf stage[+id+]-* [+
5965d276 1740 IF compare-target +][+compare-target+] [+ ENDIF compare-target +]
5965d276 1741
1742[+ IF cleanstrap-target +]
1743.PHONY: [+cleanstrap-target+]
021ff58f 1744[+cleanstrap-target+]: do-distclean local-clean
1745 echo stage[+id+] > stage_final
1746 @r=`${PWD_COMMAND}`; export r; \
1747 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1748 $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage[+id+]-bubble
1749 @: $(MAKE); $(unstage)
1750 @r=`${PWD_COMMAND}`; export r; \
1751 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
bd1f9655 1752 TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
021ff58f 1753 $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
5965d276 1754[+ ENDIF cleanstrap-target +]
a1ad7483 1755@endif gcc-bootstrap
5965d276 1756
1757[+ ENDFOR bootstrap-stage +]
599a3eac 1758
919a60fa 1759stageprofile-end::
1760 $(MAKE) distclean-stagefeedback
599a3eac 1761
919a60fa 1762stagefeedback-start::
599a3eac 1763 @r=`${PWD_COMMAND}`; export r; \
1764 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
39917cd1 1765 for i in prev-*; do \
1766 j=`echo $$i | sed s/^prev-//`; \
919a60fa 1767 cd $$r/$$i && \
215cfab2 1768 { find . -type d | sort | sed 's,.*,$(SHELL) '"$$s"'/mkinstalldirs "../'$$j'/&",' | $(SHELL); } && \
1769 { find . -name '*.*da' | sed 's,.*,$(LN) -f "&" "../'$$j'/&",' | $(SHELL); }; \
919a60fa 1770 done
33e3141d 1771
2b64d19b 1772@if gcc-bootstrap
2b64d19b 1773do-distclean: distclean-stage1
26526d23 1774
1775# Provide a GCC build when we're building target libraries. This does
1776# not work as a dependency, just as the minimum necessary to avoid errors.
1777stage_last:
be9d4db8 1778 @r=`${PWD_COMMAND}`; export r; \
1779 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
26526d23 1780 $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage1-bubble
2b64d19b 1781
13935149 1782# Same as unstage, but not phony and defaulting to stage1-start. We place
1783# it in the dependency so that for example `make -j3 all-gcc' works.
1784stage_current:
1785 @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi
1786
26526d23 1787.PHONY: restrap
1db8021c 1788restrap::
26526d23 1789 @: $(MAKE); $(stage)
bd1f9655 1790 rm -rf stage1-$(TARGET_SUBDIR)[+ FOR bootstrap-stage +][+ IF prev
1791 +] stage[+id+]-*[+ ENDIF prev +][+ ENDFOR bootstrap-stage +]
1db8021c 1792restrap:: all
6c21862c 1793@endif gcc-bootstrap
26526d23 1794
805e22b2 1795# --------------------------------------
1796# Dependencies between different modules
1797# --------------------------------------
1798
ea8d3d75 1799# Generic dependencies for target modules on host stuff, especially gcc
26526d23 1800@if gcc-bootstrap[+ FOR target_modules +][+ IF bootstrap
1801 +][+ FOR bootstrap_stage +]
1802configure-stage[+id+]-target-[+module+]: maybe-all-stage[+id+]-gcc[+
1803 ENDFOR +][+ ELSE bootstrap +]
1804configure-target-[+module+]: stage_last[+
1805 ENDIF bootstrap +][+ ENDFOR target_modules +]
1806@endif gcc-bootstrap
1807
894a47b4 1808@if gcc-no-bootstrap[+ FOR target_modules +]
26526d23 1809configure-target-[+module+]: maybe-all-gcc[+
894a47b4 1810 ENDFOR target_modules +]
26526d23 1811@endif gcc-no-bootstrap
1812
ea8d3d75 1813
805e22b2 1814# There are two types of dependencies here: 'hard' dependencies, where one
1815# module simply won't build without the other; and 'soft' dependencies, where
1816# if the depended-on module is missing, the depending module will do without
1817# or find a substitute somewhere (perhaps installed). Soft dependencies
ea8d3d75 1818# are made here to depend on a 'maybe-' target. If you're not sure,
805e22b2 1819# it's safer to use a soft dependency.
1820
ea8d3d75 1821[+ ;; These Scheme functions build the bulk of the dependencies.
1822 ;; dep-target builds a string like "maybe-all-MODULE_KIND-gcc",
168ee878 1823 ;; where "maybe-" is only included if HARD is not true, and all-gcc
ea8d3d75 1824 ;; is taken from VAR-NAME.
1825 (define dep-target (lambda (module-kind var-name hard)
1826 (string-append
1827 (if hard "" "maybe-")
1828 (dep-subtarget var-name)
1829 module-kind
1830 (dep-module var-name)
1831 )))
1832
1833 ;; make-dep builds a dependency from the MODULE and ON AutoGen vars.
a1ad7483 1834 (define make-dep (lambda (module-kind on-kind)
ea8d3d75 1835 (string-append
1836 (dep-target module-kind "module" #t) ": "
a1ad7483 1837 (dep-target on-kind "on" (exist? "hard")))))
ea8d3d75 1838
1839 ;; dep-subtarget extracts everything up to the first dash in the given
1840 ;; AutoGen variable, for example it extracts "all-" out of "all-gcc".
1841 (define dep-subtarget (lambda (var-name)
1842 (substring (get var-name) 0 (+ 1 (string-index (get var-name) #\-)))))
1843
1844 ;; dep-module extracts everything up to the first dash in the given
1845 ;; AutoGen variable, for example it extracts "gcc" out of "all-gcc".
1846 (define dep-module (lambda (var-name)
1847 (substring (get var-name) (+ 1 (string-index (get var-name) #\-)))))
1848
1849 ;; dep-stage builds a string for the prefix of a bootstrap stage.
1850 (define dep-stage (lambda ()
1851 (string-append
1852 "stage"
1853 (get "id")
1854 "-")))
1855
1856 ;; dep-maybe is the same as the AutoGen expression "- hard 'maybe-'"
1857 ;; but is written in Scheme.
1858 (define dep-maybe (lambda ()
1859 (if (exist? "hard") "" "maybe-")))
1860
9488d90e 1861 ;; dep-kind returns returns "prebootstrap" for configure or build
1862 ;; dependencies of bootstrapped modules on a build module
1863 ;; (e.g. all-gcc on all-build-bison); "normal" if the dependency is
1864 ;; on an "install" target, or if the dependence module is not
1865 ;; bootstrapped; otherwise, it returns "bootstrap" or
1866 ;; "postbootstrap" depending on whether the dependent module is
1867 ;; bootstrapped. All this is only necessary for host and target
1868 ;; modules. It might seem like, in order to avoid build races, we
1869 ;; might need more elaborate detection between prebootstrap and
1870 ;; postbootstrap modules, but there are no host prebootstrap
1871 ;; modules. If there were any non-bootstrap host modules that
1872 ;; bootstrap modules depended on, we'd get unsatisfied per-stage
1873 ;; dependencies on them, which would be immediately noticed.
ea8d3d75 1874 (define dep-kind (lambda ()
9488d90e 1875 (cond
1876 ((and (hash-ref boot-modules (dep-module "module"))
1877 (=* (dep-module "on") "build-"))
1878 "prebootstrap")
ea8d3d75 1879
9488d90e 1880 ((or (= (dep-subtarget "on") "install-")
1881 (not (hash-ref boot-modules (dep-module "on"))))
1882 "normal")
1883
1884 ((hash-ref boot-modules (dep-module "module"))
1885 "bootstrap")
1886
1887 (1 "postbootstrap"))))
1888
1889 (define make-postboot-dep (lambda ()
1890 (let ((target (dep-module "module")) (dep "stage_last"))
1891 (unless (= (hash-ref postboot-targets target) dep)
1892 (hash-create-handle! postboot-targets target dep)
1893 ;; All non-bootstrap modules' configure target already
1894 ;; depend on dep.
1895 (unless (=* target "target-")
1896 (string-append "configure-" target ": " dep "\n"))))))
ea8d3d75 1897
1898 ;; We now build the hash table that is used by dep-kind.
1899 (define boot-modules (make-hash-table 113))
9488d90e 1900 (define postboot-targets (make-hash-table 113))
ea8d3d75 1901+]
1902
1903[+ FOR host_modules +][+
1904 (if (exist? "bootstrap")
1905 (hash-create-handle! boot-modules (get "module") #t))
1906 "" +][+ ENDFOR host_modules +]
97d52533 1907[+ FOR target_modules +][+
1908 (if (exist? "bootstrap")
1909 (hash-create-handle! boot-modules (string-append "target-" (get "module")) #t))
1910 "" +][+ ENDFOR target_modules +]
ea8d3d75 1911
1912# With all the machinery above in place, it is pretty easy to generate
1913# dependencies. Host dependencies are a bit more complex because we have
1914# to check for bootstrap/prebootstrap dependencies. To resolve
1915# prebootstrap dependencies, prebootstrap modules are gathered in
1916# a hash table.
9488d90e 1917[+ FOR dependencies +][+ CASE (dep-kind) +]
1918[+ == "prebootstrap" +][+ (make-dep "" "") +][+ FOR bootstrap_stage +]
1919[+ (make-dep (dep-stage) "") +][+ ENDFOR bootstrap_stage +]
1920[+ == "bootstrap" +][+ (make-dep "" "") +][+ FOR bootstrap_stage +]
1921[+ (make-dep (dep-stage) (dep-stage)) +][+ ENDFOR bootstrap_stage +]
1922[+ == "normal" +][+ (make-dep "" "") +]
1923[+ ESAC +][+ ENDFOR dependencies +]
1924
1925@if gcc-bootstrap
1926[+ FOR dependencies +][+ CASE (dep-kind) +]
1927[+ == "postbootstrap" +][+ (make-postboot-dep) +][+ ESAC +][+
1928ENDFOR dependencies +]@endif gcc-bootstrap
1929
1930@unless gcc-bootstrap
1931[+ FOR dependencies +][+ CASE (dep-kind) +]
1932[+ == "postbootstrap" +][+ (make-dep "" "") +]
1933[+ ESAC +][+ ENDFOR dependencies +]@endunless gcc-bootstrap
ea8d3d75 1934
894a47b4 1935# Dependencies for target modules on other target modules are
1936# described by lang_env_dependencies; the defaults apply to anything
1937# not mentioned there.
1938[+
1939 ;; Predicate for whether LANG was specified in lang_env_dependencies.
1940 (define lang-dep (lambda (lang)
1941 (hash-ref lang-env-deps (string-append (get "module") "-" lang))))
1942
1943 ;; Build the hash table we will need.
1944 (define lang-env-deps (make-hash-table 7))
1945+][+ FOR lang_env_dependencies +][+
1946 (if (exist? "cxx")
1947 (hash-create-handle! lang-env-deps
1948 (string-append (get "module") "-" "cxx") #t))
1949
1950 (if (exist? "no_c")
1951 (hash-create-handle! lang-env-deps
1952 (string-append (get "module") "-" "no_c") #t))
1953
1954 (if (exist? "no_gcc")
1955 (hash-create-handle! lang-env-deps
1956 (string-append (get "module") "-" "no_gcc") #t))
1957 "" +][+ ENDFOR lang_env_dependencies +]
1958
1959@if gcc-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc"))
1960 +][+ IF bootstrap +][+ FOR bootstrap_stage +]
1961configure-stage[+id+]-target-[+module+]: maybe-all-stage[+id+]-target-libgcc[+
1962 ENDFOR +][+ ENDIF bootstrap +][+ ENDIF +][+ ENDFOR target_modules +]
1963@endif gcc-bootstrap
1964
1965@if gcc-no-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc")) +]
1966configure-target-[+module+]: maybe-all-target-libgcc[+
1967 ENDIF +][+ ENDFOR target_modules +]
1968@endif gcc-no-bootstrap
1969
1970[+ FOR target_modules +][+ IF (not (lang-dep "no_c")) +]
1971configure-target-[+module+]: maybe-all-target-newlib maybe-all-target-libgloss[+
1972 ENDIF +][+ IF (lang-dep "cxx") +]
1973configure-target-[+module+]: maybe-all-target-libstdc++-v3[+
1974 ENDIF +]
1975[+ ENDFOR target_modules +]
1976
415470be 1977CONFIGURE_GDB_TK = @CONFIGURE_GDB_TK@
0311ff84 1978GDB_TK = @GDB_TK@
415470be 1979INSTALL_GDB_TK = @INSTALL_GDB_TK@
1980configure-gdb: $(CONFIGURE_GDB_TK)
ea8d3d75 1981all-gdb: $(gdbnlmrequirements) $(GDB_TK)
415470be 1982install-gdb: $(INSTALL_GDB_TK)
2a1ac811 1983
805e22b2 1984# Serialization dependencies. Host configures don't work well in parallel to
1985# each other, due to contention over config.cache. Target configures and
1986# build configures are similar.
1987@serialization_dependencies@
2a1ac811 1988
805e22b2 1989# --------------------------------
1990# Regenerating top level configury
1991# --------------------------------
2a1ac811 1992
1993# Rebuilding Makefile.in, using autogen.
041dd099 1994AUTOGEN = autogen
3290c0cf 1995$(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def
041dd099 1996 cd $(srcdir) && $(AUTOGEN) Makefile.def
2a1ac811 1997
71ab34df 1998# Rebuilding Makefile.
041dd099 1999Makefile: $(srcdir)/Makefile.in config.status
2000 CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
2001
9624cab1 2002config.status: configure
3a6fbbb0 2003 CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck
2a1ac811 2004
71ab34df 2005# Rebuilding configure.
041dd099 2006AUTOCONF = autoconf
5b2c7553 2007$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 \
55bba89a 2008 $(srcdir)/config/override.m4 $(srcdir)/config/proginstall.m4 \
2009 $(srcdir)/config/elf.m4 $(srcdir)/config/isl.m4 \
2010 $(srcdir)/libtool.m4 $(srcdir)/ltoptions.m4 $(srcdir)/ltsugar.m4 \
2011 $(srcdir)/ltversion.m4 $(srcdir)/lt~obsolete.m4
041dd099 2012 cd $(srcdir) && $(AUTOCONF)
2a1ac811 2013
523318a0 2014# ------------------------------
2015# Special directives to GNU Make
2016# ------------------------------
2017
523318a0 2018# Don't pass command-line variables to submakes.
2019.NOEXPORT:
2020MAKEOVERRIDES=
2021
2a1ac811 2022# end of Makefile.in