]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - Makefile.tpl
merge from gcc
[thirdparty/binutils-gdb.git] / Makefile.tpl
CommitLineData
52d7cdee 1[+ AutoGen5 template -*- Mode: Makefile -*-
405ea7a0
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,
8520c408 9# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation
405ea7a0
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
6e4d0bcb 23# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
405ea7a0
NN
24#
25
0bb6ea20
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
50212802
NN
34# -------------------------------
35# Standard Autoconf-set variables
36# -------------------------------
583d52d7 37VPATH=@srcdir@
583d52d7 38
c6b750e1 39build_alias=@build_noncanonical@
4b900473
PB
40build_vendor=@build_vendor@
41build_os=@build_os@
7f121bbf 42build=@build@
c6b750e1 43host_alias=@host_noncanonical@
4b900473
PB
44host_vendor=@host_vendor@
45host_os=@host_os@
7f121bbf 46host=@host@
c6b750e1 47target_alias=@target_noncanonical@
4b900473
PB
48target_vendor=@target_vendor@
49target_os=@target_os@
7f121bbf 50target=@target@
583d52d7 51
50212802 52program_transform_name = @program_transform_name@
c66d951e
NN
53
54prefix = @prefix@
55exec_prefix = @exec_prefix@
56
50212802
NN
57srcdir = @srcdir@
58
c66d951e
NN
59bindir = @bindir@
60sbindir = @sbindir@
61libexecdir = @libexecdir@
62datadir = @datadir@
63sysconfdir = @sysconfdir@
64sharedstatedir = @sharedstatedir@
65localstatedir = @localstatedir@
66libdir = @libdir@
67includedir = @includedir@
68oldincludedir = @oldincludedir@
69infodir = @infodir@
108a6f8e
CD
70datarootdir = @datarootdir@
71docdir = @docdir@
a3ca38d2 72pdfdir = @pdfdir@
108a6f8e 73htmldir = @htmldir@
c66d951e 74mandir = @mandir@
405ea7a0
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
405ea7a0 84
e5c3f801
NN
85INSTALL = @INSTALL@
86INSTALL_PROGRAM = @INSTALL_PROGRAM@
87INSTALL_SCRIPT = @INSTALL_SCRIPT@
88INSTALL_DATA = @INSTALL_DATA@
656fdd47
PB
89LN = @LN@
90LN_S = @LN_S@
77d7106f
AM
91MAINT = @MAINT@
92MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
93MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
405ea7a0 94
50212802
NN
95# -------------------------------------------------
96# Miscellaneous non-standard autoconf-set variables
97# -------------------------------------------------
405ea7a0 98
50212802
NN
99# The gcc driver likes to know the arguments it was configured with.
100TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@
405ea7a0 101
50212802
NN
102tooldir = @tooldir@
103build_tooldir = @build_tooldir@
405ea7a0 104
50212802 105GDB_NLM_DEPS =
405ea7a0 106
50212802
NN
107# This is the name of the environment variable used for the path to
108# the libraries.
109RPATH_ENVVAR = @RPATH_ENVVAR@
405ea7a0 110
50212802
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.
a7254363 115BUILD_CONFIGARGS = @build_configargs@ --with-build-subdir="$(BUILD_SUBDIR)"
6a9cf61e
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
378fce5b 129# This is the list of variables to export in the environment when
6a9cf61e 130# configuring subdirectories for the build system.
378fce5b 131BUILD_EXPORTS = \
6a9cf61e 132 $(BASE_EXPORTS) \
378fce5b
DD
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; \
0c24b341
NC
147 WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
148 WINDMC="$(WINDMC_FOR_BUILD)"; export WINDMC;
50212802 149
6641ce42
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
50212802
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@
b00612cc
PB
161# Host programs are put under this directory, which is . except if building
162# with srcdir=..
163HOST_SUBDIR = @host_subdir@
378fce5b 164# This is the list of variables to export in the environment when
be01d343
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.
378fce5b 167HOST_EXPORTS = \
6a9cf61e 168 $(BASE_EXPORTS) \
378fce5b
DD
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; \
0c24b341 183 WINDMC="$(WINDMC)"; export WINDMC; \
378fce5b 184 OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
95b6a1f2 185 OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
be01d343
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; \
378fce5b
DD
193 TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
194 GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
315b3b02 195 GMPINC="$(HOST_GMPINC)"; export GMPINC; \
f70224b5
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
e90269c8 199 $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
378fce5b
DD
200
201# Similar, for later GCC stages.
d545f33b 202POSTSTAGE1_HOST_EXPORTS = \
7ffa0b57 203 $(HOST_EXPORTS) \
b00612cc
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/ \
caee866a 209 -B$(build_tooldir)/bin/"; export CC_FOR_BUILD; \
caee866a 210 LDFLAGS="$(BOOT_LDFLAGS)"; export LDFLAGS;
50212802 211
50212802
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.
a7254363 216TARGET_CONFIGARGS = @target_configargs@ --with-target-subdir="$(TARGET_SUBDIR)"
378fce5b 217# This is the list of variables to export in the environment when
6a9cf61e 218# configuring subdirectories for the host system.
378fce5b 219BASE_TARGET_EXPORTS = \
6a9cf61e 220 $(BASE_EXPORTS) \
378fce5b 221 AR="$(AR_FOR_TARGET)"; export AR; \
be01d343 222 AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \
378fce5b 223 CC="$(CC_FOR_TARGET)"; export CC; \
7f6ef0c0 224 CFLAGS="$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \
378fce5b 225 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
06bcb89d 226 CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
7f6ef0c0 227 CXXFLAGS="$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \
378fce5b
DD
228 GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
229 GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \
230 DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
be01d343 231 LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \
378fce5b 232 LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
7e0f7140 233 LIPO="$(LIPO_FOR_TARGET)"; export LIPO; \
be01d343 234 NM="$(COMPILER_NM_FOR_TARGET)"; export NM; \
5ae72758 235 OBJDUMP="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP; \
378fce5b 236 RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
7e0f7140 237 STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \
315b3b02 238 WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
0c24b341 239 WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \
e90269c8 240 $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
378fce5b
DD
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;
50212802 250
4b1cb4fe
DD
251# Where to find GMP
252HOST_GMPLIBS = @gmplibs@
253HOST_GMPINC = @gmpinc@
254
50212802
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.
b40e3958
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}
50212802
NN
268
269# compilers to use to create programs which must be run in the build
270# environment.
b5714970
PB
271AR_FOR_BUILD = @AR_FOR_BUILD@
272AS_FOR_BUILD = @AS_FOR_BUILD@
50212802 273CC_FOR_BUILD = @CC_FOR_BUILD@
5fbad20a 274CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
b5714970
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@
50212802
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.
50212802
NN
289BUILD_PREFIX = @BUILD_PREFIX@
290BUILD_PREFIX_1 = @BUILD_PREFIX_1@
405ea7a0 291
0df3d27f
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
f6d183c0 295BOOT_LDFLAGS=
0df3d27f 296
be01d343
PB
297BISON = @BISON@
298YACC = @YACC@
299FLEX = @FLEX@
300LEX = @LEX@
301M4 = @M4@
302MAKEINFO = @MAKEINFO@
303EXPECT = @EXPECT@
304RUNTEST = @RUNTEST@
405ea7a0
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.
62a3fc85
DD
309# (Default to avoid splitting info files by setting the threshold high.)
310MAKEINFOFLAGS = --split-size=5000000
405ea7a0 311
50212802
NN
312# ---------------------------------------------
313# Programs producing files for the HOST machine
314# ---------------------------------------------
405ea7a0 315
50212802 316AS = @AS@
50212802
NN
317AR = @AR@
318AR_FLAGS = rc
50212802 319CC = @CC@
50212802 320CXX = @CXX@
50212802 321DLLTOOL = @DLLTOOL@
50212802 322LD = @LD@
be01d343
PB
323LIPO = @LIPO@
324NM = @NM@
80911fe1 325OBJDUMP = @OBJDUMP@
50212802 326RANLIB = @RANLIB@
be01d343 327STRIP = @STRIP@
50212802 328WINDRES = @WINDRES@
0c24b341 329WINDMC = @WINDMC@
405ea7a0 330
a0323144
PB
331GNATBIND = @GNATBIND@
332GNATMAKE = @GNATMAKE@
333
be01d343 334CFLAGS = @CFLAGS@
b2edfdd2 335LDFLAGS = @LDFLAGS@
be01d343
PB
336LIBCFLAGS = $(CFLAGS)
337CXXFLAGS = @CXXFLAGS@
338LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
50212802 339
8a0d8a5c
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
8a0d8a5c
PB
346STAGE1_CHECKING=@stage1_checking@
347STAGE1_LANGUAGES=@stage1_languages@
348
7f6ef0c0 349STAGE1_CFLAGS=@stage1_cflags@
8520c408
AO
350STAGE2_CFLAGS=$(BOOT_CFLAGS)
351STAGE3_CFLAGS=$(BOOT_CFLAGS)
352STAGE4_CFLAGS=$(BOOT_CFLAGS)
353
7f6ef0c0
PB
354STAGE1_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
355STAGE2_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
356STAGE3_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
357STAGE4_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
358
8520c408
AO
359do-compare = @do_compare@
360do-compare3 = $(do-compare)
361do-compare-debug = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2
362
50212802
NN
363# -----------------------------------------------
364# Programs producing files for the TARGET machine
365# -----------------------------------------------
405ea7a0 366
58daee98 367FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
405ea7a0 368
50212802 369AR_FOR_TARGET=@AR_FOR_TARGET@
852e5f18 370AS_FOR_TARGET=@AS_FOR_TARGET@
55db4b87 371CC_FOR_TARGET=$(STAGE_CC_WRAPPER) @CC_FOR_TARGET@ $(FLAGS_FOR_TARGET)
55db4b87 372
50212802
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.
be01d343 377GCC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCC_FOR_TARGET@ $(FLAGS_FOR_TARGET)
55db4b87 378CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @CXX_FOR_TARGET@ $(FLAGS_FOR_TARGET)
55db4b87 379RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@ $(FLAGS_FOR_TARGET)
55db4b87 380GCJ_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCJ_FOR_TARGET@ $(FLAGS_FOR_TARGET)
55db4b87 381GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@ $(FLAGS_FOR_TARGET)
852e5f18 382DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
50212802 383LD_FOR_TARGET=@LD_FOR_TARGET@
50212802 384
7e0f7140 385LIPO_FOR_TARGET=@LIPO_FOR_TARGET@
50212802 386NM_FOR_TARGET=@NM_FOR_TARGET@
5ae72758 387OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@
852e5f18 388RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
7e0f7140 389STRIP_FOR_TARGET=@STRIP_FOR_TARGET@
50212802 390WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@
0c24b341 391WINDMC_FOR_TARGET=@WINDMC_FOR_TARGET@
405ea7a0 392
be01d343
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
7f6ef0c0
PB
397CFLAGS_FOR_TARGET = @CFLAGS_FOR_TARGET@
398CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@
be01d343 399SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
8a6ee3ab 400DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@
7f6ef0c0 401
be01d343
PB
402LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
403LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
404LDFLAGS_FOR_TARGET =
50212802
NN
405
406# ------------------------------------
407# Miscellaneous targets and flag lists
408# ------------------------------------
409
405ea7a0
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.
f70224b5 412all:
405ea7a0 413
405ea7a0 414#### host and target specific makefile fragments come in here.
a0da8069
NN
415@target_makefile_frag@
416@alphaieee_frag@
417@ospace_frag@
418@host_makefile_frag@
405ea7a0
NN
419###
420
e90269c8
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
405ea7a0 452# Flags to pass down to all sub-makes.
c52c6897
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 +] \
10ecffb9 456 "CONFIG_SHELL=$(SHELL)" \
12f0bd74 457 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)"
405ea7a0 458
55db4b87
PB
459# We leave this in just in case, but it is not needed anymore.
460RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS)
656fdd47 461
405ea7a0
NN
462# Flags to pass down to most sub-makes, in which we're building with
463# the host environment.
405ea7a0
NN
464EXTRA_HOST_FLAGS = \
465 'AR=$(AR)' \
466 'AS=$(AS)' \
467 'CC=$(CC)' \
468 'CXX=$(CXX)' \
469 'DLLTOOL=$(DLLTOOL)' \
470 'LD=$(LD)' \
be01d343 471 'LIPO=$(LIPO)' \
405ea7a0 472 'NM=$(NM)' \
80911fe1 473 'OBJDUMP=$(OBJDUMP)' \
b9459e83 474 'RANLIB=$(RANLIB)' \
be01d343 475 'STRIP=$(STRIP)' \
0c24b341
NC
476 'WINDRES=$(WINDRES)' \
477 'WINDMC=$(WINDMC)'
405ea7a0
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
8a0d8a5c
PB
493# Flags to pass to stage2 and later makes.
494
495POSTSTAGE1_FLAGS_TO_PASS = \
496 CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
a0323144 497 GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind" \
8a0d8a5c
PB
498 LDFLAGS="$(BOOT_LDFLAGS)" \
499 "`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
500
405ea7a0 501# Flags to pass down to makes which are built with the target environment.
0aed8855
PB
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
7f6ef0c0
PB
504# *_CFLAGS_FOR_TARGET variables are not passed down and most often empty,
505# so we expand them here.
405ea7a0
NN
506EXTRA_TARGET_FLAGS = \
507 'AR=$$(AR_FOR_TARGET)' \
0aed8855 508 'AS=$(COMPILER_AS_FOR_TARGET)' \
405ea7a0 509 'CC=$$(CC_FOR_TARGET)' \
7f6ef0c0 510 'CFLAGS=$$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \
405ea7a0 511 'CXX=$$(CXX_FOR_TARGET)' \
7f6ef0c0 512 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \
405ea7a0 513 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
0aed8855 514 'LD=$(COMPILER_LD_FOR_TARGET)' \
414e5532 515 'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \
7f6ef0c0
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)' \
0aed8855 518 'NM=$(COMPILER_NM_FOR_TARGET)' \
5ae72758 519 'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \
405ea7a0 520 'RANLIB=$$(RANLIB_FOR_TARGET)' \
0c24b341
NC
521 'WINDRES=$$(WINDRES_FOR_TARGET)' \
522 'WINDMC=$$(WINDMC_FOR_TARGET)'
405ea7a0
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.
2a4cbe27 530# The BUILD_* variables are a special case, which are used for the gcc
405ea7a0
NN
531# cross-building scheme.
532EXTRA_GCC_FLAGS = \
405ea7a0 533 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
3dee29da
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=/'`" \
c52c6897 538 "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
405ea7a0 539
f0b24077 540GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS)
405ea7a0 541
dd12c3a8 542.PHONY: configure-host
b813574b 543configure-host: [+
dd12c3a8
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 +]
405ea7a0 552
319cab08
PB
553# The target built for a native non-bootstrap build.
554.PHONY: all
f70224b5
PB
555all:
556@if gcc-bootstrap
be01d343 557 [ -f stage_final ] || echo stage3 > stage_final
f70224b5
PB
558 @r=`${PWD_COMMAND}`; export r; \
559 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
0aed8855 560 $(MAKE) $(RECURSE_FLAGS_TO_PASS) `cat stage_final`-bubble
f70224b5 561@endif gcc-bootstrap
0aed8855 562 @: $(MAKE); $(unstage)
f70224b5
PB
563 @r=`${PWD_COMMAND}`; export r; \
564 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
565 if [ -f stage_last ]; then \
be01d343 566 $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target; \
f70224b5 567 else \
be01d343 568 $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target; \
f70224b5 569 fi
dd12c3a8 570
6a9cf61e 571.PHONY: all-build
c52c6897
PB
572[+ FOR build_modules +]
573all-build: maybe-all-build-[+module+][+ ENDFOR build_modules +]
574
dd12c3a8 575.PHONY: all-host
c52c6897
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
dd12c3a8 581.PHONY: all-target
c52c6897 582[+ FOR target_modules +][+ IF bootstrap +]
f86e35b8 583@if target-[+module+]-no-bootstrap[+ ENDIF bootstrap +]
c52c6897 584all-target: maybe-all-target-[+module+][+ IF bootstrap +]
f86e35b8
NC
585@endif target-[+module+]-no-bootstrap[+
586 ENDIF bootstrap +][+ ENDFOR target_modules +]
405ea7a0
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).
e393202e 592[+ FOR recursive_targets +]
27b1cc72 593.PHONY: do-[+make_target+]
f70224b5 594do-[+make_target+]:
0aed8855 595 @: $(MAKE); $(unstage)
e360f423
PB
596 @r=`${PWD_COMMAND}`; export r; \
597 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
598 $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+make_target+]-host \
f70224b5 599 [+make_target+]-target
f70224b5 600
2a4cbe27
NN
601
602.PHONY: [+make_target+]-host
c52c6897
PB
603[+ FOR host_modules +]
604[+make_target+]-host: maybe-[+make_target+]-[+module+][+ ENDFOR host_modules +]
2a4cbe27
NN
605
606.PHONY: [+make_target+]-target
c52c6897
PB
607[+ FOR target_modules +]
608[+make_target+]-target: maybe-[+make_target+]-target-[+module+][+ ENDFOR target_modules +]
e393202e
NN
609[+ ENDFOR recursive_targets +]
610
405ea7a0
NN
611# Here are the targets which correspond to the do-X targets.
612
a3ca38d2
DD
613.PHONY: info installcheck dvi pdf html
614.PHONY: install-info install-pdf install-html
405ea7a0
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
56a8fe78 620pdf: do-pdf
6d389afc 621html: do-html
405ea7a0 622
43d92c63
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
405ea7a0
NN
626
627install-info: do-install-info dir.info
b40e3958 628 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
405ea7a0 629 if [ -f dir.info ] ; then \
497f816e 630 $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \
405ea7a0
NN
631 else true ; fi
632
a3ca38d2
DD
633install-pdf: do-install-pdf
634
108a6f8e
CD
635install-html: do-install-html
636
405ea7a0
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
0aed8855 642 -rm -f maybedep.tmp serdep.tmp
405ea7a0
NN
643 -if [ "$(TARGET_SUBDIR)" != "." ]; then \
644 rm -rf $(TARGET_SUBDIR); \
645 else true; fi
e4c4d240 646 -rm -rf $(BUILD_SUBDIR)
b00612cc
PB
647 -if [ "$(HOST_SUBDIR)" != "." ]; then \
648 rm -rf $(HOST_SUBDIR); \
649 else true; fi
405ea7a0
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
405ea7a0
NN
667# Check target.
668
669.PHONY: check do-check
ede4fbe4 670check: do-check
405ea7a0 671
3866be5d 672# Only include modules actually being configured and built.
f70224b5
PB
673.PHONY: check-host
674check-host: [+
16ae0395
NN
675 FOR host_modules +] \
676 maybe-check-[+module+][+
f70224b5
PB
677 ENDFOR host_modules +]
678
679.PHONY: check-target
680check-target: [+
16ae0395
NN
681 FOR target_modules +] \
682 maybe-check-target-[+module+][+
f70224b5
PB
683 ENDFOR target_modules +]
684
685do-check:
0aed8855 686 @: $(MAKE); $(unstage)
e360f423
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
405ea7a0
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
ae831be5 714.PHONY: install uninstall
f70224b5 715install:
0aed8855 716 @: $(MAKE); $(unstage)
e360f423
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
dd12c3a8 720
16ae0395
NN
721.PHONY: install-host-nogcc
722install-host-nogcc: [+
9e6ce191
PB
723 FOR host_modules +][+ IF (not (= (get "module") "gcc")) +] \
724 maybe-install-[+module+][+ ENDIF +][+
16ae0395
NN
725 ENDFOR host_modules +]
726
dd12c3a8 727.PHONY: install-host
b813574b 728install-host: [+
dd12c3a8
NN
729 FOR host_modules +] \
730 maybe-install-[+module+][+
731 ENDFOR host_modules +]
16ae0395 732
dd12c3a8
NN
733.PHONY: install-target
734install-target: [+
735 FOR target_modules +] \
736 maybe-install-target-[+module+][+
737 ENDFOR target_modules +]
405ea7a0
NN
738
739uninstall:
740 @echo "the uninstall target is not supported in this tree"
741
405ea7a0
NN
742.PHONY: install.all
743install.all: install-no-fixedincludes
744 @if [ -f ./gcc/Makefile ] ; then \
b40e3958 745 r=`${PWD_COMMAND}` ; export r ; \
0aed8855 746 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
7ffa0b57 747 $(HOST_EXPORTS) \
1086bc09 748 (cd ./gcc && \
405ea7a0
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
16ae0395 757install-no-fixedincludes: installdirs install-host-nogcc \
dd12c3a8 758 install-target gcc-no-fixedincludes
405ea7a0 759
15723a45 760### other supporting targets
405ea7a0 761
15723a45
NN
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 \
497f816e 771 $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
15723a45
NN
772 mv -f dir.info.new dir.info ; \
773 else true ; \
405ea7a0
NN
774 fi
775
15723a45
NN
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
a7254363
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+]:
4f0ef2d8
CD
797@if gcc-bootstrap
798configure-[+prefix+][+module+]: stage_current
799@endif gcc-bootstrap
a7254363
PB
800@if [+prefix+][+module+]
801maybe-configure-[+prefix+][+module+]: configure-[+prefix+][+module+]
4f0ef2d8 802configure-[+prefix+][+module+]: [+ IF bootstrap +][+ ELSE +]
c52c6897
PB
803 @: $(MAKE); $(unstage)[+ ENDIF bootstrap +]
804 @r=`${PWD_COMMAND}`; export r; \
0aed8855 805 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
c52c6897
PB
806 [+ IF check_multilibs
807 +]echo "Checking multilib configuration for [+module+]..."; \
0aed8855
PB
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; \
c52c6897
PB
819 fi; \
820 [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \
a7254363 821 $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \
a7254363
PB
822 [+exports+] \
823 echo Configuring in [+subdir+]/[+module+]; \
824 cd "[+subdir+]/[+module+]" || exit 1; \
bba45b8b 825 case $(srcdir) in \
b00612cc 826 /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
a7254363 827 *) topdir=`echo [+subdir+]/[+module+]/ | \
b00612cc 828 sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
bba45b8b 829 esac; \
b00612cc
PB
830 srcdiroption="--srcdir=$${topdir}/[+module+]"; \
831 libsrcdir="$$s/[+module+]"; \
a7254363
PB
832 [+ IF no-config-site +]rm -f no-such-file || : ; \
833 CONFIG_SITE=no-such-file [+ ENDIF +]$(SHELL) $${libsrcdir}/configure \
4b900473
PB
834 [+args+] --build=${build_alias} --host=[+host_alias+] \
835 --target=[+target_alias+] $${srcdiroption} [+extra_configure_flags+] \
bba45b8b 836 || exit 1
a7254363 837@endif [+prefix+][+module+]
d545f33b
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+]:
0aed8855 843@if [+prefix+][+module+]-bootstrap
d545f33b 844maybe-configure-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
0aed8855 845configure-stage[+id+]-[+prefix+][+module+]:
c52c6897 846 @[ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start
0aed8855 847 @$(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]
c52c6897 848 @r=`${PWD_COMMAND}`; export r; \
d545f33b 849 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
c52c6897
PB
850 [+ IF check_multilibs
851 +]echo "Checking multilib configuration for [+module+]..."; \
0aed8855
PB
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; \
c52c6897
PB
862 fi; \
863 [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \
d545f33b 864 [+exports+][+ IF prev +] \
7f6ef0c0
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 +] \
8ee82aff 868 CFLAGS="[+stage_cflags+]"; export CFLAGS; \
7f6ef0c0 869 CXXFLAGS="[+stage_cflags+]"; export CXXFLAGS; [+ ENDIF +] \
d545f33b 870 echo Configuring stage [+id+] in [+subdir+]/[+module+] ; \
0aed8855 871 $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \
d545f33b
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 \
4b900473
PB
881 [+args+] --build=${build_alias} --host=[+host_alias+] \
882 --target=[+target_alias+] $${srcdiroption} \
c1cb7e02 883 [+ IF prev +]--with-build-libsubdir=$(HOST_SUBDIR)[+ ENDIF prev +] \
d545f33b 884 [+stage_configure_flags+] [+extra_configure_flags+]
0aed8855 885@endif [+prefix+][+module+]-bootstrap
d545f33b
PB
886[+ ENDFOR bootstrap_stage +]
887[+ ENDIF bootstrap +]
a7254363
PB
888[+ ENDDEF +]
889
890[+ DEFINE all +]
891.PHONY: all-[+prefix+][+module+] maybe-all-[+prefix+][+module+]
892maybe-all-[+prefix+][+module+]:
4f0ef2d8
CD
893@if gcc-bootstrap
894all-[+prefix+][+module+]: stage_current
895@endif gcc-bootstrap
a7254363
PB
896@if [+prefix+][+module+]
897TARGET-[+prefix+][+module+]=[+
4b900473 898 IF all_target +][+all_target+][+ ELSE +]all[+ ENDIF all_target +]
a7254363 899maybe-all-[+prefix+][+module+]: all-[+prefix+][+module+]
4f0ef2d8 900all-[+prefix+][+module+]: configure-[+prefix+][+module+][+ IF bootstrap +][+ ELSE +]
c52c6897
PB
901 @: $(MAKE); $(unstage)[+ ENDIF bootstrap +]
902 @r=`${PWD_COMMAND}`; export r; \
b40e3958 903 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
a7254363
PB
904 [+exports+] \
905 (cd [+subdir+]/[+module+] && \
7f6ef0c0
PB
906 $(MAKE) $(BASE_FLAGS_TO_PASS) [+args+] [+extra_make_flags+] \
907 $(TARGET-[+prefix+][+module+]))
a7254363 908@endif [+prefix+][+module+]
d545f33b
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+]:
0aed8855 916@if [+prefix+][+module+]-bootstrap
d545f33b
PB
917maybe-all-stage[+id+]-[+prefix+][+module+]: all-stage[+id+]-[+prefix+][+module+]
918all-stage[+id+]: all-stage[+id+]-[+prefix+][+module+]
f70224b5 919TARGET-stage[+id+]-[+prefix+][+module+] = $(TARGET-[+prefix+][+module+])
d545f33b 920all-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
c52c6897 921 @[ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start
d545f33b
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+] && \
7f6ef0c0
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+] [+
8ee82aff
PB
932 IF prev +][+poststage1_args+][+ ENDIF prev
933 +] [+extra_make_flags+] \
f70224b5 934 $(TARGET-stage[+id+]-[+prefix+][+module+])
d545f33b
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+]:
9dbaa842
DD
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; \
d545f33b
PB
945 cd [+subdir+]/[+module+] && \
946 $(MAKE) [+args+] [+ IF prev +] \
947 [+poststage1_args+] [+ ENDIF prev +] \
8ee82aff 948 [+extra_make_flags+] clean
0aed8855 949@endif [+prefix+][+module+]-bootstrap
d545f33b
PB
950
951[+ ENDFOR bootstrap_stage +]
952[+ ENDIF bootstrap +]
a7254363
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)"
4b900473
PB
960 host_alias=(get "host" "${build_alias}")
961 target_alias=(get "target" "${target_alias}")
a7254363
PB
962 args="$(BUILD_CONFIGARGS)" no-config-site=true +]
963
6641ce42
JM
964[+ all prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)"
965 args="$(EXTRA_BUILD_FLAGS)" +]
a7254363 966[+ ENDFOR build_module +]
405ea7a0 967
15723a45
NN
968# --------------------------------------
969# Modules which run on the host machine
970# --------------------------------------
3866be5d 971[+ FOR host_modules +]
d545f33b
PB
972[+ configure prefix="" subdir="$(HOST_SUBDIR)"
973 exports="$(HOST_EXPORTS)"
974 poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)"
4b900473
PB
975 host_alias=(get "host" "${host_alias}")
976 target_alias=(get "target" "${target_alias}")
a7254363 977 args="$(HOST_CONFIGARGS)" +]
e2b9e2dc 978
d545f33b
PB
979[+ all prefix="" subdir="$(HOST_SUBDIR)"
980 exports="$(HOST_EXPORTS)"
981 poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)"
7f6ef0c0 982 args="$(EXTRA_HOST_FLAGS)"
d545f33b 983 poststage1_args="$(POSTSTAGE1_FLAGS_TO_PASS)" +]
405ea7a0 984
16ae0395
NN
985.PHONY: check-[+module+] maybe-check-[+module+]
986maybe-check-[+module+]:
6bd3dfaa
PB
987@if [+module+]
988maybe-check-[+module+]: check-[+module+]
3866be5d 989[+ IF no_check +]
3866be5d
NN
990check-[+module+]:
991[+ ELIF no_check_cross +]
3866be5d
NN
992# This module is only tested in a native toolchain.
993check-[+module+]:
0aed8855 994 @: $(MAKE); $(unstage)
7f121bbf 995 @if [ '$(host)' = '$(target)' ] ; then \
b40e3958
L
996 r=`${PWD_COMMAND}`; export r; \
997 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
378fce5b 998 $(HOST_EXPORTS) \
b00612cc 999 (cd $(HOST_SUBDIR)/[+module+] && \
4cfaf6d5 1000 $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] check); \
bba45b8b
NN
1001 fi
1002[+ ELSE check +]
bba45b8b 1003check-[+module+]:
0aed8855 1004 @: $(MAKE); $(unstage)
b40e3958
L
1005 @r=`${PWD_COMMAND}`; export r; \
1006 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
378fce5b 1007 $(HOST_EXPORTS) \
b00612cc
PB
1008 (cd $(HOST_SUBDIR)/[+module+] && \
1009 $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] check)
3866be5d 1010[+ ENDIF no_check +]
6bd3dfaa 1011@endif [+module+]
405ea7a0 1012
930314a4
NN
1013.PHONY: install-[+module+] maybe-install-[+module+]
1014maybe-install-[+module+]:
6bd3dfaa
PB
1015@if [+module+]
1016maybe-install-[+module+]: install-[+module+]
16ae0395 1017[+ IF no_install +]
3866be5d
NN
1018install-[+module+]:
1019[+ ELSE install +]
3866be5d 1020install-[+module+]: installdirs
0aed8855 1021 @: $(MAKE); $(unstage)
b40e3958
L
1022 @r=`${PWD_COMMAND}`; export r; \
1023 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
378fce5b 1024 $(HOST_EXPORTS) \
b00612cc 1025 (cd $(HOST_SUBDIR)/[+module+] && \
2da12f12 1026 $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] install)
3866be5d 1027[+ ENDIF no_install +]
6bd3dfaa 1028@endif [+module+]
4fa63067 1029
56a8fe78 1030# Other targets (info, dvi, pdf, etc.)
4fa63067
NN
1031[+ FOR recursive_targets +]
1032.PHONY: maybe-[+make_target+]-[+module+] [+make_target+]-[+module+]
1033maybe-[+make_target+]-[+module+]:
6bd3dfaa
PB
1034@if [+module+]
1035maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+]
4fa63067
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 +]
0aed8855 1044 @[+ IF bootstrap +][+ ELSE +]: $(MAKE); $(unstage)
f70224b5 1045 @[+ ENDIF bootstrap +][ -f ./[+module+]/Makefile ] || exit 0; \
4fa63067
NN
1046 r=`${PWD_COMMAND}`; export r; \
1047 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
378fce5b 1048 $(HOST_EXPORTS) \
b813574b 1049 for flag in $(EXTRA_HOST_FLAGS) [+extra_make_flags+]; do \
4fa63067
NN
1050 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
1051 done; \
1052 echo "Doing [+make_target+] in [+module+]" ; \
b00612cc 1053 (cd $(HOST_SUBDIR)/[+module+] && \
4fa63067
NN
1054 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
1055 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
1056 "RANLIB=$${RANLIB}" \
0c24b341 1057 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
b813574b 1058 [+make_target+]) \
4fa63067
NN
1059 || exit 1
1060[+ ENDIF +]
6bd3dfaa 1061@endif [+module+]
4fa63067 1062[+ ENDFOR recursive_targets +]
3866be5d 1063[+ ENDFOR host_modules +]
405ea7a0 1064
15723a45
NN
1065# ---------------------------------------
1066# Modules which run on the target machine
1067# ---------------------------------------
e393202e 1068[+ FOR target_modules +]
15723a45 1069
a7254363
PB
1070[+ IF raw_cxx +]
1071[+ configure prefix="target-" subdir="$(TARGET_SUBDIR)"
0aed8855 1072 check_multilibs=true
a7254363 1073 exports="$(RAW_CXX_TARGET_EXPORTS)"
4b900473
PB
1074 host_alias=(get "host" "${target_alias}")
1075 target_alias=(get "target" "${target_alias}")
a7254363
PB
1076 args="$(TARGET_CONFIGARGS)" no-config-site=true +]
1077
1078[+ all prefix="target-" subdir="$(TARGET_SUBDIR)"
1079 exports="$(RAW_CXX_TARGET_EXPORTS)"
7f6ef0c0 1080 args="$(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'" +]
a7254363
PB
1081[+ ELSE +]
1082[+ configure prefix="target-" subdir="$(TARGET_SUBDIR)"
0aed8855 1083 check_multilibs=true
a7254363 1084 exports="$(NORMAL_TARGET_EXPORTS)"
4b900473
PB
1085 host_alias=(get "host" "${target_alias}")
1086 target_alias=(get "target" "${target_alias}")
a7254363
PB
1087 args="$(TARGET_CONFIGARGS)" no-config-site=true +]
1088
1089[+ all prefix="target-" subdir="$(TARGET_SUBDIR)"
1090 exports="$(NORMAL_TARGET_EXPORTS)"
7f6ef0c0 1091 args="$(EXTRA_TARGET_FLAGS)" +]
a7254363 1092[+ ENDIF +]
16ae0395
NN
1093
1094.PHONY: check-target-[+module+] maybe-check-target-[+module+]
1095maybe-check-target-[+module+]:
6bd3dfaa
PB
1096@if target-[+module+]
1097maybe-check-target-[+module+]: check-target-[+module+]
3866be5d
NN
1098[+ IF no_check +]
1099# Dummy target for uncheckable module.
3866be5d
NN
1100check-target-[+module+]:
1101[+ ELSE check +]
e393202e 1102check-target-[+module+]:
0aed8855 1103 @: $(MAKE); $(unstage)
b40e3958 1104 @r=`${PWD_COMMAND}`; export r; \
e90269c8 1105 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
378fce5b
DD
1106IF raw_cxx +]
1107 $(RAW_CXX_TARGET_EXPORTS) \[+
1108ELSE normal_cxx +]
1109 $(NORMAL_TARGET_EXPORTS) \[+
1110ENDIF raw_cxx +]
bba45b8b
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
7ffa0b57 1116 +] [+extra_make_flags+] check)
e393202e 1117[+ ENDIF no_check +]
6bd3dfaa 1118@endif target-[+module+]
16ae0395 1119
930314a4
NN
1120.PHONY: install-target-[+module+] maybe-install-target-[+module+]
1121maybe-install-target-[+module+]:
6bd3dfaa
PB
1122@if target-[+module+]
1123maybe-install-target-[+module+]: install-target-[+module+]
16ae0395 1124[+ IF no_install +]
930314a4
NN
1125# Dummy target for uninstallable.
1126install-target-[+module+]:
1127[+ ELSE install +]
e393202e 1128install-target-[+module+]: installdirs
0aed8855 1129 @: $(MAKE); $(unstage)
b40e3958 1130 @r=`${PWD_COMMAND}`; export r; \
e90269c8 1131 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
378fce5b
DD
1132IF raw_cxx +]
1133 $(RAW_CXX_TARGET_EXPORTS) \[+
1134ELSE normal_cxx +]
1135 $(NORMAL_TARGET_EXPORTS) \[+
1136ENDIF raw_cxx +]
bba45b8b 1137 (cd $(TARGET_SUBDIR)/[+module+] && \
7ffa0b57 1138 $(MAKE) $(TARGET_FLAGS_TO_PASS) [+extra_make_flags+] install)
e393202e 1139[+ ENDIF no_install +]
6bd3dfaa 1140@endif target-[+module+]
4fa63067 1141
56a8fe78 1142# Other targets (info, dvi, pdf, etc.)
4fa63067
NN
1143[+ FOR recursive_targets +]
1144.PHONY: maybe-[+make_target+]-target-[+module+] [+make_target+]-target-[+module+]
1145maybe-[+make_target+]-target-[+module+]:
6bd3dfaa
PB
1146@if target-[+module+]
1147maybe-[+make_target+]-target-[+module+]: [+make_target+]-target-[+module+]
4fa63067
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 +]
0aed8855 1156 @: $(MAKE); $(unstage)
4fa63067
NN
1157 @[ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] || exit 0 ; \
1158 r=`${PWD_COMMAND}`; export r; \
e90269c8 1159 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
378fce5b
DD
1160IF raw_cxx +]
1161 $(RAW_CXX_TARGET_EXPORTS) \[+
1162ELSE normal_cxx +]
1163 $(NORMAL_TARGET_EXPORTS) \[+
1164ENDIF raw_cxx +]
4fa63067
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}" \
0c24b341 1173 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
7ffa0b57 1174 [+extra_make_flags+] [+make_target+]) \
4fa63067
NN
1175 || exit 1
1176[+ ENDIF +]
6bd3dfaa 1177@endif target-[+module+]
4fa63067 1178[+ ENDFOR recursive_targets +]
e393202e 1179[+ ENDFOR target_modules +]
405ea7a0 1180
15723a45
NN
1181# ----------
1182# GCC module
1183# ----------
1184
319cab08 1185@if gcc-no-bootstrap
405ea7a0 1186.PHONY: cross
72b2455a 1187cross: all-build all-gas all-ld
b40e3958
L
1188 @r=`${PWD_COMMAND}`; export r; \
1189 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
7ffa0b57 1190 $(HOST_EXPORTS) \
405ea7a0
NN
1191 echo "Building the C and C++ compiler"; \
1192 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
b40e3958
L
1193 @r=`${PWD_COMMAND}`; export r; \
1194 s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
405ea7a0 1195 echo "Building runtime libraries"; \
656fdd47 1196 $(MAKE) $(RECURSE_FLAGS_TO_PASS) LANGUAGES="c c++" all
319cab08 1197@endif gcc-no-bootstrap
405ea7a0 1198
6bd3dfaa 1199@if gcc
7d695d07
JM
1200.PHONY: check-gcc-c++
1201check-gcc-c++:
405ea7a0 1202 @if [ -f ./gcc/Makefile ] ; then \
b40e3958
L
1203 r=`${PWD_COMMAND}`; export r; \
1204 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
7ffa0b57 1205 $(HOST_EXPORTS) \
1086bc09 1206 (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
405ea7a0
NN
1207 else \
1208 true; \
7d695d07
JM
1209 fi
1210
1211.PHONY: check-c++
ede4fbe4 1212check-c++: check-target-libstdc++-v3 check-gcc-c++
405ea7a0 1213
15723a45
NN
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; \
b40e3958
L
1226 r=`${PWD_COMMAND}`; export r; \
1227 s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
7ffa0b57 1228 $(HOST_EXPORTS) \
1086bc09 1229 (cd ./gcc && \
15723a45
NN
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
6bd3dfaa 1234@endif gcc
4fa63067 1235
1d39f329
NN
1236# ---------------------
1237# GCC bootstrap support
1238# ---------------------
1239
b813574b
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
f70224b5 1244# While making host and target tools, symlinks to the final stage must be
0aed8855
PB
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.
f70224b5
PB
1249
1250unstage = :
1251stage = :
c52c6897 1252current_stage = ""
f70224b5 1253
b813574b 1254@if gcc-bootstrap
9daf3993 1255unstage = if [ -f stage_last ]; then [ -f stage_current ] || $(MAKE) `cat stage_last`-start || exit 1; else :; fi
f6d183c0 1256stage = if [ -f stage_current ]; then $(MAKE) `cat stage_current`-end || exit 1; else :; fi
c52c6897 1257current_stage = "`cat stage_current 2> /dev/null`"
b813574b
PB
1258@endif gcc-bootstrap
1259
f70224b5
PB
1260.PHONY: unstage stage
1261unstage:
0aed8855 1262 @: $(MAKE); $(unstage)
b813574b 1263stage:
0aed8855 1264 @: $(MAKE); $(stage)
b813574b 1265
80911fe1
PB
1266# Disable commands for lean bootstrap.
1267LEAN = false
1268
dfdffa2c
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
0aed8855 1274# the previous stage to a constant name ('prev-gcc'), and to make the name of
dfdffa2c
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
1d39f329
NN
1280# 'touch' doesn't work right on some platforms.
1281STAMP = echo timestamp >
1282
dfdffa2c
PB
1283# We only want to compare .o files, so set this!
1284objext = .o
1d39f329 1285
dfdffa2c 1286[+ FOR bootstrap-stage +]
319cab08 1287.PHONY: stage[+id+]-start stage[+id+]-end
dfdffa2c 1288
656fdd47 1289stage[+id+]-start::
0aed8855 1290 @: $(MAKE); $(stage); \
b813574b 1291 echo stage[+id+] > stage_current ; \
b00612cc 1292 echo stage[+id+] > stage_last; \
0aed8855 1293 $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)[+
b00612cc 1294 FOR host_modules +][+ IF bootstrap +]
72b2455a 1295@if [+ module +]
b00612cc
PB
1296 @cd $(HOST_SUBDIR); [ -d stage[+id+]-[+module+] ] || \
1297 mkdir stage[+id+]-[+module+]; \
80911fe1
PB
1298 mv stage[+id+]-[+module+] [+module+] [+ IF prev +] ; \
1299 mv stage[+prev+]-[+module+] prev-[+module+] || test -f stage[+prev+]-lean [+ ENDIF prev +]
0aed8855
PB
1300@endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
1301 @[ -d stage[+id+]-$(TARGET_SUBDIR) ] || \
1302 mkdir stage[+id+]-$(TARGET_SUBDIR); \
80911fe1
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 +]
dfdffa2c 1305
80911fe1 1306stage[+id+]-end:: [+ FOR host_modules +][+ IF bootstrap +]
72b2455a 1307@if [+ module +]
80911fe1
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 +] ; \
0aed8855
PB
1311 fi
1312@endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
1313 @if test -d $(TARGET_SUBDIR) ; then \
80911fe1
PB
1314 mv $(TARGET_SUBDIR) stage[+id+]-$(TARGET_SUBDIR) [+ IF prev +] ; \
1315 mv prev-$(TARGET_SUBDIR) stage[+prev+]-$(TARGET_SUBDIR) ; : [+ ENDIF prev +] ; \
0aed8855 1316 fi
80911fe1 1317 rm -f stage_current
dfdffa2c 1318
973601e1 1319# Bubble a bug fix through all the stages up to stage [+id+]. They are
0aed8855
PB
1320# remade, but not reconfigured. The next stage (if any) will not be
1321# reconfigured as well.
319cab08 1322.PHONY: stage[+id+]-bubble
80911fe1 1323stage[+id+]-bubble:: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +]
e360f423
PB
1324 @r=`${PWD_COMMAND}`; export r; \
1325 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1326 if test -f stage[+id+]-lean [+
9cb3fa6f
PB
1327 IF prev +]|| test -f stage[+prev+]-lean [+ ENDIF prev +] ; then \
1328 echo Skipping rebuild of stage[+id+] ; \
1329 else \
80911fe1
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 +]
f70224b5 1335 $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage[+id+]; \
be01d343 1336 fi[+ IF compare-target +]
f6d183c0 1337 $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+compare-target+][+ ENDIF compare-target +]
72b2455a 1338
0df3d27f 1339.PHONY: all-stage[+id+] clean-stage[+id+]
0df3d27f 1340do-clean: clean-stage[+id+]
1d39f329 1341
72b2455a
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
dfdffa2c 1345[+ IF compare-target +]
9cb3fa6f 1346[+compare-target+]:
e360f423
PB
1347 @r=`${PWD_COMMAND}`; export r; \
1348 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1349 if test -f stage[+prev+]-lean; then \
9cb3fa6f
PB
1350 echo Cannot compare object files as stage [+prev+] was deleted. ; \
1351 exit 0 ; \
1352 fi; \
0aed8855 1353 : $(MAKE); $(stage); \
1d39f329 1354 rm -f .bad_compare ; \
c52c6897 1355 echo Comparing stages [+prev+] and [+id+] ; \
dfdffa2c 1356 cd stage[+id+]-gcc; \
1d39f329
NN
1357 files=`find . -name "*$(objext)" -print` ; \
1358 cd .. ; \
1359 for file in $${files} ; do \
dfdffa2c 1360 f1=$$r/stage[+prev+]-gcc/$$file; f2=$$r/stage[+id+]-gcc/$$file; \
8520c408 1361 $(do-[+compare-target+]) > /dev/null 2>&1; \
f70224b5
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 ; \
1d39f329
NN
1370 done ; \
1371 if [ -f .bad_compare ]; then \
1372 echo "Bootstrap comparison failure!"; \
1373 cat .bad_compare; \
1374 exit 1; \
1375 else \
c52c6897 1376 echo Comparison successful.; \
1d39f329 1377 fi ; \
9cb3fa6f 1378 $(STAMP) [+compare-target+][+ IF prev +]
80911fe1
PB
1379 if $(LEAN); then \
1380 rm -rf stage[+prev+]-*; \
1381 $(STAMP) stage[+prev+]-lean; \
1382 fi[+ ENDIF prev +]
dfdffa2c
PB
1383[+ ENDIF compare-target +]
1384
1385[+ IF bootstrap-target +]
80911fe1 1386.PHONY: [+bootstrap-target+] [+bootstrap-target+]-lean
be01d343
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
0aed8855 1392 @: $(MAKE); $(unstage)
be01d343
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
80911fe1
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
dfdffa2c
PB
1406[+ ENDIF bootstrap-target +]
1407
0df3d27f 1408# Rules to wipe a stage and all the following ones, also used for cleanstrap
656fdd47 1409[+ IF prev +]distclean-stage[+prev+]:: distclean-stage[+id+] [+ ENDIF prev +]
0df3d27f 1410.PHONY: distclean-stage[+id+]
656fdd47 1411distclean-stage[+id+]::
0aed8855 1412 @: $(MAKE); $(stage)
e00a73e3 1413 @test "`cat stage_last`" != stage[+id+] || rm -f stage_last
9cb3fa6f 1414 rm -rf stage[+id+]-* [+
dfdffa2c 1415 IF compare-target +][+compare-target+] [+ ENDIF compare-target +]
dfdffa2c
PB
1416
1417[+ IF cleanstrap-target +]
1418.PHONY: [+cleanstrap-target+]
e00a73e3
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
dfdffa2c 1428[+ ENDIF cleanstrap-target +]
72b2455a 1429@endif gcc-bootstrap
dfdffa2c
PB
1430
1431[+ ENDFOR bootstrap-stage +]
656fdd47 1432
7d329e61
PB
1433stageprofile-end::
1434 $(MAKE) distclean-stagefeedback
656fdd47 1435
7d329e61 1436stagefeedback-start::
656fdd47
PB
1437 @r=`${PWD_COMMAND}`; export r; \
1438 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
7d329e61
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
b8908782 1445
0df3d27f 1446@if gcc-bootstrap
0df3d27f 1447do-distclean: distclean-stage1
c52c6897
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
0df3d27f 1453
4f0ef2d8
CD
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
c52c6897 1459.PHONY: restrap
266df637 1460restrap::
c52c6897
PB
1461 @: $(MAKE); $(stage)
1462 rm -rf stage1-$(TARGET_SUBDIR) [+ FOR bootstrap-stage +][+ IF prev
c380fdd8 1463 +]stage[+id+]-* [+ ENDIF prev +][+ ENDFOR bootstrap-stage +]
266df637 1464restrap:: all
c380fdd8 1465@endif gcc-bootstrap
c52c6897 1466
ae831be5
NN
1467# --------------------------------------
1468# Dependencies between different modules
1469# --------------------------------------
405ea7a0 1470
9e6ce191 1471# Generic dependencies for target modules on host stuff, especially gcc
c52c6897
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
6aa8ef82 1480@if gcc-no-bootstrap[+ FOR target_modules +]
c52c6897 1481configure-target-[+module+]: maybe-all-gcc[+
6aa8ef82 1482 ENDFOR target_modules +]
c52c6897
PB
1483@endif gcc-no-bootstrap
1484
9e6ce191 1485
ae831be5
NN
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
9e6ce191 1490# are made here to depend on a 'maybe-' target. If you're not sure,
ae831be5
NN
1491# it's safer to use a soft dependency.
1492
9e6ce191
PB
1493[+ ;; These Scheme functions build the bulk of the dependencies.
1494 ;; dep-target builds a string like "maybe-all-MODULE_KIND-gcc",
1495 ;; where "maybe-" is only included if HARD is true, and all-gcc
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.
72b2455a 1506 (define make-dep (lambda (module-kind on-kind)
9e6ce191
PB
1507 (string-append
1508 (dep-target module-kind "module" #t) ": "
72b2455a 1509 (dep-target on-kind "on" (exist? "hard")))))
9e6ce191
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
21fde4dc
DD
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
9e6ce191
PB
1535 ;; configure or build dependencies between bootstrapped modules; it returns
1536 ;; "prebootstrap" for configure or build dependencies of bootstrapped
72b2455a 1537 ;; modules on a build module (e.g. all-gcc on all-build-bison). All this
9e6ce191
PB
1538 ;; is only necessary for host modules.
1539 (define dep-kind (lambda ()
72b2455a
PB
1540 (if (and (hash-ref boot-modules (dep-module "module"))
1541 (=* (dep-module "on") "build-"))
1542 "prebootstrap"
9e6ce191 1543
72b2455a 1544 (if (or (= (dep-subtarget "on") "install-")
21fde4dc
DD
1545 (not (hash-ref boot-modules (dep-module "module")))
1546 (not (hash-ref boot-modules (dep-module "on"))))
72b2455a
PB
1547 "normal"
1548 "bootstrap"))))
9e6ce191
PB
1549
1550 ;; We now build the hash table that is used by dep-kind.
1551 (define boot-modules (make-hash-table 113))
9e6ce191
PB
1552+]
1553
1554[+ FOR host_modules +][+
1555 (if (exist? "bootstrap")
1556 (hash-create-handle! boot-modules (get "module") #t))
1557 "" +][+ ENDFOR host_modules +]
1dc3053f
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 +]
9e6ce191
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.
72b2455a
PB
1568[+ FOR dependencies +][+ (make-dep "" "") +]
1569[+ CASE (dep-kind) +]
1570[+ == "prebootstrap"
9e6ce191 1571 +][+ FOR bootstrap_stage +]
72b2455a
PB
1572[+ (make-dep (dep-stage) "") +][+
1573 ENDFOR bootstrap_stage +]
72b2455a
PB
1574[+ == "bootstrap"
1575 +][+ FOR bootstrap_stage +]
1576[+ (make-dep (dep-stage) (dep-stage)) +][+
9e6ce191
PB
1577 ENDFOR bootstrap_stage +]
1578[+ ESAC +][+
1579ENDFOR dependencies +]
1580
6aa8ef82
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
907be67c 1623CONFIGURE_GDB_TK = @CONFIGURE_GDB_TK@
ae831be5 1624GDB_TK = @GDB_TK@
907be67c
DJ
1625INSTALL_GDB_TK = @INSTALL_GDB_TK@
1626configure-gdb: $(CONFIGURE_GDB_TK)
9e6ce191 1627all-gdb: $(gdbnlmrequirements) $(GDB_TK)
907be67c 1628install-gdb: $(INSTALL_GDB_TK)
907a7241 1629
a2cc058a
NN
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@
1634
15723a45
NN
1635# --------------------------------
1636# Regenerating top level configury
1637# --------------------------------
405ea7a0
NN
1638
1639# Rebuilding Makefile.in, using autogen.
43be203f 1640AUTOGEN = autogen
6b784d9f 1641$(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def
43be203f 1642 cd $(srcdir) && $(AUTOGEN) Makefile.def
405ea7a0 1643
a0da8069 1644# Rebuilding Makefile.
43be203f
AO
1645Makefile: $(srcdir)/Makefile.in config.status
1646 CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
1647
479759c8 1648config.status: configure
10ecffb9 1649 CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck
405ea7a0 1650
a0da8069 1651# Rebuilding configure.
43be203f 1652AUTOCONF = autoconf
c6b750e1 1653$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4
43be203f 1654 cd $(srcdir) && $(AUTOCONF)
405ea7a0 1655
3728fade
NN
1656# ------------------------------
1657# Special directives to GNU Make
1658# ------------------------------
1659
3728fade
NN
1660# Don't pass command-line variables to submakes.
1661.NOEXPORT:
1662MAKEOVERRIDES=
1663
405ea7a0 1664# end of Makefile.in