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