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