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