]> git.ipfire.org Git - thirdparty/gcc.git/blame - Makefile.tpl
Makefile.tpl: Fix comment errors.
[thirdparty/gcc.git] / Makefile.tpl
CommitLineData
d3ac17c9 1[+ AutoGen5 template -*- Mode: Makefile -*-
95ddd785
NN
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,
bb286d71 9# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation
95ddd785
NN
10#
11# This file is free software; you can redistribute it and/or modify
12# it under the terms of the GNU General Public License as published by
13# the Free Software Foundation; either version 2 of the License, or
14# (at your option) any later version.
15#
16# This program is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with this program; if not, write to the Free Software
539df155 23# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
95ddd785
NN
24#
25
295e261a
HPN
26# First, test for a proper version of make, but only where one is required.
27
28@if gcc
29ifeq (,$(.VARIABLES)) # The variable .VARIABLES, new with 3.80, is never empty.
30$(error GNU make version 3.80 or newer is required.)
31endif
32@endif gcc
33
df0f0674
NN
34# -------------------------------
35# Standard Autoconf-set variables
36# -------------------------------
4977bab6 37VPATH=@srcdir@
4977bab6 38
1c710c3c 39build_alias=@build_noncanonical@
e69bf64b
PB
40build_vendor=@build_vendor@
41build_os=@build_os@
e89fbdfe 42build=@build@
1c710c3c 43host_alias=@host_noncanonical@
e69bf64b
PB
44host_vendor=@host_vendor@
45host_os=@host_os@
e89fbdfe 46host=@host@
1c710c3c 47target_alias=@target_noncanonical@
e69bf64b
PB
48target_vendor=@target_vendor@
49target_os=@target_os@
e89fbdfe 50target=@target@
4977bab6 51
df0f0674 52program_transform_name = @program_transform_name@
0dffceed
NN
53
54prefix = @prefix@
55exec_prefix = @exec_prefix@
56
df0f0674
NN
57srcdir = @srcdir@
58
0dffceed
NN
59bindir = @bindir@
60sbindir = @sbindir@
61libexecdir = @libexecdir@
62datadir = @datadir@
63sysconfdir = @sysconfdir@
64sharedstatedir = @sharedstatedir@
65localstatedir = @localstatedir@
66libdir = @libdir@
67includedir = @includedir@
68oldincludedir = @oldincludedir@
69infodir = @infodir@
65d6e994
CD
70datarootdir = @datarootdir@
71docdir = @docdir@
9c4d2493 72pdfdir = @pdfdir@
65d6e994 73htmldir = @htmldir@
0dffceed 74mandir = @mandir@
95ddd785
NN
75man1dir = $(mandir)/man1
76man2dir = $(mandir)/man2
77man3dir = $(mandir)/man3
78man4dir = $(mandir)/man4
79man5dir = $(mandir)/man5
80man6dir = $(mandir)/man6
81man7dir = $(mandir)/man7
82man8dir = $(mandir)/man8
83man9dir = $(mandir)/man9
95ddd785 84
775956d0
NN
85INSTALL = @INSTALL@
86INSTALL_PROGRAM = @INSTALL_PROGRAM@
87INSTALL_SCRIPT = @INSTALL_SCRIPT@
88INSTALL_DATA = @INSTALL_DATA@
ad6717df
PB
89LN = @LN@
90LN_S = @LN_S@
58e24147
AM
91MAINT = @MAINT@
92MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
93MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
95ddd785 94
df0f0674
NN
95# -------------------------------------------------
96# Miscellaneous non-standard autoconf-set variables
97# -------------------------------------------------
95ddd785 98
df0f0674
NN
99# The gcc driver likes to know the arguments it was configured with.
100TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@
95ddd785 101
df0f0674
NN
102tooldir = @tooldir@
103build_tooldir = @build_tooldir@
95ddd785 104
df0f0674 105GDB_NLM_DEPS =
95ddd785 106
df0f0674
NN
107# This is the name of the environment variable used for the path to
108# the libraries.
109RPATH_ENVVAR = @RPATH_ENVVAR@
95ddd785 110
df0f0674
NN
111# Build programs are put under this directory.
112BUILD_SUBDIR = @build_subdir@
113# This is set by the configure script to the arguments to use when configuring
114# directories built for the build system.
25b42232 115BUILD_CONFIGARGS = @build_configargs@ --with-build-subdir="$(BUILD_SUBDIR)"
23f6b2f9
PB
116
117# This is the list of variables to export in the environment when
118# configuring any subdirectory. It must also be exported whenever
119# recursing into a build directory in case that directory's Makefile
120# re-runs configure.
121BASE_EXPORTS = \
122 FLEX="$(FLEX)"; export FLEX; \
123 LEX="$(LEX)"; export LEX; \
124 BISON="$(BISON)"; export BISON; \
125 YACC="$(YACC)"; export YACC; \
126 M4="$(M4)"; export M4; \
127 MAKEINFO="$(MAKEINFO)"; export MAKEINFO;
128
4fc4dd12 129# This is the list of variables to export in the environment when
23f6b2f9 130# configuring subdirectories for the build system.
4fc4dd12 131BUILD_EXPORTS = \
23f6b2f9 132 $(BASE_EXPORTS) \
4fc4dd12
DJ
133 AR="$(AR_FOR_BUILD)"; export AR; \
134 AS="$(AS_FOR_BUILD)"; export AS; \
135 CC="$(CC_FOR_BUILD)"; export CC; \
136 CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
137 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
138 CXX="$(CXX_FOR_BUILD)"; export CXX; \
139 CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
140 GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
141 GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
142 DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
143 LD="$(LD_FOR_BUILD)"; export LD; \
144 LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
145 NM="$(NM_FOR_BUILD)"; export NM; \
146 RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
0136f2f7 147 WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
901119ae 148 WINDMC="$(WINDMC_FOR_BUILD)"; export WINDMC;
df0f0674 149
f8c33439
JM
150# These variables must be set on the make command line for directories
151# built for the build system to override those in BASE_FLAGS_TO_PASSS.
152EXTRA_BUILD_FLAGS = \
153 CFLAGS="$(CFLAGS_FOR_BUILD)" \
154 LDFLAGS="$(LDFLAGS_FOR_BUILD)"
155
df0f0674
NN
156# This is the list of directories to built for the host system.
157SUBDIRS = @configdirs@
158# This is set by the configure script to the arguments to use when configuring
159# directories built for the host system.
160HOST_CONFIGARGS = @host_configargs@
215c351a
PB
161# Host programs are put under this directory, which is . except if building
162# with srcdir=..
163HOST_SUBDIR = @host_subdir@
4fc4dd12 164# This is the list of variables to export in the environment when
2abefe3d
PB
165# configuring subdirectories for the host system. We need to pass
166# some to the GCC configure because of its hybrid host/target nature.
4fc4dd12 167HOST_EXPORTS = \
23f6b2f9 168 $(BASE_EXPORTS) \
4fc4dd12
DJ
169 CC="$(CC)"; export CC; \
170 CFLAGS="$(CFLAGS)"; export CFLAGS; \
171 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
172 CXX="$(CXX)"; export CXX; \
173 CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
174 AR="$(AR)"; export AR; \
175 AS="$(AS)"; export AS; \
176 CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
177 DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
178 LD="$(LD)"; export LD; \
179 LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \
180 NM="$(NM)"; export NM; \
181 RANLIB="$(RANLIB)"; export RANLIB; \
182 WINDRES="$(WINDRES)"; export WINDRES; \
901119ae 183 WINDMC="$(WINDMC)"; export WINDMC; \
4fc4dd12 184 OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
1c020272 185 OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
2abefe3d
PB
186 AR_FOR_TARGET="$(AR_FOR_TARGET)"; export AR_FOR_TARGET; \
187 AS_FOR_TARGET="$(AS_FOR_TARGET)"; export AS_FOR_TARGET; \
188 GCC_FOR_TARGET="$(GCC_FOR_TARGET)"; export GCC_FOR_TARGET; \
189 LD_FOR_TARGET="$(LD_FOR_TARGET)"; export LD_FOR_TARGET; \
190 NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \
191 OBJDUMP_FOR_TARGET="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP_FOR_TARGET; \
192 RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \
4fc4dd12
DJ
193 TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
194 GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
4c4a5bbc 195 GMPINC="$(HOST_GMPINC)"; export GMPINC; \
1061f99e
PB
196@if gcc-bootstrap
197 $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
198@endif gcc-bootstrap
0bff65e7 199 $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
4fc4dd12
DJ
200
201# Similar, for later GCC stages.
ce406537 202POSTSTAGE1_HOST_EXPORTS = \
a52a0a7f 203 $(HOST_EXPORTS) \
215c351a
PB
204 CC="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
205 -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \
206 CC_FOR_BUILD="$(STAGE_CC_WRAPPER) \
207 $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
208 -B$$r/$(HOST_SUBDIR)/prev-gcc/ \
ec6c7392 209 -B$(build_tooldir)/bin/"; export CC_FOR_BUILD; \
ec6c7392 210 LDFLAGS="$(BOOT_LDFLAGS)"; export LDFLAGS;
df0f0674 211
df0f0674
NN
212# Target libraries are put under this directory:
213TARGET_SUBDIR = @target_subdir@
214# This is set by the configure script to the arguments to use when configuring
215# directories built for the target.
25b42232 216TARGET_CONFIGARGS = @target_configargs@ --with-target-subdir="$(TARGET_SUBDIR)"
4fc4dd12 217# This is the list of variables to export in the environment when
23f6b2f9 218# configuring subdirectories for the host system.
4fc4dd12 219BASE_TARGET_EXPORTS = \
23f6b2f9 220 $(BASE_EXPORTS) \
4fc4dd12 221 AR="$(AR_FOR_TARGET)"; export AR; \
2abefe3d 222 AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \
4fc4dd12 223 CC="$(CC_FOR_TARGET)"; export CC; \
1c8bd6a3 224 CFLAGS="$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \
4fc4dd12 225 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
e7daab31 226 CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
1c8bd6a3 227 CXXFLAGS="$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \
4fc4dd12
DJ
228 GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
229 GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \
230 DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
2abefe3d 231 LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \
4fc4dd12 232 LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
040b1c5a 233 LIPO="$(LIPO_FOR_TARGET)"; export LIPO; \
2abefe3d 234 NM="$(COMPILER_NM_FOR_TARGET)"; export NM; \
d739199a 235 OBJDUMP="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP; \
4fc4dd12 236 RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
040b1c5a 237 STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \
4c4a5bbc 238 WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
901119ae 239 WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \
0bff65e7 240 $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
4fc4dd12
DJ
241
242RAW_CXX_TARGET_EXPORTS = \
243 $(BASE_TARGET_EXPORTS) \
244 CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
245 CXX="$(RAW_CXX_FOR_TARGET)"; export CXX;
246
247NORMAL_TARGET_EXPORTS = \
248 $(BASE_TARGET_EXPORTS) \
249 CXX="$(CXX_FOR_TARGET)"; export CXX;
df0f0674 250
6de9cd9a
DN
251# Where to find GMP
252HOST_GMPLIBS = @gmplibs@
253HOST_GMPINC = @gmpinc@
254
df0f0674
NN
255# ----------------------------------------------
256# Programs producing files for the BUILD machine
257# ----------------------------------------------
258
259SHELL = @config_shell@
260
261# pwd command to use. Allow user to override default by setting PWDCMD in
262# the environment to account for automounters. The make variable must not
263# be called PWDCMD, otherwise the value set here is passed to make
264# subprocesses and overrides the setting from the user's environment.
8c90b13a
L
265# Don't use PWD since it is a common shell environment variable and we
266# don't want to corrupt it.
267PWD_COMMAND = $${PWDCMD-pwd}
df0f0674
NN
268
269# compilers to use to create programs which must be run in the build
270# environment.
0999159b
PB
271AR_FOR_BUILD = @AR_FOR_BUILD@
272AS_FOR_BUILD = @AS_FOR_BUILD@
df0f0674 273CC_FOR_BUILD = @CC_FOR_BUILD@
6691a79e 274CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
0999159b
PB
275CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@
276CXX_FOR_BUILD = @CXX_FOR_BUILD@
277DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@
278GCJ_FOR_BUILD = @GCJ_FOR_BUILD@
279GFORTRAN_FOR_BUILD = @GFORTRAN_FOR_BUILD@
280LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
281LD_FOR_BUILD = @LD_FOR_BUILD@
282NM_FOR_BUILD = @NM_FOR_BUILD@
283RANLIB_FOR_BUILD = @RANLIB_FOR_BUILD@
284WINDMC_FOR_BUILD = @WINDMC_FOR_BUILD@
285WINDRES_FOR_BUILD = @WINDRES_FOR_BUILD@
df0f0674
NN
286
287# Special variables passed down in EXTRA_GCC_FLAGS. They are defined
288# here so that they can be overridden by Makefile fragments.
df0f0674
NN
289BUILD_PREFIX = @BUILD_PREFIX@
290BUILD_PREFIX_1 = @BUILD_PREFIX_1@
95ddd785 291
45f366ab
PB
292# Flags to pass to stage2 and later makes. They are defined
293# here so that they can be overridden by Makefile fragments.
294BOOT_CFLAGS= -g -O2
d19bca38 295BOOT_LDFLAGS=
45f366ab 296
2abefe3d
PB
297BISON = @BISON@
298YACC = @YACC@
299FLEX = @FLEX@
300LEX = @LEX@
301M4 = @M4@
302MAKEINFO = @MAKEINFO@
303EXPECT = @EXPECT@
304RUNTEST = @RUNTEST@
95ddd785
NN
305
306# This just becomes part of the MAKEINFO definition passed down to
307# sub-makes. It lets flags be given on the command line while still
308# using the makeinfo from the object tree.
2f50999f
GP
309# (Default to avoid splitting info files by setting the threshold high.)
310MAKEINFOFLAGS = --split-size=5000000
95ddd785 311
df0f0674
NN
312# ---------------------------------------------
313# Programs producing files for the HOST machine
314# ---------------------------------------------
95ddd785 315
df0f0674 316AS = @AS@
df0f0674
NN
317AR = @AR@
318AR_FLAGS = rc
df0f0674 319CC = @CC@
df0f0674 320CXX = @CXX@
df0f0674 321DLLTOOL = @DLLTOOL@
df0f0674 322LD = @LD@
2abefe3d
PB
323LIPO = @LIPO@
324NM = @NM@
2d309510 325OBJDUMP = @OBJDUMP@
df0f0674 326RANLIB = @RANLIB@
2abefe3d 327STRIP = @STRIP@
df0f0674 328WINDRES = @WINDRES@
901119ae 329WINDMC = @WINDMC@
95ddd785 330
5305be7e
RG
331GNATBIND = @GNATBIND@
332GNATMAKE = @GNATMAKE@
333
2abefe3d 334CFLAGS = @CFLAGS@
f6671c93 335LDFLAGS = @LDFLAGS@
2abefe3d
PB
336LIBCFLAGS = $(CFLAGS)
337CXXFLAGS = @CXXFLAGS@
338LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
df0f0674 339
8efea775
PB
340# Only build the C compiler for stage1, because that is the only one that
341# we can guarantee will build with the native compiler, and also it is the
342# only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS),
343# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them
344# overrideable (for a bootstrap build stage1 also builds gcc.info).
345
8efea775
PB
346STAGE1_CHECKING=@stage1_checking@
347STAGE1_LANGUAGES=@stage1_languages@
348
1c8bd6a3 349STAGE1_CFLAGS=@stage1_cflags@
bb286d71
AO
350STAGE2_CFLAGS=$(BOOT_CFLAGS)
351STAGE3_CFLAGS=$(BOOT_CFLAGS)
352STAGE4_CFLAGS=$(BOOT_CFLAGS)
353
1c8bd6a3
PB
354STAGE1_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
355STAGE2_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
356STAGE3_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
357STAGE4_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
358
bb286d71
AO
359do-compare = @do_compare@
360do-compare3 = $(do-compare)
361do-compare-debug = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2
362
df0f0674
NN
363# -----------------------------------------------
364# Programs producing files for the TARGET machine
365# -----------------------------------------------
95ddd785 366
ec0461f6 367FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
95ddd785 368
df0f0674 369AR_FOR_TARGET=@AR_FOR_TARGET@
4977bab6 370AS_FOR_TARGET=@AS_FOR_TARGET@
4de997d1 371CC_FOR_TARGET=$(STAGE_CC_WRAPPER) @CC_FOR_TARGET@ $(FLAGS_FOR_TARGET)
4de997d1 372
df0f0674
NN
373# If GCC_FOR_TARGET is not overriden on the command line, then this
374# variable is passed down to the gcc Makefile, where it is used to
375# build libgcc2.a. We define it here so that it can itself be
376# overridden on the command line.
2abefe3d 377GCC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCC_FOR_TARGET@ $(FLAGS_FOR_TARGET)
4de997d1 378CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @CXX_FOR_TARGET@ $(FLAGS_FOR_TARGET)
4de997d1 379RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@ $(FLAGS_FOR_TARGET)
4de997d1 380GCJ_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCJ_FOR_TARGET@ $(FLAGS_FOR_TARGET)
4de997d1 381GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@ $(FLAGS_FOR_TARGET)
4977bab6 382DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
df0f0674 383LD_FOR_TARGET=@LD_FOR_TARGET@
df0f0674 384
040b1c5a 385LIPO_FOR_TARGET=@LIPO_FOR_TARGET@
df0f0674 386NM_FOR_TARGET=@NM_FOR_TARGET@
d739199a 387OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@
4977bab6 388RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
040b1c5a 389STRIP_FOR_TARGET=@STRIP_FOR_TARGET@
df0f0674 390WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@
901119ae 391WINDMC_FOR_TARGET=@WINDMC_FOR_TARGET@
95ddd785 392
2abefe3d
PB
393COMPILER_AS_FOR_TARGET=@COMPILER_AS_FOR_TARGET@
394COMPILER_LD_FOR_TARGET=@COMPILER_LD_FOR_TARGET@
395COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_TARGET@
396
1c8bd6a3
PB
397CFLAGS_FOR_TARGET = @CFLAGS_FOR_TARGET@
398CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@
2abefe3d 399SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
c8aea42c 400DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@
1c8bd6a3 401
2abefe3d
PB
402LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
403LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
404LDFLAGS_FOR_TARGET =
df0f0674
NN
405
406# ------------------------------------
407# Miscellaneous targets and flag lists
408# ------------------------------------
409
95ddd785
NN
410# The first rule in the file had better be this one. Don't put any above it.
411# This lives here to allow makefile fragments to contain dependencies.
1061f99e 412all:
95ddd785 413
95ddd785 414#### host and target specific makefile fragments come in here.
671aa708
NN
415@target_makefile_frag@
416@alphaieee_frag@
417@ospace_frag@
418@host_makefile_frag@
95ddd785
NN
419###
420
0bff65e7
PB
421# This is the list of directories that may be needed in RPATH_ENVVAR
422# so that prorgams built for the target machine work.
423TARGET_LIB_PATH = [+ FOR target_modules +][+
424 IF lib_path +]$(TARGET_LIB_PATH_[+module+])[+ ENDIF lib_path +][+
425 ENDFOR target_modules +]$(HOST_LIB_PATH_gcc)
426[+ FOR target_modules +][+ IF lib_path +]
427@if target-[+module+]
428TARGET_LIB_PATH_[+module+] = $$r/$(TARGET_SUBDIR)/[+module+]/[+lib_path+]:
429@endif target-[+module+]
430[+ ENDIF lib_path +][+ ENDFOR target_modules +]
431
432
433# This is the list of directories that may be needed in RPATH_ENVVAR
434# so that programs built for the host machine work.
435HOST_LIB_PATH = [+ FOR host_modules +][+
436 IF lib_path +]$(HOST_LIB_PATH_[+module+])[+ ENDIF lib_path +][+
437 ENDFOR host_modules +]
438
439# Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch
440@if gcc
441HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc:$$r/$(HOST_SUBDIR)/prev-gcc:
442@endif gcc
443
444[+ FOR host_modules +][+ IF lib_path +]
445@if [+module+]
446HOST_LIB_PATH_[+module+] = \
447 $$r/$(HOST_SUBDIR)/[+module+]/[+lib_path+]:[+ IF bootstrap
448 +]$$r/$(HOST_SUBDIR)/prev-[+module+]/[+lib_path+]:[+ ENDIF bootstrap +]
449@endif [+module+]
450[+ ENDIF lib_path +][+ ENDFOR host_modules +]
451
95ddd785 452# Flags to pass down to all sub-makes.
cc11cc9b
PB
453BASE_FLAGS_TO_PASS =[+ FOR flags_to_pass +][+ IF optional +] \
454 "`echo '[+flag+]=$([+flag+])' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"[+ ELSE optional +] \
455 "[+flag+]=$([+flag+])"[+ ENDIF optional+][+ ENDFOR flags_to_pass +] \
e75f9147 456 "CONFIG_SHELL=$(SHELL)" \
11405c93 457 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)"
95ddd785 458
4de997d1
PB
459# We leave this in just in case, but it is not needed anymore.
460RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS)
ad6717df 461
95ddd785
NN
462# Flags to pass down to most sub-makes, in which we're building with
463# the host environment.
95ddd785
NN
464EXTRA_HOST_FLAGS = \
465 'AR=$(AR)' \
466 'AS=$(AS)' \
467 'CC=$(CC)' \
468 'CXX=$(CXX)' \
469 'DLLTOOL=$(DLLTOOL)' \
470 'LD=$(LD)' \
2abefe3d 471 'LIPO=$(LIPO)' \
95ddd785 472 'NM=$(NM)' \
2d309510 473 'OBJDUMP=$(OBJDUMP)' \
c858bf1e 474 'RANLIB=$(RANLIB)' \
2abefe3d 475 'STRIP=$(STRIP)' \
901119ae
KT
476 'WINDRES=$(WINDRES)' \
477 'WINDMC=$(WINDMC)'
95ddd785
NN
478
479FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
480
481# Flags that are concerned with the location of the X11 include files
482# and library files
483#
484# NOTE: until the top-level is getting the values via autoconf, it only
485# causes problems to have this top-level Makefile overriding the autoconf-set
486# values in child directories. Only variables that don't conflict with
487# autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
488#
489X11_FLAGS_TO_PASS = \
490 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
491 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
492
8efea775
PB
493# Flags to pass to stage2 and later makes.
494
495POSTSTAGE1_FLAGS_TO_PASS = \
496 CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
5305be7e 497 GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind" \
8efea775
PB
498 LDFLAGS="$(BOOT_LDFLAGS)" \
499 "`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
500
95ddd785 501# Flags to pass down to makes which are built with the target environment.
f41d6665
DJ
502# The double $ decreases the length of the command line; those variables
503# are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. The
1c8bd6a3
PB
504# *_CFLAGS_FOR_TARGET variables are not passed down and most often empty,
505# so we expand them here.
95ddd785
NN
506EXTRA_TARGET_FLAGS = \
507 'AR=$$(AR_FOR_TARGET)' \
f41d6665 508 'AS=$(COMPILER_AS_FOR_TARGET)' \
95ddd785 509 'CC=$$(CC_FOR_TARGET)' \
1c8bd6a3 510 'CFLAGS=$$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \
95ddd785 511 'CXX=$$(CXX_FOR_TARGET)' \
1c8bd6a3 512 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \
95ddd785 513 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
f41d6665 514 'LD=$(COMPILER_LD_FOR_TARGET)' \
e3791243 515 'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \
1c8bd6a3
PB
516 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \
517 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \
f41d6665 518 'NM=$(COMPILER_NM_FOR_TARGET)' \
d739199a 519 'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \
95ddd785 520 'RANLIB=$$(RANLIB_FOR_TARGET)' \
901119ae
KT
521 'WINDRES=$$(WINDRES_FOR_TARGET)' \
522 'WINDMC=$$(WINDMC_FOR_TARGET)'
95ddd785
NN
523
524TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
525
526# Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
527# unfortunately needs the native compiler and the target ar and
528# ranlib.
529# If any variables are added here, they must be added to do-*, below.
1358ccea 530# The BUILD_* variables are a special case, which are used for the gcc
95ddd785
NN
531# cross-building scheme.
532EXTRA_GCC_FLAGS = \
95ddd785 533 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
d4cd9d81
NN
534 "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
535 "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
536 "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
537 "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
cc11cc9b 538 "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
95ddd785 539
d29b8ad8 540GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS)
95ddd785 541
8b87bb96 542.PHONY: configure-host
d32ab992 543configure-host: [+
8b87bb96
NN
544 FOR host_modules +] \
545 maybe-configure-[+module+][+
546 ENDFOR host_modules +]
547.PHONY: configure-target
548configure-target: [+
549 FOR target_modules +] \
550 maybe-configure-target-[+module+][+
551 ENDFOR target_modules +]
95ddd785 552
f516a7da
PB
553# The target built for a native non-bootstrap build.
554.PHONY: all
1061f99e
PB
555all:
556@if gcc-bootstrap
2abefe3d 557 [ -f stage_final ] || echo stage3 > stage_final
1061f99e
PB
558 @r=`${PWD_COMMAND}`; export r; \
559 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
f41d6665 560 $(MAKE) $(RECURSE_FLAGS_TO_PASS) `cat stage_final`-bubble
1061f99e 561@endif gcc-bootstrap
f41d6665 562 @: $(MAKE); $(unstage)
1061f99e
PB
563 @r=`${PWD_COMMAND}`; export r; \
564 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
565 if [ -f stage_last ]; then \
2abefe3d 566 $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target; \
1061f99e 567 else \
2abefe3d 568 $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target; \
1061f99e 569 fi
8b87bb96 570
23f6b2f9 571.PHONY: all-build
cc11cc9b
PB
572[+ FOR build_modules +]
573all-build: maybe-all-build-[+module+][+ ENDFOR build_modules +]
574
8b87bb96 575.PHONY: all-host
cc11cc9b
PB
576[+ FOR host_modules +][+ IF bootstrap +]
577@if [+module+]-no-bootstrap[+ ENDIF bootstrap +]
578all-host: maybe-all-[+module+][+ IF bootstrap +]
579@endif [+module+]-no-bootstrap[+ ENDIF bootstrap +][+ ENDFOR host_modules +]
580
8b87bb96 581.PHONY: all-target
cc11cc9b 582[+ FOR target_modules +][+ IF bootstrap +]
54fdc474 583@if target-[+module+]-no-bootstrap[+ ENDIF bootstrap +]
cc11cc9b 584all-target: maybe-all-target-[+module+][+ IF bootstrap +]
54fdc474
DJ
585@endif target-[+module+]-no-bootstrap[+
586 ENDIF bootstrap +][+ ENDFOR target_modules +]
95ddd785
NN
587
588# Do a target for all the subdirectories. A ``make do-X'' will do a
589# ``make X'' in all subdirectories (because, in general, there is a
590# dependency (below) of X upon do-X, a ``make X'' will also do this,
591# but it may do additional work as well).
4977bab6 592[+ FOR recursive_targets +]
1a1e6b96 593.PHONY: do-[+make_target+]
1061f99e 594do-[+make_target+]:
f41d6665 595 @: $(MAKE); $(unstage)
e7c84bf8
PB
596 @r=`${PWD_COMMAND}`; export r; \
597 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
598 $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+make_target+]-host \
1061f99e 599 [+make_target+]-target
1061f99e 600
1358ccea
NN
601
602.PHONY: [+make_target+]-host
cc11cc9b
PB
603[+ FOR host_modules +]
604[+make_target+]-host: maybe-[+make_target+]-[+module+][+ ENDFOR host_modules +]
1358ccea
NN
605
606.PHONY: [+make_target+]-target
cc11cc9b
PB
607[+ FOR target_modules +]
608[+make_target+]-target: maybe-[+make_target+]-target-[+module+][+ ENDFOR target_modules +]
4977bab6
ZW
609[+ ENDFOR recursive_targets +]
610
95ddd785
NN
611# Here are the targets which correspond to the do-X targets.
612
9c4d2493
BM
613.PHONY: info installcheck dvi pdf html
614.PHONY: install-info install-pdf install-html
95ddd785
NN
615.PHONY: clean distclean mostlyclean maintainer-clean realclean
616.PHONY: local-clean local-distclean local-maintainer-clean
617info: do-info
618installcheck: do-installcheck
619dvi: do-dvi
b5422ad7 620pdf: do-pdf
f87a2b2e 621html: do-html
95ddd785 622
212f6dd0
NN
623# Make sure makeinfo is built before we do a `make info', if we're
624# in fact building texinfo.
625do-info: maybe-all-texinfo
95ddd785
NN
626
627install-info: do-install-info dir.info
8c90b13a 628 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
95ddd785 629 if [ -f dir.info ] ; then \
3fbe8e4a 630 $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \
95ddd785
NN
631 else true ; fi
632
9c4d2493
BM
633install-pdf: do-install-pdf
634
65d6e994
CD
635install-html: do-install-html
636
95ddd785
NN
637local-clean:
638 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
639
640local-distclean:
641 -rm -f Makefile config.status config.cache mh-frag mt-frag
f41d6665 642 -rm -f maybedep.tmp serdep.tmp
95ddd785
NN
643 -if [ "$(TARGET_SUBDIR)" != "." ]; then \
644 rm -rf $(TARGET_SUBDIR); \
645 else true; fi
0c227849 646 -rm -rf $(BUILD_SUBDIR)
215c351a
PB
647 -if [ "$(HOST_SUBDIR)" != "." ]; then \
648 rm -rf $(HOST_SUBDIR); \
649 else true; fi
95ddd785
NN
650 -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
651 -rm -f texinfo/doc/Makefile texinfo/po/POTFILES
652 -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
653 -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null
654 -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null
655
656local-maintainer-clean:
657 @echo "This command is intended for maintainers to use;"
658 @echo "it deletes files that may require special tools to rebuild."
659
660clean: do-clean local-clean
661mostlyclean: do-mostlyclean local-clean
662distclean: do-distclean local-clean local-distclean
663maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
664maintainer-clean: local-distclean
665realclean: maintainer-clean
666
95ddd785
NN
667# Check target.
668
669.PHONY: check do-check
333a28b4 670check: do-check
95ddd785 671
4977bab6 672# Only include modules actually being configured and built.
1061f99e
PB
673.PHONY: check-host
674check-host: [+
7e2dbcef
NN
675 FOR host_modules +] \
676 maybe-check-[+module+][+
1061f99e
PB
677 ENDFOR host_modules +]
678
679.PHONY: check-target
680check-target: [+
7e2dbcef
NN
681 FOR target_modules +] \
682 maybe-check-target-[+module+][+
1061f99e
PB
683 ENDFOR target_modules +]
684
685do-check:
f41d6665 686 @: $(MAKE); $(unstage)
e7c84bf8
PB
687 @r=`${PWD_COMMAND}`; export r; \
688 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
689 $(MAKE) $(RECURSE_FLAGS_TO_PASS) check-host check-target
95ddd785
NN
690
691# Automated reporting of test results.
692
693warning.log: build.log
694 $(srcdir)/contrib/warn_summary build.log > $@
695
696mail-report.log:
697 if test x'$(BOOT_CFLAGS)' != x''; then \
698 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
699 fi; \
700 $(srcdir)/contrib/test_summary -t >$@
701 chmod +x $@
702 echo If you really want to send e-mail, run ./$@ now
703
704mail-report-with-warnings.log: warning.log
705 if test x'$(BOOT_CFLAGS)' != x''; then \
706 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
707 fi; \
708 $(srcdir)/contrib/test_summary -t -i warning.log >$@
709 chmod +x $@
710 echo If you really want to send e-mail, run ./$@ now
711
712# Installation targets.
713
4977bab6 714.PHONY: install uninstall
1061f99e 715install:
f41d6665 716 @: $(MAKE); $(unstage)
e7c84bf8
PB
717 @r=`${PWD_COMMAND}`; export r; \
718 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
719 $(MAKE) $(RECURSE_FLAGS_TO_PASS) installdirs install-host install-target
8b87bb96 720
7e2dbcef
NN
721.PHONY: install-host-nogcc
722install-host-nogcc: [+
3589b69e
PB
723 FOR host_modules +][+ IF (not (= (get "module") "gcc")) +] \
724 maybe-install-[+module+][+ ENDIF +][+
7e2dbcef
NN
725 ENDFOR host_modules +]
726
8b87bb96 727.PHONY: install-host
d32ab992 728install-host: [+
8b87bb96
NN
729 FOR host_modules +] \
730 maybe-install-[+module+][+
731 ENDFOR host_modules +]
7e2dbcef 732
8b87bb96
NN
733.PHONY: install-target
734install-target: [+
735 FOR target_modules +] \
736 maybe-install-target-[+module+][+
737 ENDFOR target_modules +]
95ddd785
NN
738
739uninstall:
740 @echo "the uninstall target is not supported in this tree"
741
95ddd785
NN
742.PHONY: install.all
743install.all: install-no-fixedincludes
744 @if [ -f ./gcc/Makefile ] ; then \
8c90b13a 745 r=`${PWD_COMMAND}` ; export r ; \
f41d6665 746 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
a52a0a7f 747 $(HOST_EXPORTS) \
88b5521b 748 (cd ./gcc && \
95ddd785
NN
749 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
750 else \
751 true ; \
752 fi
753
754# install-no-fixedincludes is used because Cygnus can not distribute
755# the fixed header files.
756.PHONY: install-no-fixedincludes
7e2dbcef 757install-no-fixedincludes: installdirs install-host-nogcc \
8b87bb96 758 install-target gcc-no-fixedincludes
95ddd785 759
4977bab6 760### other supporting targets
95ddd785 761
4977bab6
ZW
762MAKEDIRS= \
763 $(DESTDIR)$(prefix) \
764 $(DESTDIR)$(exec_prefix)
765.PHONY: installdirs
766installdirs: mkinstalldirs
767 $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
768
769dir.info: do-install-info
770 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
3fbe8e4a 771 $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
4977bab6
ZW
772 mv -f dir.info.new dir.info ; \
773 else true ; \
95ddd785
NN
774 fi
775
4977bab6
ZW
776dist:
777 @echo "Building a full distribution of this tree isn't done"
778 @echo "via 'make dist'. Check out the etc/ subdirectory"
779
780etags tags: TAGS
781
782# Right now this just builds TAGS in each subdirectory. emacs19 has the
783# ability to use several tags files at once, so there is probably no need
784# to combine them into one big TAGS file (like CVS 1.3 does). We could
785# (if we felt like it) have this Makefile write a piece of elisp which
786# the user could load to tell emacs19 where all the TAGS files we just
787# built are.
788TAGS: do-TAGS
789
25b42232
PB
790# ------------------------------------
791# Macros for configure and all targets
792# ------------------------------------
793
794[+ DEFINE configure +]
795.PHONY: configure-[+prefix+][+module+] maybe-configure-[+prefix+][+module+]
796maybe-configure-[+prefix+][+module+]:
3ff3adad
PB
797@if gcc-bootstrap
798configure-[+prefix+][+module+]: stage_current
799@endif gcc-bootstrap
25b42232
PB
800@if [+prefix+][+module+]
801maybe-configure-[+prefix+][+module+]: configure-[+prefix+][+module+]
3ff3adad 802configure-[+prefix+][+module+]: [+ IF bootstrap +][+ ELSE +]
cc11cc9b
PB
803 @: $(MAKE); $(unstage)[+ ENDIF bootstrap +]
804 @r=`${PWD_COMMAND}`; export r; \
f41d6665 805 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
cc11cc9b
PB
806 [+ IF check_multilibs
807 +]echo "Checking multilib configuration for [+module+]..."; \
f41d6665
DJ
808 $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \
809 $(CC_FOR_TARGET) --print-multi-lib > [+subdir+]/[+module+]/multilib.tmp 2> /dev/null ; \
810 if test -r [+subdir+]/[+module+]/multilib.out; then \
811 if cmp -s [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; then \
812 rm -f [+subdir+]/[+module+]/multilib.tmp; \
813 else \
814 rm -f [+subdir+]/[+module+]/Makefile; \
815 mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
816 fi; \
817 else \
818 mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
cc11cc9b
PB
819 fi; \
820 [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \
25b42232 821 $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \
25b42232
PB
822 [+exports+] \
823 echo Configuring in [+subdir+]/[+module+]; \
824 cd "[+subdir+]/[+module+]" || exit 1; \
3aa83176 825 case $(srcdir) in \
215c351a 826 /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
25b42232 827 *) topdir=`echo [+subdir+]/[+module+]/ | \
215c351a 828 sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
3aa83176 829 esac; \
215c351a
PB
830 srcdiroption="--srcdir=$${topdir}/[+module+]"; \
831 libsrcdir="$$s/[+module+]"; \
25b42232
PB
832 [+ IF no-config-site +]rm -f no-such-file || : ; \
833 CONFIG_SITE=no-such-file [+ ENDIF +]$(SHELL) $${libsrcdir}/configure \
e69bf64b
PB
834 [+args+] --build=${build_alias} --host=[+host_alias+] \
835 --target=[+target_alias+] $${srcdiroption} [+extra_configure_flags+] \
3aa83176 836 || exit 1
25b42232 837@endif [+prefix+][+module+]
ce406537
PB
838
839[+ IF bootstrap +]
840[+ FOR bootstrap_stage +]
841.PHONY: configure-stage[+id+]-[+prefix+][+module+] maybe-configure-stage[+id+]-[+prefix+][+module+]
842maybe-configure-stage[+id+]-[+prefix+][+module+]:
f41d6665 843@if [+prefix+][+module+]-bootstrap
ce406537 844maybe-configure-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
f41d6665 845configure-stage[+id+]-[+prefix+][+module+]:
cc11cc9b 846 @[ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start
f41d6665 847 @$(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]
cc11cc9b 848 @r=`${PWD_COMMAND}`; export r; \
ce406537 849 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
cc11cc9b
PB
850 [+ IF check_multilibs
851 +]echo "Checking multilib configuration for [+module+]..."; \
f41d6665
DJ
852 $(CC_FOR_TARGET) --print-multi-lib > [+subdir+]/[+module+]/multilib.tmp 2> /dev/null ; \
853 if test -r [+subdir+]/[+module+]/multilib.out; then \
854 if cmp -s [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; then \
855 rm -f [+subdir+]/[+module+]/multilib.tmp; \
856 else \
857 rm -f [+subdir+]/[+module+]/Makefile; \
858 mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
859 fi; \
860 else \
861 mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
cc11cc9b
PB
862 fi; \
863 [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \
ce406537 864 [+exports+][+ IF prev +] \
1c8bd6a3
PB
865 [+poststage1_exports+][+ ENDIF prev +] [+ IF prefix +] \
866 CFLAGS="[+stage_libcflags+] $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \
867 CXXFLAGS="[+stage_libcflags+] $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; [+ ELSE +] \
342b9200 868 CFLAGS="[+stage_cflags+]"; export CFLAGS; \
1c8bd6a3 869 CXXFLAGS="[+stage_cflags+]"; export CXXFLAGS; [+ ENDIF +] \
ce406537 870 echo Configuring stage [+id+] in [+subdir+]/[+module+] ; \
f41d6665 871 $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \
ce406537
PB
872 cd [+subdir+]/[+module+] || exit 1; \
873 case $(srcdir) in \
874 /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
875 *) topdir=`echo [+subdir+]/[+module+]/ | \
876 sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
877 esac; \
878 srcdiroption="--srcdir=$${topdir}/[+module+]"; \
879 libsrcdir="$$s/[+module+]"; \
880 $(SHELL) $${libsrcdir}/configure \
e69bf64b
PB
881 [+args+] --build=${build_alias} --host=[+host_alias+] \
882 --target=[+target_alias+] $${srcdiroption} \
57255173 883 [+ IF prev +]--with-build-libsubdir=$(HOST_SUBDIR)[+ ENDIF prev +] \
ce406537 884 [+stage_configure_flags+] [+extra_configure_flags+]
f41d6665 885@endif [+prefix+][+module+]-bootstrap
ce406537
PB
886[+ ENDFOR bootstrap_stage +]
887[+ ENDIF bootstrap +]
25b42232
PB
888[+ ENDDEF +]
889
890[+ DEFINE all +]
891.PHONY: all-[+prefix+][+module+] maybe-all-[+prefix+][+module+]
892maybe-all-[+prefix+][+module+]:
3ff3adad
PB
893@if gcc-bootstrap
894all-[+prefix+][+module+]: stage_current
895@endif gcc-bootstrap
25b42232
PB
896@if [+prefix+][+module+]
897TARGET-[+prefix+][+module+]=[+
e69bf64b 898 IF all_target +][+all_target+][+ ELSE +]all[+ ENDIF all_target +]
25b42232 899maybe-all-[+prefix+][+module+]: all-[+prefix+][+module+]
3ff3adad 900all-[+prefix+][+module+]: configure-[+prefix+][+module+][+ IF bootstrap +][+ ELSE +]
cc11cc9b
PB
901 @: $(MAKE); $(unstage)[+ ENDIF bootstrap +]
902 @r=`${PWD_COMMAND}`; export r; \
8c90b13a 903 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
25b42232
PB
904 [+exports+] \
905 (cd [+subdir+]/[+module+] && \
1c8bd6a3
PB
906 $(MAKE) $(BASE_FLAGS_TO_PASS) [+args+] [+extra_make_flags+] \
907 $(TARGET-[+prefix+][+module+]))
25b42232 908@endif [+prefix+][+module+]
ce406537
PB
909
910[+ IF bootstrap +]
911[+ FOR bootstrap_stage +]
912.PHONY: all-stage[+id+]-[+prefix+][+module+] maybe-all-stage[+id+]-[+prefix+][+module+]
913.PHONY: clean-stage[+id+]-[+prefix+][+module+] maybe-clean-stage[+id+]-[+prefix+][+module+]
914maybe-all-stage[+id+]-[+prefix+][+module+]:
915maybe-clean-stage[+id+]-[+prefix+][+module+]:
f41d6665 916@if [+prefix+][+module+]-bootstrap
ce406537
PB
917maybe-all-stage[+id+]-[+prefix+][+module+]: all-stage[+id+]-[+prefix+][+module+]
918all-stage[+id+]: all-stage[+id+]-[+prefix+][+module+]
1061f99e 919TARGET-stage[+id+]-[+prefix+][+module+] = $(TARGET-[+prefix+][+module+])
ce406537 920all-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
cc11cc9b 921 @[ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start
ce406537
PB
922 @r=`${PWD_COMMAND}`; export r; \
923 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
924 [+exports+][+ IF prev +] \
925 [+poststage1_exports+][+ ENDIF prev +] \
926 cd [+subdir+]/[+module+] && \
1c8bd6a3
PB
927 $(MAKE) $(BASE_FLAGS_TO_PASS) \
928 CFLAGS="[+stage_cflags+]" CXXFLAGS="[+stage_cflags+]" \
929 LIBCFLAGS="[+stage_libcflags+]" \
930 CFLAGS_FOR_TARGET="[+stage_libcflags+]" \
931 CXXFLAGS_FOR_TARGET="[+stage_libcflags+]" [+args+] [+
342b9200
PB
932 IF prev +][+poststage1_args+][+ ENDIF prev
933 +] [+extra_make_flags+] \
1061f99e 934 $(TARGET-stage[+id+]-[+prefix+][+module+])
ce406537
PB
935
936maybe-clean-stage[+id+]-[+prefix+][+module+]: clean-stage[+id+]-[+prefix+][+module+]
937clean-stage[+id+]: clean-stage[+id+]-[+prefix+][+module+]
938clean-stage[+id+]-[+prefix+][+module+]:
995a5697
PB
939 @if [ $(current_stage) = stage[+id+] ]; then \
940 [ -f [+subdir+]/[+module+]/Makefile ] || exit 0; \
941 else \
942 [ -f [+subdir+]/stage[+id+]-[+module+]/Makefile ] || exit 0; \
943 $(MAKE) stage[+id+]-start; \
944 fi; \
ce406537
PB
945 cd [+subdir+]/[+module+] && \
946 $(MAKE) [+args+] [+ IF prev +] \
947 [+poststage1_args+] [+ ENDIF prev +] \
342b9200 948 [+extra_make_flags+] clean
f41d6665 949@endif [+prefix+][+module+]-bootstrap
ce406537
PB
950
951[+ ENDFOR bootstrap_stage +]
952[+ ENDIF bootstrap +]
25b42232
PB
953[+ ENDDEF +]
954
955# --------------------------------------
956# Modules which run on the build machine
957# --------------------------------------
958[+ FOR build_modules +]
959[+ configure prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)"
e69bf64b
PB
960 host_alias=(get "host" "${build_alias}")
961 target_alias=(get "target" "${target_alias}")
25b42232
PB
962 args="$(BUILD_CONFIGARGS)" no-config-site=true +]
963
f8c33439
JM
964[+ all prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)"
965 args="$(EXTRA_BUILD_FLAGS)" +]
25b42232 966[+ ENDFOR build_module +]
4977bab6
ZW
967
968# --------------------------------------
969# Modules which run on the host machine
970# --------------------------------------
971[+ FOR host_modules +]
ce406537
PB
972[+ configure prefix="" subdir="$(HOST_SUBDIR)"
973 exports="$(HOST_EXPORTS)"
974 poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)"
e69bf64b
PB
975 host_alias=(get "host" "${host_alias}")
976 target_alias=(get "target" "${target_alias}")
25b42232 977 args="$(HOST_CONFIGARGS)" +]
95ddd785 978
ce406537
PB
979[+ all prefix="" subdir="$(HOST_SUBDIR)"
980 exports="$(HOST_EXPORTS)"
981 poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)"
1c8bd6a3 982 args="$(EXTRA_HOST_FLAGS)"
ce406537 983 poststage1_args="$(POSTSTAGE1_FLAGS_TO_PASS)" +]
4977bab6 984
7e2dbcef
NN
985.PHONY: check-[+module+] maybe-check-[+module+]
986maybe-check-[+module+]:
60975492
PB
987@if [+module+]
988maybe-check-[+module+]: check-[+module+]
4977bab6 989[+ IF no_check +]
4977bab6
ZW
990check-[+module+]:
991[+ ELIF no_check_cross +]
4977bab6
ZW
992# This module is only tested in a native toolchain.
993check-[+module+]:
f41d6665 994 @: $(MAKE); $(unstage)
e89fbdfe 995 @if [ '$(host)' = '$(target)' ] ; then \
8c90b13a
L
996 r=`${PWD_COMMAND}`; export r; \
997 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
4fc4dd12 998 $(HOST_EXPORTS) \
215c351a 999 (cd $(HOST_SUBDIR)/[+module+] && \
ef6e9bc0 1000 $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] check); \
3aa83176
NN
1001 fi
1002[+ ELSE check +]
3aa83176 1003check-[+module+]:
f41d6665 1004 @: $(MAKE); $(unstage)
8c90b13a
L
1005 @r=`${PWD_COMMAND}`; export r; \
1006 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
4fc4dd12 1007 $(HOST_EXPORTS) \
215c351a
PB
1008 (cd $(HOST_SUBDIR)/[+module+] && \
1009 $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] check)
4977bab6 1010[+ ENDIF no_check +]
60975492 1011@endif [+module+]
4977bab6 1012
4977bab6
ZW
1013.PHONY: install-[+module+] maybe-install-[+module+]
1014maybe-install-[+module+]:
60975492
PB
1015@if [+module+]
1016maybe-install-[+module+]: install-[+module+]
7e2dbcef 1017[+ IF no_install +]
4977bab6
ZW
1018install-[+module+]:
1019[+ ELSE install +]
4977bab6 1020install-[+module+]: installdirs
f41d6665 1021 @: $(MAKE); $(unstage)
8c90b13a
L
1022 @r=`${PWD_COMMAND}`; export r; \
1023 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
4fc4dd12 1024 $(HOST_EXPORTS) \
215c351a 1025 (cd $(HOST_SUBDIR)/[+module+] && \
ace9ac7b 1026 $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] install)
4977bab6 1027[+ ENDIF no_install +]
60975492 1028@endif [+module+]
295f4e42 1029
b5422ad7 1030# Other targets (info, dvi, pdf, etc.)
295f4e42
NN
1031[+ FOR recursive_targets +]
1032.PHONY: maybe-[+make_target+]-[+module+] [+make_target+]-[+module+]
1033maybe-[+make_target+]-[+module+]:
60975492
PB
1034@if [+module+]
1035maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+]
295f4e42
NN
1036[+ IF (match-value? = "missing" (get "make_target") ) +]
1037# [+module+] doesn't support [+make_target+].
1038[+make_target+]-[+module+]:
1039[+ ELSE +]
1040[+make_target+]-[+module+]: [+
1041 FOR depend +]\
1042 [+depend+]-[+module+] [+
1043 ENDFOR depend +]
f41d6665 1044 @[+ IF bootstrap +][+ ELSE +]: $(MAKE); $(unstage)
1061f99e 1045 @[+ ENDIF bootstrap +][ -f ./[+module+]/Makefile ] || exit 0; \
295f4e42
NN
1046 r=`${PWD_COMMAND}`; export r; \
1047 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
4fc4dd12 1048 $(HOST_EXPORTS) \
d32ab992 1049 for flag in $(EXTRA_HOST_FLAGS) [+extra_make_flags+]; do \
295f4e42
NN
1050 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
1051 done; \
1052 echo "Doing [+make_target+] in [+module+]" ; \
215c351a 1053 (cd $(HOST_SUBDIR)/[+module+] && \
295f4e42
NN
1054 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
1055 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
1056 "RANLIB=$${RANLIB}" \
901119ae 1057 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
d32ab992 1058 [+make_target+]) \
295f4e42
NN
1059 || exit 1
1060[+ ENDIF +]
60975492 1061@endif [+module+]
295f4e42 1062[+ ENDFOR recursive_targets +]
4977bab6
ZW
1063[+ ENDFOR host_modules +]
1064
1065# ---------------------------------------
1066# Modules which run on the target machine
1067# ---------------------------------------
1068[+ FOR target_modules +]
4977bab6 1069
25b42232
PB
1070[+ IF raw_cxx +]
1071[+ configure prefix="target-" subdir="$(TARGET_SUBDIR)"
f41d6665 1072 check_multilibs=true
25b42232 1073 exports="$(RAW_CXX_TARGET_EXPORTS)"
e69bf64b
PB
1074 host_alias=(get "host" "${target_alias}")
1075 target_alias=(get "target" "${target_alias}")
25b42232
PB
1076 args="$(TARGET_CONFIGARGS)" no-config-site=true +]
1077
1078[+ all prefix="target-" subdir="$(TARGET_SUBDIR)"
1079 exports="$(RAW_CXX_TARGET_EXPORTS)"
1c8bd6a3 1080 args="$(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'" +]
25b42232
PB
1081[+ ELSE +]
1082[+ configure prefix="target-" subdir="$(TARGET_SUBDIR)"
f41d6665 1083 check_multilibs=true
25b42232 1084 exports="$(NORMAL_TARGET_EXPORTS)"
e69bf64b
PB
1085 host_alias=(get "host" "${target_alias}")
1086 target_alias=(get "target" "${target_alias}")
25b42232
PB
1087 args="$(TARGET_CONFIGARGS)" no-config-site=true +]
1088
1089[+ all prefix="target-" subdir="$(TARGET_SUBDIR)"
1090 exports="$(NORMAL_TARGET_EXPORTS)"
1c8bd6a3 1091 args="$(EXTRA_TARGET_FLAGS)" +]
25b42232 1092[+ ENDIF +]
7e2dbcef
NN
1093
1094.PHONY: check-target-[+module+] maybe-check-target-[+module+]
1095maybe-check-target-[+module+]:
60975492
PB
1096@if target-[+module+]
1097maybe-check-target-[+module+]: check-target-[+module+]
4977bab6
ZW
1098[+ IF no_check +]
1099# Dummy target for uncheckable module.
4977bab6
ZW
1100check-target-[+module+]:
1101[+ ELSE check +]
4977bab6 1102check-target-[+module+]:
f41d6665 1103 @: $(MAKE); $(unstage)
8c90b13a 1104 @r=`${PWD_COMMAND}`; export r; \
0bff65e7 1105 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
4fc4dd12
DJ
1106IF raw_cxx +]
1107 $(RAW_CXX_TARGET_EXPORTS) \[+
1108ELSE normal_cxx +]
1109 $(NORMAL_TARGET_EXPORTS) \[+
1110ENDIF raw_cxx +]
3aa83176
NN
1111 (cd $(TARGET_SUBDIR)/[+module+] && \
1112 $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
1113 IF raw_cxx
1114 +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+
1115 ENDIF raw_cxx
a52a0a7f 1116 +] [+extra_make_flags+] check)
4977bab6 1117[+ ENDIF no_check +]
60975492 1118@endif target-[+module+]
7e2dbcef 1119
4977bab6
ZW
1120.PHONY: install-target-[+module+] maybe-install-target-[+module+]
1121maybe-install-target-[+module+]:
60975492
PB
1122@if target-[+module+]
1123maybe-install-target-[+module+]: install-target-[+module+]
7e2dbcef 1124[+ IF no_install +]
4977bab6
ZW
1125# Dummy target for uninstallable.
1126install-target-[+module+]:
1127[+ ELSE install +]
4977bab6 1128install-target-[+module+]: installdirs
f41d6665 1129 @: $(MAKE); $(unstage)
8c90b13a 1130 @r=`${PWD_COMMAND}`; export r; \
0bff65e7 1131 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
4fc4dd12
DJ
1132IF raw_cxx +]
1133 $(RAW_CXX_TARGET_EXPORTS) \[+
1134ELSE normal_cxx +]
1135 $(NORMAL_TARGET_EXPORTS) \[+
1136ENDIF raw_cxx +]
3aa83176 1137 (cd $(TARGET_SUBDIR)/[+module+] && \
a52a0a7f 1138 $(MAKE) $(TARGET_FLAGS_TO_PASS) [+extra_make_flags+] install)
4977bab6 1139[+ ENDIF no_install +]
60975492 1140@endif target-[+module+]
295f4e42 1141
b5422ad7 1142# Other targets (info, dvi, pdf, etc.)
295f4e42
NN
1143[+ FOR recursive_targets +]
1144.PHONY: maybe-[+make_target+]-target-[+module+] [+make_target+]-target-[+module+]
1145maybe-[+make_target+]-target-[+module+]:
60975492
PB
1146@if target-[+module+]
1147maybe-[+make_target+]-target-[+module+]: [+make_target+]-target-[+module+]
295f4e42
NN
1148[+ IF (match-value? = "missing" (get "make_target") ) +]
1149# [+module+] doesn't support [+make_target+].
1150[+make_target+]-target-[+module+]:
1151[+ ELSE +]
1152[+make_target+]-target-[+module+]: [+
1153 FOR depend +]\
1154 [+depend+]-target-[+module+] [+
1155 ENDFOR depend +]
f41d6665 1156 @: $(MAKE); $(unstage)
295f4e42
NN
1157 @[ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] || exit 0 ; \
1158 r=`${PWD_COMMAND}`; export r; \
0bff65e7 1159 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
4fc4dd12
DJ
1160IF raw_cxx +]
1161 $(RAW_CXX_TARGET_EXPORTS) \[+
1162ELSE normal_cxx +]
1163 $(NORMAL_TARGET_EXPORTS) \[+
1164ENDIF raw_cxx +]
295f4e42
NN
1165 echo "Doing [+make_target+] in $(TARGET_SUBDIR)/[+module+]" ; \
1166 for flag in $(EXTRA_TARGET_FLAGS); do \
1167 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
1168 done; \
1169 (cd $(TARGET_SUBDIR)/[+module+] && \
1170 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
1171 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
1172 "RANLIB=$${RANLIB}" \
901119ae 1173 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
a52a0a7f 1174 [+extra_make_flags+] [+make_target+]) \
295f4e42
NN
1175 || exit 1
1176[+ ENDIF +]
60975492 1177@endif target-[+module+]
295f4e42 1178[+ ENDFOR recursive_targets +]
4977bab6 1179[+ ENDFOR target_modules +]
95ddd785 1180
4977bab6
ZW
1181# ----------
1182# GCC module
1183# ----------
95ddd785 1184
f516a7da 1185@if gcc-no-bootstrap
95ddd785 1186.PHONY: cross
7c27e184 1187cross: all-build all-gas all-ld
8c90b13a
L
1188 @r=`${PWD_COMMAND}`; export r; \
1189 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
a52a0a7f 1190 $(HOST_EXPORTS) \
95ddd785
NN
1191 echo "Building the C and C++ compiler"; \
1192 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
8c90b13a
L
1193 @r=`${PWD_COMMAND}`; export r; \
1194 s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
95ddd785 1195 echo "Building runtime libraries"; \
ad6717df 1196 $(MAKE) $(RECURSE_FLAGS_TO_PASS) LANGUAGES="c c++" all
f516a7da 1197@endif gcc-no-bootstrap
95ddd785 1198
60975492 1199@if gcc
6248218a
JM
1200.PHONY: check-gcc-c++
1201check-gcc-c++:
95ddd785 1202 @if [ -f ./gcc/Makefile ] ; then \
8c90b13a
L
1203 r=`${PWD_COMMAND}`; export r; \
1204 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
a52a0a7f 1205 $(HOST_EXPORTS) \
88b5521b 1206 (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
95ddd785
NN
1207 else \
1208 true; \
6248218a
JM
1209 fi
1210
1211.PHONY: check-c++
333a28b4 1212check-c++: check-target-libstdc++-v3 check-gcc-c++
95ddd785 1213
4977bab6
ZW
1214# Install the gcc headers files, but not the fixed include files,
1215# which Cygnus is not allowed to distribute. This rule is very
1216# dependent on the workings of the gcc Makefile.in.
1217.PHONY: gcc-no-fixedincludes
1218gcc-no-fixedincludes:
1219 @if [ -f ./gcc/Makefile ]; then \
1220 rm -rf gcc/tmp-include; \
1221 mv gcc/include gcc/tmp-include 2>/dev/null; \
1222 mkdir gcc/include; \
1223 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
1224 touch gcc/stmp-fixinc gcc/include/fixed; \
1225 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
8c90b13a
L
1226 r=`${PWD_COMMAND}`; export r; \
1227 s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
a52a0a7f 1228 $(HOST_EXPORTS) \
88b5521b 1229 (cd ./gcc && \
4977bab6
ZW
1230 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1231 rm -rf gcc/include; \
1232 mv gcc/tmp-include gcc/include 2>/dev/null; \
1233 else true; fi
60975492 1234@endif gcc
295f4e42 1235
2805b53a
NN
1236# ---------------------
1237# GCC bootstrap support
1238# ---------------------
1239
d32ab992
PB
1240# We track the current stage (the one in 'gcc') in the stage_current file.
1241# stage_last instead tracks the stage that was built last. These targets
1242# are dummy when toplevel bootstrap is not active.
1243
1061f99e 1244# While making host and target tools, symlinks to the final stage must be
f41d6665
DJ
1245# there, so $(unstage) should be run at various points. To avoid excessive
1246# recursive invocations of make, we "inline" them using a variable. These
1247# must be referenced as ": $(MAKE) ; $(unstage)" rather than "$(unstage)"
1248# to avoid warnings from the GNU Make job server.
1061f99e
PB
1249
1250unstage = :
1251stage = :
cc11cc9b 1252current_stage = ""
1061f99e 1253
d32ab992 1254@if gcc-bootstrap
9bd6112c 1255unstage = if [ -f stage_last ]; then [ -f stage_current ] || $(MAKE) `cat stage_last`-start || exit 1; else :; fi
d19bca38 1256stage = if [ -f stage_current ]; then $(MAKE) `cat stage_current`-end || exit 1; else :; fi
cc11cc9b 1257current_stage = "`cat stage_current 2> /dev/null`"
d32ab992
PB
1258@endif gcc-bootstrap
1259
1061f99e
PB
1260.PHONY: unstage stage
1261unstage:
f41d6665 1262 @: $(MAKE); $(unstage)
d32ab992 1263stage:
f41d6665 1264 @: $(MAKE); $(stage)
d32ab992 1265
2d309510
PB
1266# Disable commands for lean bootstrap.
1267LEAN = false
1268
148907ea
PB
1269# We name the build directories for the various stages "stage1-gcc",
1270# "stage2-gcc","stage3-gcc", etc.
1271
1272# Since the 'compare' process will fail (on debugging information) if any
1273# directory names are different, we need to link the gcc directory for
f41d6665 1274# the previous stage to a constant name ('prev-gcc'), and to make the name of
148907ea
PB
1275# the build directories constant as well. For the latter, we use naked names
1276# like 'gcc', because the scripts in that directory assume it. We use
1277# mv on platforms where symlinks to directories do not work or are not
1278# reliable.
1279
2805b53a
NN
1280# 'touch' doesn't work right on some platforms.
1281STAMP = echo timestamp >
1282
148907ea
PB
1283# We only want to compare .o files, so set this!
1284objext = .o
2805b53a 1285
148907ea 1286[+ FOR bootstrap-stage +]
f516a7da 1287.PHONY: stage[+id+]-start stage[+id+]-end
148907ea 1288
ad6717df 1289stage[+id+]-start::
f41d6665 1290 @: $(MAKE); $(stage); \
d32ab992 1291 echo stage[+id+] > stage_current ; \
215c351a 1292 echo stage[+id+] > stage_last; \
f41d6665 1293 $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)[+
215c351a 1294 FOR host_modules +][+ IF bootstrap +]
7c27e184 1295@if [+ module +]
215c351a
PB
1296 @cd $(HOST_SUBDIR); [ -d stage[+id+]-[+module+] ] || \
1297 mkdir stage[+id+]-[+module+]; \
2d309510
PB
1298 mv stage[+id+]-[+module+] [+module+] [+ IF prev +] ; \
1299 mv stage[+prev+]-[+module+] prev-[+module+] || test -f stage[+prev+]-lean [+ ENDIF prev +]
f41d6665
DJ
1300@endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
1301 @[ -d stage[+id+]-$(TARGET_SUBDIR) ] || \
1302 mkdir stage[+id+]-$(TARGET_SUBDIR); \
2d309510
PB
1303 mv stage[+id+]-$(TARGET_SUBDIR) $(TARGET_SUBDIR) [+ IF prev +] ; \
1304 mv stage[+prev+]-$(TARGET_SUBDIR) prev-$(TARGET_SUBDIR) || test -f stage[+prev+]-lean [+ ENDIF prev +]
148907ea 1305
2d309510 1306stage[+id+]-end:: [+ FOR host_modules +][+ IF bootstrap +]
7c27e184 1307@if [+ module +]
2d309510
PB
1308 @if test -d $(HOST_SUBDIR)/[+module+] ; then \
1309 cd $(HOST_SUBDIR); mv [+module+] stage[+id+]-[+module+] [+ IF prev +]; \
1310 mv prev-[+module+] stage[+prev+]-[+module+] ; : [+ ENDIF prev +] ; \
f41d6665
DJ
1311 fi
1312@endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
1313 @if test -d $(TARGET_SUBDIR) ; then \
2d309510
PB
1314 mv $(TARGET_SUBDIR) stage[+id+]-$(TARGET_SUBDIR) [+ IF prev +] ; \
1315 mv prev-$(TARGET_SUBDIR) stage[+prev+]-$(TARGET_SUBDIR) ; : [+ ENDIF prev +] ; \
f41d6665 1316 fi
2d309510 1317 rm -f stage_current
148907ea 1318
8024d75e 1319# Bubble a bug fix through all the stages up to stage [+id+]. They are
f41d6665 1320# remade, but not reconfigured. The next stage (if any) will not be
cdce5c41 1321# reconfigured either.
f516a7da 1322.PHONY: stage[+id+]-bubble
2d309510 1323stage[+id+]-bubble:: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +]
e7c84bf8
PB
1324 @r=`${PWD_COMMAND}`; export r; \
1325 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1326 if test -f stage[+id+]-lean [+
ce521a9c
PB
1327 IF prev +]|| test -f stage[+prev+]-lean [+ ENDIF prev +] ; then \
1328 echo Skipping rebuild of stage[+id+] ; \
1329 else \
2d309510
PB
1330 $(MAKE) stage[+id+]-start; \[+IF lean +]
1331 if $(LEAN); then \
1332 rm -rf stage[+lean+]-* ; \
1333 $(STAMP) stage[+lean+]-lean ; \
1334 fi; \[+ ENDIF lean +]
1061f99e 1335 $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage[+id+]; \
2abefe3d 1336 fi[+ IF compare-target +]
d19bca38 1337 $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+compare-target+][+ ENDIF compare-target +]
7c27e184 1338
45f366ab 1339.PHONY: all-stage[+id+] clean-stage[+id+]
45f366ab 1340do-clean: clean-stage[+id+]
2805b53a 1341
7c27e184
PB
1342# FIXME: Will not need to be conditional when toplevel bootstrap is the
1343# only possibility, but now it conflicts with no-bootstrap rules
1344@if gcc-bootstrap
148907ea 1345[+ IF compare-target +]
ce521a9c 1346[+compare-target+]:
e7c84bf8
PB
1347 @r=`${PWD_COMMAND}`; export r; \
1348 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1349 if test -f stage[+prev+]-lean; then \
ce521a9c
PB
1350 echo Cannot compare object files as stage [+prev+] was deleted. ; \
1351 exit 0 ; \
1352 fi; \
f41d6665 1353 : $(MAKE); $(stage); \
2805b53a 1354 rm -f .bad_compare ; \
cc11cc9b 1355 echo Comparing stages [+prev+] and [+id+] ; \
148907ea 1356 cd stage[+id+]-gcc; \
2805b53a
NN
1357 files=`find . -name "*$(objext)" -print` ; \
1358 cd .. ; \
1359 for file in $${files} ; do \
148907ea 1360 f1=$$r/stage[+prev+]-gcc/$$file; f2=$$r/stage[+id+]-gcc/$$file; \
bb286d71 1361 $(do-[+compare-target+]) > /dev/null 2>&1; \
1061f99e
PB
1362 if test $$? -eq 1; then \
1363 case $$file in \
1364 ./cc*-checksum$(objext) | ./libgcc/* ) \
1365 echo warning: $$file differs ;; \
1366 *) \
1367 echo $$file differs >> .bad_compare ;; \
1368 esac ; \
1369 fi ; \
2805b53a
NN
1370 done ; \
1371 if [ -f .bad_compare ]; then \
1372 echo "Bootstrap comparison failure!"; \
1373 cat .bad_compare; \
1374 exit 1; \
1375 else \
cc11cc9b 1376 echo Comparison successful.; \
2805b53a 1377 fi ; \
ce521a9c 1378 $(STAMP) [+compare-target+][+ IF prev +]
2d309510
PB
1379 if $(LEAN); then \
1380 rm -rf stage[+prev+]-*; \
1381 $(STAMP) stage[+prev+]-lean; \
1382 fi[+ ENDIF prev +]
148907ea
PB
1383[+ ENDIF compare-target +]
1384
1385[+ IF bootstrap-target +]
2d309510 1386.PHONY: [+bootstrap-target+] [+bootstrap-target+]-lean
2abefe3d
PB
1387[+bootstrap-target+]:
1388 echo stage[+id+] > stage_final
1389 @r=`${PWD_COMMAND}`; export r; \
1390 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1391 $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage[+id+]-bubble
f41d6665 1392 @: $(MAKE); $(unstage)
2abefe3d
PB
1393 @r=`${PWD_COMMAND}`; export r; \
1394 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1395 $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
2d309510
PB
1396
1397[+bootstrap-target+]-lean:
1398 echo stage[+id+] > stage_final
1399 @r=`${PWD_COMMAND}`; export r; \
1400 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1401 $(MAKE) $(RECURSE_FLAGS_TO_PASS) LEAN=: stage[+id+]-bubble
1402 @: $(MAKE); $(unstage)
1403 @r=`${PWD_COMMAND}`; export r; \
1404 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1405 $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
148907ea
PB
1406[+ ENDIF bootstrap-target +]
1407
45f366ab 1408# Rules to wipe a stage and all the following ones, also used for cleanstrap
ad6717df 1409[+ IF prev +]distclean-stage[+prev+]:: distclean-stage[+id+] [+ ENDIF prev +]
45f366ab 1410.PHONY: distclean-stage[+id+]
ad6717df 1411distclean-stage[+id+]::
f41d6665 1412 @: $(MAKE); $(stage)
a19e8f64 1413 @test "`cat stage_last`" != stage[+id+] || rm -f stage_last
ce521a9c 1414 rm -rf stage[+id+]-* [+
148907ea 1415 IF compare-target +][+compare-target+] [+ ENDIF compare-target +]
148907ea
PB
1416
1417[+ IF cleanstrap-target +]
1418.PHONY: [+cleanstrap-target+]
a19e8f64
PB
1419[+cleanstrap-target+]: do-distclean local-clean
1420 echo stage[+id+] > stage_final
1421 @r=`${PWD_COMMAND}`; export r; \
1422 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1423 $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage[+id+]-bubble
1424 @: $(MAKE); $(unstage)
1425 @r=`${PWD_COMMAND}`; export r; \
1426 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1427 $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
148907ea 1428[+ ENDIF cleanstrap-target +]
7c27e184 1429@endif gcc-bootstrap
148907ea
PB
1430
1431[+ ENDFOR bootstrap-stage +]
ad6717df 1432
c7870f5d
PB
1433stageprofile-end::
1434 $(MAKE) distclean-stagefeedback
ad6717df 1435
c7870f5d 1436stagefeedback-start::
ad6717df
PB
1437 @r=`${PWD_COMMAND}`; export r; \
1438 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
c7870f5d
PB
1439 for i in prev-*; do \
1440 j=`echo $$i | sed s/^prev-//` ; \
1441 cd $$r/$$i && \
1442 { find . -type d | sort | sed 's,.*,$(SHELL) '"$$s"'/mkinstalldirs "../'$$j'/&",' | $(SHELL) ; } && \
1443 { find . -name '*.*da' | sed 's,.*,$(LN) -f "&" "../'$$j'/&",' | $(SHELL) ; } ; \
1444 done
03a91701 1445
45f366ab 1446@if gcc-bootstrap
45f366ab 1447do-distclean: distclean-stage1
cc11cc9b
PB
1448
1449# Provide a GCC build when we're building target libraries. This does
1450# not work as a dependency, just as the minimum necessary to avoid errors.
1451stage_last:
1452 $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage1-bubble
45f366ab 1453
3ff3adad
PB
1454# Same as unstage, but not phony and defaulting to stage1-start. We place
1455# it in the dependency so that for example `make -j3 all-gcc' works.
1456stage_current:
1457 @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi
1458
cc11cc9b 1459.PHONY: restrap
c6b196de 1460restrap::
cc11cc9b
PB
1461 @: $(MAKE); $(stage)
1462 rm -rf stage1-$(TARGET_SUBDIR) [+ FOR bootstrap-stage +][+ IF prev
e9a54b07 1463 +]stage[+id+]-* [+ ENDIF prev +][+ ENDFOR bootstrap-stage +]
c6b196de 1464restrap:: all
e9a54b07 1465@endif gcc-bootstrap
cc11cc9b 1466
4977bab6
ZW
1467# --------------------------------------
1468# Dependencies between different modules
1469# --------------------------------------
1470
3589b69e 1471# Generic dependencies for target modules on host stuff, especially gcc
cc11cc9b
PB
1472@if gcc-bootstrap[+ FOR target_modules +][+ IF bootstrap
1473 +][+ FOR bootstrap_stage +]
1474configure-stage[+id+]-target-[+module+]: maybe-all-stage[+id+]-gcc[+
1475 ENDFOR +][+ ELSE bootstrap +]
1476configure-target-[+module+]: stage_last[+
1477 ENDIF bootstrap +][+ ENDFOR target_modules +]
1478@endif gcc-bootstrap
1479
fa958513 1480@if gcc-no-bootstrap[+ FOR target_modules +]
cc11cc9b 1481configure-target-[+module+]: maybe-all-gcc[+
fa958513 1482 ENDFOR target_modules +]
cc11cc9b
PB
1483@endif gcc-no-bootstrap
1484
3589b69e 1485
4977bab6
ZW
1486# There are two types of dependencies here: 'hard' dependencies, where one
1487# module simply won't build without the other; and 'soft' dependencies, where
1488# if the depended-on module is missing, the depending module will do without
1489# or find a substitute somewhere (perhaps installed). Soft dependencies
3589b69e 1490# are made here to depend on a 'maybe-' target. If you're not sure,
4977bab6
ZW
1491# it's safer to use a soft dependency.
1492
3589b69e
PB
1493[+ ;; These Scheme functions build the bulk of the dependencies.
1494 ;; dep-target builds a string like "maybe-all-MODULE_KIND-gcc",
cdce5c41 1495 ;; where "maybe-" is only included if HARD is not true, and all-gcc
3589b69e
PB
1496 ;; is taken from VAR-NAME.
1497 (define dep-target (lambda (module-kind var-name hard)
1498 (string-append
1499 (if hard "" "maybe-")
1500 (dep-subtarget var-name)
1501 module-kind
1502 (dep-module var-name)
1503 )))
1504
1505 ;; make-dep builds a dependency from the MODULE and ON AutoGen vars.
7c27e184 1506 (define make-dep (lambda (module-kind on-kind)
3589b69e
PB
1507 (string-append
1508 (dep-target module-kind "module" #t) ": "
7c27e184 1509 (dep-target on-kind "on" (exist? "hard")))))
3589b69e
PB
1510
1511 ;; dep-subtarget extracts everything up to the first dash in the given
1512 ;; AutoGen variable, for example it extracts "all-" out of "all-gcc".
1513 (define dep-subtarget (lambda (var-name)
1514 (substring (get var-name) 0 (+ 1 (string-index (get var-name) #\-)))))
1515
1516 ;; dep-module extracts everything up to the first dash in the given
1517 ;; AutoGen variable, for example it extracts "gcc" out of "all-gcc".
1518 (define dep-module (lambda (var-name)
1519 (substring (get var-name) (+ 1 (string-index (get var-name) #\-)))))
1520
1521 ;; dep-stage builds a string for the prefix of a bootstrap stage.
1522 (define dep-stage (lambda ()
1523 (string-append
1524 "stage"
1525 (get "id")
1526 "-")))
1527
1528 ;; dep-maybe is the same as the AutoGen expression "- hard 'maybe-'"
1529 ;; but is written in Scheme.
1530 (define dep-maybe (lambda ()
1531 (if (exist? "hard") "" "maybe-")))
1532
893f1e87
MK
1533 ;; dep-kind returns "normal" if the dependency is on an "install" target,
1534 ;; or if either module is not bootstrapped. It returns "bootstrap" for
3589b69e
PB
1535 ;; configure or build dependencies between bootstrapped modules; it returns
1536 ;; "prebootstrap" for configure or build dependencies of bootstrapped
7c27e184 1537 ;; modules on a build module (e.g. all-gcc on all-build-bison). All this
3589b69e
PB
1538 ;; is only necessary for host modules.
1539 (define dep-kind (lambda ()
7c27e184
PB
1540 (if (and (hash-ref boot-modules (dep-module "module"))
1541 (=* (dep-module "on") "build-"))
1542 "prebootstrap"
3589b69e 1543
7c27e184 1544 (if (or (= (dep-subtarget "on") "install-")
893f1e87
MK
1545 (not (hash-ref boot-modules (dep-module "module")))
1546 (not (hash-ref boot-modules (dep-module "on"))))
7c27e184
PB
1547 "normal"
1548 "bootstrap"))))
3589b69e
PB
1549
1550 ;; We now build the hash table that is used by dep-kind.
1551 (define boot-modules (make-hash-table 113))
3589b69e
PB
1552+]
1553
1554[+ FOR host_modules +][+
1555 (if (exist? "bootstrap")
1556 (hash-create-handle! boot-modules (get "module") #t))
1557 "" +][+ ENDFOR host_modules +]
2dfbef6d
PB
1558[+ FOR target_modules +][+
1559 (if (exist? "bootstrap")
1560 (hash-create-handle! boot-modules (string-append "target-" (get "module")) #t))
1561 "" +][+ ENDFOR target_modules +]
3589b69e
PB
1562
1563# With all the machinery above in place, it is pretty easy to generate
1564# dependencies. Host dependencies are a bit more complex because we have
1565# to check for bootstrap/prebootstrap dependencies. To resolve
1566# prebootstrap dependencies, prebootstrap modules are gathered in
1567# a hash table.
7c27e184
PB
1568[+ FOR dependencies +][+ (make-dep "" "") +]
1569[+ CASE (dep-kind) +]
1570[+ == "prebootstrap"
3589b69e 1571 +][+ FOR bootstrap_stage +]
7c27e184
PB
1572[+ (make-dep (dep-stage) "") +][+
1573 ENDFOR bootstrap_stage +]
7c27e184
PB
1574[+ == "bootstrap"
1575 +][+ FOR bootstrap_stage +]
1576[+ (make-dep (dep-stage) (dep-stage)) +][+
3589b69e
PB
1577 ENDFOR bootstrap_stage +]
1578[+ ESAC +][+
1579ENDFOR dependencies +]
1580
fa958513
DJ
1581# Dependencies for target modules on other target modules are
1582# described by lang_env_dependencies; the defaults apply to anything
1583# not mentioned there.
1584[+
1585 ;; Predicate for whether LANG was specified in lang_env_dependencies.
1586 (define lang-dep (lambda (lang)
1587 (hash-ref lang-env-deps (string-append (get "module") "-" lang))))
1588
1589 ;; Build the hash table we will need.
1590 (define lang-env-deps (make-hash-table 7))
1591+][+ FOR lang_env_dependencies +][+
1592 (if (exist? "cxx")
1593 (hash-create-handle! lang-env-deps
1594 (string-append (get "module") "-" "cxx") #t))
1595
1596 (if (exist? "no_c")
1597 (hash-create-handle! lang-env-deps
1598 (string-append (get "module") "-" "no_c") #t))
1599
1600 (if (exist? "no_gcc")
1601 (hash-create-handle! lang-env-deps
1602 (string-append (get "module") "-" "no_gcc") #t))
1603 "" +][+ ENDFOR lang_env_dependencies +]
1604
1605@if gcc-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc"))
1606 +][+ IF bootstrap +][+ FOR bootstrap_stage +]
1607configure-stage[+id+]-target-[+module+]: maybe-all-stage[+id+]-target-libgcc[+
1608 ENDFOR +][+ ENDIF bootstrap +][+ ENDIF +][+ ENDFOR target_modules +]
1609@endif gcc-bootstrap
1610
1611@if gcc-no-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc")) +]
1612configure-target-[+module+]: maybe-all-target-libgcc[+
1613 ENDIF +][+ ENDFOR target_modules +]
1614@endif gcc-no-bootstrap
1615
1616[+ FOR target_modules +][+ IF (not (lang-dep "no_c")) +]
1617configure-target-[+module+]: maybe-all-target-newlib maybe-all-target-libgloss[+
1618 ENDIF +][+ IF (lang-dep "cxx") +]
1619configure-target-[+module+]: maybe-all-target-libstdc++-v3[+
1620 ENDIF +]
1621[+ ENDFOR target_modules +]
1622
ef9db8d5 1623CONFIGURE_GDB_TK = @CONFIGURE_GDB_TK@
0dffceed 1624GDB_TK = @GDB_TK@
ef9db8d5
DJ
1625INSTALL_GDB_TK = @INSTALL_GDB_TK@
1626configure-gdb: $(CONFIGURE_GDB_TK)
3589b69e 1627all-gdb: $(gdbnlmrequirements) $(GDB_TK)
ef9db8d5 1628install-gdb: $(INSTALL_GDB_TK)
95ddd785 1629
4977bab6
ZW
1630# Serialization dependencies. Host configures don't work well in parallel to
1631# each other, due to contention over config.cache. Target configures and
1632# build configures are similar.
1633@serialization_dependencies@
95ddd785 1634
4977bab6
ZW
1635# --------------------------------
1636# Regenerating top level configury
1637# --------------------------------
95ddd785
NN
1638
1639# Rebuilding Makefile.in, using autogen.
e245b0ea 1640AUTOGEN = autogen
ee03dc5e 1641$(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def
e245b0ea 1642 cd $(srcdir) && $(AUTOGEN) Makefile.def
95ddd785 1643
671aa708 1644# Rebuilding Makefile.
e245b0ea
AO
1645Makefile: $(srcdir)/Makefile.in config.status
1646 CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
1647
191dd2c9 1648config.status: configure
e75f9147 1649 CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck
95ddd785 1650
671aa708 1651# Rebuilding configure.
e245b0ea 1652AUTOCONF = autoconf
1c710c3c 1653$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4
e245b0ea 1654 cd $(srcdir) && $(AUTOCONF)
95ddd785 1655
93c834b7
NN
1656# ------------------------------
1657# Special directives to GNU Make
1658# ------------------------------
1659
93c834b7
NN
1660# Don't pass command-line variables to submakes.
1661.NOEXPORT:
1662MAKEOVERRIDES=
1663
95ddd785 1664# end of Makefile.in