]> gcc.gnu.org Git - gcc.git/blame - Makefile.tpl
gengtype-yacc.y (option): Avoid use of non-constant struct initializer.
[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,
4fc4dd12 9# 1999, 2000, 2001, 2002, 2003, 2004 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
23# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24#
25
df0f0674
NN
26# -------------------------------
27# Standard Autoconf-set variables
28# -------------------------------
4977bab6 29VPATH=@srcdir@
4977bab6
ZW
30
31build_alias=@build_alias@
e89fbdfe 32build=@build@
4977bab6 33host_alias=@host_alias@
e89fbdfe 34host=@host@
4977bab6 35target_alias=@target_alias@
e89fbdfe 36target=@target@
4977bab6 37
df0f0674 38program_transform_name = @program_transform_name@
0dffceed
NN
39
40prefix = @prefix@
41exec_prefix = @exec_prefix@
42
df0f0674
NN
43srcdir = @srcdir@
44
0dffceed
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@
95ddd785
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
95ddd785 66
775956d0
NN
67INSTALL = @INSTALL@
68INSTALL_PROGRAM = @INSTALL_PROGRAM@
69INSTALL_SCRIPT = @INSTALL_SCRIPT@
70INSTALL_DATA = @INSTALL_DATA@
ad6717df
PB
71LN = @LN@
72LN_S = @LN_S@
95ddd785 73
df0f0674
NN
74# -------------------------------------------------
75# Miscellaneous non-standard autoconf-set variables
76# -------------------------------------------------
95ddd785 77
df0f0674
NN
78# The file containing GCC's version number.
79gcc_version_trigger = @gcc_version_trigger@
80gcc_version = @gcc_version@
95ddd785 81
df0f0674
NN
82# The gcc driver likes to know the arguments it was configured with.
83TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@
95ddd785 84
df0f0674
NN
85gxx_include_dir = @gxx_include_dir@
86libstdcxx_incdir = @libstdcxx_incdir@
95ddd785 87
df0f0674
NN
88tooldir = @tooldir@
89build_tooldir = @build_tooldir@
95ddd785 90
df0f0674 91# Directory in which the compiler finds executables, libraries, etc.
a8ee6e2d 92libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)
df0f0674 93GDB_NLM_DEPS =
95ddd785 94
df0f0674
NN
95# This is the name of the environment variable used for the path to
96# the libraries.
97RPATH_ENVVAR = @RPATH_ENVVAR@
95ddd785 98
df0f0674
NN
99# This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
100# was used.
101SET_LIB_PATH = @SET_LIB_PATH@
95ddd785 102
df0f0674
NN
103# configure.in sets SET_LIB_PATH to this if --enable-shared was used.
104# Some platforms don't like blank entries, so we remove duplicate,
105# leading and trailing colons.
106REALLY_SET_LIB_PATH = \
107 $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
95ddd785 108
df0f0674 109# This is the list of directories to be built for the build system.
6de9cd9a 110BUILD_CONFIGDIRS = libiberty libbanshee
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.
115BUILD_CONFIGARGS = @build_configargs@
4fc4dd12
DJ
116# This is the list of variables to export in the environment when
117# configuring subdirectories for the build system. It must also be
118# exported whenever recursing into a build directory in case that
119# directory's Makefile re-runs configure.
120BUILD_EXPORTS = \
121 AR="$(AR_FOR_BUILD)"; export AR; \
122 AS="$(AS_FOR_BUILD)"; export AS; \
123 CC="$(CC_FOR_BUILD)"; export CC; \
124 CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
125 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
126 CXX="$(CXX_FOR_BUILD)"; export CXX; \
127 CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
128 GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
129 GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
130 DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
131 LD="$(LD_FOR_BUILD)"; export LD; \
132 LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
133 NM="$(NM_FOR_BUILD)"; export NM; \
134 RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
135 WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES;
df0f0674
NN
136
137# This is the list of directories to built for the host system.
138SUBDIRS = @configdirs@
139# This is set by the configure script to the arguments to use when configuring
140# directories built for the host system.
141HOST_CONFIGARGS = @host_configargs@
4fc4dd12
DJ
142# This is the list of variables to export in the environment when
143# configuring subdirectories for the host system. It must also be
144# exported whenever recursing into a host directory in case that
145# directory's Makefile re-runs configure.
146HOST_EXPORTS = \
147 CC="$(CC)"; export CC; \
148 CFLAGS="$(CFLAGS)"; export CFLAGS; \
149 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
150 CXX="$(CXX)"; export CXX; \
151 CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
152 AR="$(AR)"; export AR; \
153 AS="$(AS)"; export AS; \
154 CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
155 DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
156 LD="$(LD)"; export LD; \
157 LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \
158 NM="$(NM)"; export NM; \
159 RANLIB="$(RANLIB)"; export RANLIB; \
160 WINDRES="$(WINDRES)"; export WINDRES; \
161 OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
162 OBJDUMP="$(OBJDUMP)"; export OBJDUMP;
4fc4dd12
DJ
163 TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
164 GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
165 GMPINC="$(HOST_GMPINC)"; export GMPINC;
166
167# Similar, for later GCC stages.
168STAGE_HOST_EXPORTS = \
a52a0a7f 169 $(HOST_EXPORTS) \
4fc4dd12
DJ
170 CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \
171 CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC_FOR_BUILD;
df0f0674
NN
172
173# This is set by the configure script to the list of directories which
174# should be built using the target tools.
175TARGET_CONFIGDIRS = @target_configdirs@
176# Target libraries are put under this directory:
177TARGET_SUBDIR = @target_subdir@
178# This is set by the configure script to the arguments to use when configuring
179# directories built for the target.
180TARGET_CONFIGARGS = @target_configargs@
4fc4dd12
DJ
181# This is the list of variables to export in the environment when
182# configuring subdirectories for the host system. It must also be
183# exported whenever recursing into a host directory in case that
184# directory's Makefile re-runs configure.
185BASE_TARGET_EXPORTS = \
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; \
191 CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
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; \
198 NM="$(NM_FOR_TARGET)"; export NM; \
199 RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
200 WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES;
201
202RAW_CXX_TARGET_EXPORTS = \
203 $(BASE_TARGET_EXPORTS) \
204 CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
205 CXX="$(RAW_CXX_FOR_TARGET)"; export CXX;
206
207NORMAL_TARGET_EXPORTS = \
208 $(BASE_TARGET_EXPORTS) \
209 CXX="$(CXX_FOR_TARGET)"; export CXX;
df0f0674 210
6de9cd9a
DN
211# Where to find GMP
212HOST_GMPLIBS = @gmplibs@
213HOST_GMPINC = @gmpinc@
214
df0f0674
NN
215# ----------------------------------------------
216# Programs producing files for the BUILD machine
217# ----------------------------------------------
218
219SHELL = @config_shell@
220
221# pwd command to use. Allow user to override default by setting PWDCMD in
222# the environment to account for automounters. The make variable must not
223# be called PWDCMD, otherwise the value set here is passed to make
224# subprocesses and overrides the setting from the user's environment.
8c90b13a
L
225# Don't use PWD since it is a common shell environment variable and we
226# don't want to corrupt it.
227PWD_COMMAND = $${PWDCMD-pwd}
df0f0674
NN
228
229# compilers to use to create programs which must be run in the build
230# environment.
231CC_FOR_BUILD = @CC_FOR_BUILD@
6691a79e 232CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
df0f0674
NN
233
234CXX_FOR_BUILD = $(CXX)
235
236# Special variables passed down in EXTRA_GCC_FLAGS. They are defined
237# here so that they can be overridden by Makefile fragments.
df0f0674
NN
238BUILD_PREFIX = @BUILD_PREFIX@
239BUILD_PREFIX_1 = @BUILD_PREFIX_1@
95ddd785 240
4977bab6
ZW
241BISON=@BISON@
242USUAL_BISON = `if [ -f $$r/bison/bison ] ; then \
95ddd785
NN
243 echo $$r/bison/bison -L $$s/bison/ ; \
244 else \
245 echo bison ; \
246 fi`
247
df0f0674 248DEFAULT_YACC = @DEFAULT_YACC@
4977bab6
ZW
249YACC=@YACC@
250USUAL_YACC = `if [ -f $$r/bison/bison ] ; then \
95ddd785
NN
251 echo $$r/bison/bison -y -L $$s/bison/ ; \
252 elif [ -f $$r/byacc/byacc ] ; then \
253 echo $$r/byacc/byacc ; \
254 else \
255 echo ${DEFAULT_YACC} ; \
256 fi`
257
df0f0674 258DEFAULT_LEX = @DEFAULT_LEX@
4977bab6
ZW
259LEX=@LEX@
260USUAL_LEX = `if [ -f $$r/flex/flex ] ; \
95ddd785
NN
261 then echo $$r/flex/flex ; \
262 else echo ${DEFAULT_LEX} ; fi`
263
df0f0674 264DEFAULT_M4 = @DEFAULT_M4@
95ddd785
NN
265M4 = `if [ -f $$r/m4/m4 ] ; \
266 then echo $$r/m4/m4 ; \
267 else echo ${DEFAULT_M4} ; fi`
268
de722255 269# For an installed makeinfo, we require it to be from texinfo 4.2 or
95ddd785 270# higher, else we use the "missing" dummy.
4977bab6
ZW
271MAKEINFO=@MAKEINFO@
272USUAL_MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
95ddd785
NN
273 then echo $$r/texinfo/makeinfo/makeinfo ; \
274 else if (makeinfo --version \
de722255 275 | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])') >/dev/null 2>&1; \
95ddd785
NN
276 then echo makeinfo; else echo $$s/missing makeinfo; fi; fi`
277
278# This just becomes part of the MAKEINFO definition passed down to
279# sub-makes. It lets flags be given on the command line while still
280# using the makeinfo from the object tree.
2f50999f
GP
281# (Default to avoid splitting info files by setting the threshold high.)
282MAKEINFOFLAGS = --split-size=5000000
95ddd785
NN
283
284EXPECT = `if [ -f $$r/expect/expect ] ; \
285 then echo $$r/expect/expect ; \
286 else echo expect ; fi`
287
288RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
289 then echo $$s/dejagnu/runtest ; \
290 else echo runtest ; fi`
291
df0f0674
NN
292# ---------------------------------------------
293# Programs producing files for the HOST machine
294# ---------------------------------------------
95ddd785 295
df0f0674
NN
296# This is the list of directories that may be needed in RPATH_ENVVAR
297# so that programs built for the host machine work.
298HOST_LIB_PATH = $$r/bfd:$$r/opcodes
95ddd785 299
df0f0674 300AS = @AS@
95ddd785 301
df0f0674
NN
302AR = @AR@
303AR_FLAGS = rc
95ddd785 304
df0f0674
NN
305CC = @CC@
306CFLAGS = @CFLAGS@
307LIBCFLAGS = $(CFLAGS)
95ddd785 308
df0f0674
NN
309CXX = @CXX@
310CXXFLAGS = @CXXFLAGS@
311LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
95ddd785 312
df0f0674 313DLLTOOL = @DLLTOOL@
95ddd785 314
df0f0674 315NM = @NM@
4977bab6 316
df0f0674
NN
317LD = @LD@
318LDFLAGS =
4977bab6 319
df0f0674 320RANLIB = @RANLIB@
95ddd785 321
df0f0674 322WINDRES = @WINDRES@
95ddd785 323
df0f0674
NN
324PICFLAG =
325
326# -----------------------------------------------
327# Programs producing files for the TARGET machine
328# -----------------------------------------------
95ddd785
NN
329
330# This is the list of directories that may be needed in RPATH_ENVVAR
331# so that prorgams built for the target machine work.
6de9cd9a 332TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:$$r/$(TARGET_SUBDIR)/libmudflap/.libs
95ddd785 333
ec0461f6 334FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
95ddd785 335
df0f0674 336AR_FOR_TARGET=@AR_FOR_TARGET@
be912515 337CONFIGURED_AR_FOR_TARGET=@CONFIGURED_AR_FOR_TARGET@
df0f0674
NN
338USUAL_AR_FOR_TARGET = ` \
339 if [ -f $$r/binutils/ar ] ; then \
340 echo $$r/binutils/ar ; \
341 else \
e89fbdfe 342 if [ '$(host)' = '$(target)' ] ; then \
df0f0674
NN
343 echo $(AR); \
344 else \
be912515 345 echo $(CONFIGURED_AR_FOR_TARGET) ; \
df0f0674
NN
346 fi; \
347 fi`
95ddd785 348
4977bab6 349AS_FOR_TARGET=@AS_FOR_TARGET@
be912515 350CONFIGURED_AS_FOR_TARGET=@CONFIGURED_AS_FOR_TARGET@
4977bab6 351USUAL_AS_FOR_TARGET = ` \
95ddd785
NN
352 if [ -f $$r/gas/as-new ] ; then \
353 echo $$r/gas/as-new ; \
354 elif [ -f $$r/gcc/xgcc ]; then \
355 $(CC_FOR_TARGET) -print-prog-name=as ; \
356 else \
e89fbdfe 357 if [ '$(host)' = '$(target)' ] ; then \
95ddd785
NN
358 echo $(AS); \
359 else \
be912515 360 echo $(CONFIGURED_AS_FOR_TARGET) ; \
95ddd785
NN
361 fi; \
362 fi`
363
df0f0674
NN
364CC_FOR_TARGET = @CC_FOR_TARGET@
365# During gcc bootstrap, if we use some random cc for stage1 then
366# CFLAGS will be just -g. We want to ensure that TARGET libraries
367# (which we know are built with gcc) are built with optimizations so
368# prepend -O2 when setting CFLAGS_FOR_TARGET.
369CFLAGS_FOR_TARGET = -O2 $(CFLAGS)
370# If GCC_FOR_TARGET is not overriden on the command line, then this
371# variable is passed down to the gcc Makefile, where it is used to
372# build libgcc2.a. We define it here so that it can itself be
373# overridden on the command line.
374GCC_FOR_TARGET=@GCC_FOR_TARGET@
375USUAL_GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET)
376LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
377
378CXX_FOR_TARGET = @CXX_FOR_TARGET@
379RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@
380CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
381RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
382CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
383LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
95ddd785 384
4977bab6 385DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
be912515 386CONFIGURED_DLLTOOL_FOR_TARGET=@CONFIGURED_DLLTOOL_FOR_TARGET@
4977bab6 387USUAL_DLLTOOL_FOR_TARGET = ` \
95ddd785
NN
388 if [ -f $$r/binutils/dlltool ] ; then \
389 echo $$r/binutils/dlltool ; \
390 else \
e89fbdfe 391 if [ '$(host)' = '$(target)' ] ; then \
95ddd785
NN
392 echo $(DLLTOOL); \
393 else \
be912515 394 echo $(CONFIGURED_DLLTOOL_FOR_TARGET) ; \
95ddd785
NN
395 fi; \
396 fi`
397
df0f0674 398GCJ_FOR_TARGET = @GCJ_FOR_TARGET@
6de9cd9a 399GFORTRAN_FOR_TARGET = @GFORTRAN_FOR_TARGET@
df0f0674
NN
400
401LD_FOR_TARGET=@LD_FOR_TARGET@
be912515 402CONFIGURED_LD_FOR_TARGET=@CONFIGURED_LD_FOR_TARGET@
df0f0674
NN
403USUAL_LD_FOR_TARGET = ` \
404 if [ -f $$r/ld/ld-new ] ; then \
405 echo $$r/ld/ld-new ; \
406 elif [ -f $$r/gcc/xgcc ]; then \
407 $(CC_FOR_TARGET) -print-prog-name=ld ; \
95ddd785 408 else \
e89fbdfe 409 if [ '$(host)' = '$(target)' ] ; then \
df0f0674 410 echo $(LD); \
95ddd785 411 else \
be912515 412 echo $(CONFIGURED_LD_FOR_TARGET) ; \
95ddd785
NN
413 fi; \
414 fi`
415
df0f0674
NN
416LDFLAGS_FOR_TARGET =
417
418NM_FOR_TARGET=@NM_FOR_TARGET@
be912515 419CONFIGURED_NM_FOR_TARGET=@CONFIGURED_NM_FOR_TARGET@
df0f0674
NN
420USUAL_NM_FOR_TARGET = ` \
421 if [ -f $$r/binutils/nm-new ] ; then \
422 echo $$r/binutils/nm-new ; \
423 elif [ -f $$r/gcc/xgcc ]; then \
424 $(CC_FOR_TARGET) -print-prog-name=nm ; \
95ddd785 425 else \
e89fbdfe 426 if [ '$(host)' = '$(target)' ] ; then \
df0f0674 427 echo $(NM); \
95ddd785 428 else \
be912515 429 echo $(CONFIGURED_NM_FOR_TARGET) ; \
95ddd785
NN
430 fi; \
431 fi`
432
4977bab6 433RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
be912515 434CONFIGURED_RANLIB_FOR_TARGET=@CONFIGURED_RANLIB_FOR_TARGET@
4977bab6 435USUAL_RANLIB_FOR_TARGET = ` \
95ddd785
NN
436 if [ -f $$r/binutils/ranlib ] ; then \
437 echo $$r/binutils/ranlib ; \
438 else \
e89fbdfe 439 if [ '$(host)' = '$(target)' ] ; then \
95ddd785
NN
440 if [ x'$(RANLIB)' != x ]; then \
441 echo $(RANLIB); \
442 else \
443 echo ranlib; \
444 fi; \
445 else \
be912515 446 echo $(CONFIGURED_RANLIB_FOR_TARGET) ; \
95ddd785
NN
447 fi; \
448 fi`
449
df0f0674 450WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@
be912515 451CONFIGURED_WINDRES_FOR_TARGET=@CONFIGURED_WINDRES_FOR_TARGET@
df0f0674
NN
452USUAL_WINDRES_FOR_TARGET = ` \
453 if [ -f $$r/binutils/windres ] ; then \
454 echo $$r/binutils/windres ; \
95ddd785 455 else \
e89fbdfe 456 if [ '$(host)' = '$(target)' ] ; then \
df0f0674 457 echo $(WINDRES); \
95ddd785 458 else \
be912515 459 echo $(CONFIGURED_WINDRES_FOR_TARGET) ; \
95ddd785
NN
460 fi; \
461 fi`
462
df0f0674
NN
463PICFLAG_FOR_TARGET =
464
465# ------------------------------------
466# Miscellaneous targets and flag lists
467# ------------------------------------
468
95ddd785
NN
469# The first rule in the file had better be this one. Don't put any above it.
470# This lives here to allow makefile fragments to contain dependencies.
f516a7da 471@default_target@:
95ddd785 472
95ddd785 473#### host and target specific makefile fragments come in here.
671aa708
NN
474@target_makefile_frag@
475@alphaieee_frag@
476@ospace_frag@
477@host_makefile_frag@
95ddd785
NN
478###
479
480# Flags to pass down to all sub-makes.
11405c93
NN
481BASE_FLAGS_TO_PASS = [+ FOR flags_to_pass +]\
482 "[+flag+]=$([+flag+])" [+ ENDFOR flags_to_pass +]\
e75f9147 483 "CONFIG_SHELL=$(SHELL)" \
11405c93 484 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)"
95ddd785
NN
485
486# For any flags above that may contain shell code that varies from one
487# target library to another. When doing recursive invocations of the
488# top-level Makefile, we don't want the outer make to evaluate them,
489# so we pass these variables down unchanged. They must not contain
490# single nor double quotes.
491RECURSE_FLAGS = \
4977bab6
ZW
492 CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \
493 RAW_CXX_FOR_TARGET='$(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \
95ddd785 494
ad6717df
PB
495RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS)
496
95ddd785
NN
497# Flags to pass down to most sub-makes, in which we're building with
498# the host environment.
95ddd785
NN
499EXTRA_HOST_FLAGS = \
500 'AR=$(AR)' \
501 'AS=$(AS)' \
502 'CC=$(CC)' \
503 'CXX=$(CXX)' \
504 'DLLTOOL=$(DLLTOOL)' \
505 'LD=$(LD)' \
506 'NM=$(NM)' \
c858bf1e 507 'RANLIB=$(RANLIB)' \
95ddd785
NN
508 'WINDRES=$(WINDRES)'
509
510FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
511
512# Flags that are concerned with the location of the X11 include files
513# and library files
514#
515# NOTE: until the top-level is getting the values via autoconf, it only
516# causes problems to have this top-level Makefile overriding the autoconf-set
517# values in child directories. Only variables that don't conflict with
518# autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
519#
520X11_FLAGS_TO_PASS = \
521 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
522 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
523
524# Flags to pass down to makes which are built with the target environment.
525# The double $ decreases the length of the command line; the variables
526# are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
95ddd785
NN
527EXTRA_TARGET_FLAGS = \
528 'AR=$$(AR_FOR_TARGET)' \
529 'AS=$$(AS_FOR_TARGET)' \
530 'CC=$$(CC_FOR_TARGET)' \
531 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
532 'CXX=$$(CXX_FOR_TARGET)' \
533 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
534 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
535 'LD=$$(LD_FOR_TARGET)' \
536 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
537 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
538 'NM=$$(NM_FOR_TARGET)' \
539 'RANLIB=$$(RANLIB_FOR_TARGET)' \
540 'WINDRES=$$(WINDRES_FOR_TARGET)'
541
542TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
543
544# Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
545# unfortunately needs the native compiler and the target ar and
546# ranlib.
547# If any variables are added here, they must be added to do-*, below.
1358ccea 548# The BUILD_* variables are a special case, which are used for the gcc
95ddd785
NN
549# cross-building scheme.
550EXTRA_GCC_FLAGS = \
95ddd785
NN
551 'BUILD_PREFIX=$(BUILD_PREFIX)' \
552 'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \
95ddd785
NN
553 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
554 "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
d4cd9d81
NN
555 "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
556 "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
557 "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
558 "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
559 "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
560 "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
561 "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
562 "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
563 "`echo 'BOOT_ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
95ddd785 564
d29b8ad8 565GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS)
95ddd785 566
8b87bb96
NN
567.PHONY: configure-host
568configure-host: maybe-configure-gcc [+
569 FOR host_modules +] \
570 maybe-configure-[+module+][+
571 ENDFOR host_modules +]
572.PHONY: configure-target
573configure-target: [+
574 FOR target_modules +] \
575 maybe-configure-target-[+module+][+
576 ENDFOR target_modules +]
95ddd785 577
f516a7da
PB
578# The target built for a native non-bootstrap build.
579.PHONY: all
580all: @all_build_modules@ all-host all-target
8b87bb96
NN
581
582.PHONY: all-host
583all-host: maybe-all-gcc [+
584 FOR host_modules +] \
585 maybe-all-[+module+][+
586 ENDFOR host_modules +]
587.PHONY: all-target
588all-target: [+
589 FOR target_modules +] \
590 maybe-all-target-[+module+][+
591 ENDFOR target_modules +]
95ddd785
NN
592
593# Do a target for all the subdirectories. A ``make do-X'' will do a
594# ``make X'' in all subdirectories (because, in general, there is a
595# dependency (below) of X upon do-X, a ``make X'' will also do this,
596# but it may do additional work as well).
4977bab6 597[+ FOR recursive_targets +]
1a1e6b96 598.PHONY: do-[+make_target+]
1358ccea
NN
599do-[+make_target+]: [+make_target+]-host [+make_target+]-target
600
601.PHONY: [+make_target+]-host
602[+make_target+]-host: maybe-[+make_target+]-gcc [+
603 FOR host_modules +] \
604 maybe-[+make_target+]-[+module+][+
605 ENDFOR host_modules +]
606
607.PHONY: [+make_target+]-target
608[+make_target+]-target: [+
609 FOR target_modules +] \
610 maybe-[+make_target+]-target-[+module+][+
611 ENDFOR target_modules +]
4977bab6
ZW
612[+ ENDFOR recursive_targets +]
613
95ddd785
NN
614# Here are the targets which correspond to the do-X targets.
615
616.PHONY: info installcheck dvi install-info
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
622
212f6dd0
NN
623# Make sure makeinfo is built before we do a `make info', if we're
624# in fact building texinfo.
625do-info: maybe-all-texinfo
95ddd785
NN
626
627install-info: do-install-info dir.info
8c90b13a 628 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
95ddd785 629 if [ -f dir.info ] ; then \
3fbe8e4a 630 $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \
95ddd785
NN
631 else true ; fi
632
633local-clean:
634 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
635
636local-distclean:
637 -rm -f Makefile config.status config.cache mh-frag mt-frag
ade82b16 638 -rm -f multilib.out multilib.tmp maybedep.tmp serdep.tmp
95ddd785
NN
639 -if [ "$(TARGET_SUBDIR)" != "." ]; then \
640 rm -rf $(TARGET_SUBDIR); \
641 else true; fi
0c227849 642 -rm -rf $(BUILD_SUBDIR)
95ddd785
NN
643 -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
644 -rm -f texinfo/doc/Makefile texinfo/po/POTFILES
645 -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
646 -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null
647 -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null
648
649local-maintainer-clean:
650 @echo "This command is intended for maintainers to use;"
651 @echo "it deletes files that may require special tools to rebuild."
652
653clean: do-clean local-clean
654mostlyclean: do-mostlyclean local-clean
655distclean: do-distclean local-clean local-distclean
656maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
657maintainer-clean: local-distclean
658realclean: maintainer-clean
659
1358ccea
NN
660# Extra dependency for clean-target, owing to the mixed nature of gcc
661clean-target: clean-target-libgcc
95ddd785
NN
662clean-target-libgcc:
663 test ! -d gcc/libgcc || \
664 (cd gcc/libgcc && find . -type d -print) | \
665 while read d; do rm -f gcc/$$d/libgcc.a || : ; done
666 -rm -rf gcc/libgcc
667
668# Check target.
669
670.PHONY: check do-check
333a28b4 671check: do-check
95ddd785 672
4977bab6 673# Only include modules actually being configured and built.
7e2dbcef
NN
674do-check: maybe-check-gcc [+
675 FOR host_modules +] \
676 maybe-check-[+module+][+
677 ENDFOR host_modules +][+
678 FOR target_modules +] \
679 maybe-check-target-[+module+][+
680 ENDFOR target_modules +]
95ddd785
NN
681
682# Automated reporting of test results.
683
684warning.log: build.log
685 $(srcdir)/contrib/warn_summary build.log > $@
686
687mail-report.log:
688 if test x'$(BOOT_CFLAGS)' != x''; then \
689 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
690 fi; \
691 $(srcdir)/contrib/test_summary -t >$@
692 chmod +x $@
693 echo If you really want to send e-mail, run ./$@ now
694
695mail-report-with-warnings.log: warning.log
696 if test x'$(BOOT_CFLAGS)' != x''; then \
697 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
698 fi; \
699 $(srcdir)/contrib/test_summary -t -i warning.log >$@
700 chmod +x $@
701 echo If you really want to send e-mail, run ./$@ now
702
703# Installation targets.
704
4977bab6 705.PHONY: install uninstall
8b87bb96
NN
706install: installdirs install-host install-target
707
7e2dbcef
NN
708.PHONY: install-host-nogcc
709install-host-nogcc: [+
710 FOR host_modules +] \
711 maybe-install-[+module+][+
712 ENDFOR host_modules +]
713
8b87bb96
NN
714.PHONY: install-host
715install-host: maybe-install-gcc [+
716 FOR host_modules +] \
717 maybe-install-[+module+][+
718 ENDFOR host_modules +]
7e2dbcef 719
8b87bb96
NN
720.PHONY: install-target
721install-target: [+
722 FOR target_modules +] \
723 maybe-install-target-[+module+][+
724 ENDFOR target_modules +]
95ddd785
NN
725
726uninstall:
727 @echo "the uninstall target is not supported in this tree"
728
95ddd785
NN
729.PHONY: install.all
730install.all: install-no-fixedincludes
731 @if [ -f ./gcc/Makefile ] ; then \
8c90b13a 732 r=`${PWD_COMMAND}` ; export r ; \
95ddd785 733 $(SET_LIB_PATH) \
a52a0a7f 734 $(HOST_EXPORTS) \
88b5521b 735 (cd ./gcc && \
95ddd785
NN
736 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
737 else \
738 true ; \
739 fi
740
741# install-no-fixedincludes is used because Cygnus can not distribute
742# the fixed header files.
743.PHONY: install-no-fixedincludes
7e2dbcef 744install-no-fixedincludes: installdirs install-host-nogcc \
8b87bb96 745 install-target gcc-no-fixedincludes
95ddd785 746
4977bab6 747### other supporting targets
95ddd785 748
4977bab6
ZW
749MAKEDIRS= \
750 $(DESTDIR)$(prefix) \
751 $(DESTDIR)$(exec_prefix)
752.PHONY: installdirs
753installdirs: mkinstalldirs
754 $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
755
756dir.info: do-install-info
757 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
3fbe8e4a 758 $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
4977bab6
ZW
759 mv -f dir.info.new dir.info ; \
760 else true ; \
95ddd785
NN
761 fi
762
4977bab6
ZW
763dist:
764 @echo "Building a full distribution of this tree isn't done"
765 @echo "via 'make dist'. Check out the etc/ subdirectory"
766
767etags tags: TAGS
768
769# Right now this just builds TAGS in each subdirectory. emacs19 has the
770# ability to use several tags files at once, so there is probably no need
771# to combine them into one big TAGS file (like CVS 1.3 does). We could
772# (if we felt like it) have this Makefile write a piece of elisp which
773# the user could load to tell emacs19 where all the TAGS files we just
774# built are.
775TAGS: do-TAGS
776
4977bab6
ZW
777# --------------------------------------
778# Modules which run on the build machine
779# --------------------------------------
780[+ FOR build_modules +]
781.PHONY: configure-build-[+module+] maybe-configure-build-[+module+]
782maybe-configure-build-[+module+]:
60975492
PB
783@if build-[+module+]
784maybe-configure-build-[+module+]: configure-build-[+module+]
ade82b16
AO
785configure-build-[+module+]:
786 @test ! -f $(BUILD_SUBDIR)/[+module+]/Makefile || exit 0; \
b4acb5ef 787 $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/[+module+] ; \
8c90b13a
L
788 r=`${PWD_COMMAND}`; export r; \
789 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
4fc4dd12 790 $(BUILD_EXPORTS) \
3aa83176
NN
791 echo Configuring in $(BUILD_SUBDIR)/[+module+]; \
792 cd "$(BUILD_SUBDIR)/[+module+]" || exit 1; \
793 case $(srcdir) in \
794 /* | [A-Za-z]:[\\/]*) \
795 topdir=$(srcdir) ;; \
796 *) \
797 case "$(BUILD_SUBDIR)" in \
95ddd785
NN
798 .) topdir="../$(srcdir)" ;; \
799 *) topdir="../../$(srcdir)" ;; \
3aa83176
NN
800 esac ;; \
801 esac; \
802 if [ "$(srcdir)" = "." ] ; then \
803 if [ "$(BUILD_SUBDIR)" != "." ] ; then \
804 if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \
805 if [ -f Makefile ]; then \
806 if $(MAKE) distclean; then \
807 true; \
808 else \
809 exit 1; \
810 fi; \
95ddd785 811 else \
3aa83176 812 true; \
95ddd785 813 fi; \
95ddd785 814 else \
3aa83176 815 exit 1; \
95ddd785 816 fi; \
3aa83176
NN
817 else \
818 true; \
819 fi; \
820 srcdiroption="--srcdir=."; \
821 libsrcdir="."; \
822 else \
823 srcdiroption="--srcdir=$${topdir}/[+module+]"; \
824 libsrcdir="$$s/[+module+]"; \
825 fi; \
826 rm -f no-such-file || : ; \
827 CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
828 $(BUILD_CONFIGARGS) $${srcdiroption} \
a52a0a7f 829 --with-build-subdir="$(BUILD_SUBDIR)" [+extra_configure_flags+] \
3aa83176 830 || exit 1
60975492 831@endif build-[+module+]
4977bab6
ZW
832
833.PHONY: all-build-[+module+] maybe-all-build-[+module+]
834maybe-all-build-[+module+]:
60975492
PB
835@if build-[+module+]
836maybe-all-build-[+module+]: all-build-[+module+]
4977bab6 837all-build-[+module+]: configure-build-[+module+]
8c90b13a
L
838 @r=`${PWD_COMMAND}`; export r; \
839 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
4fc4dd12 840 $(BUILD_EXPORTS) \
a52a0a7f 841 (cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) [+extra_make_flags+] all)
60975492 842@endif build-[+module+]
4977bab6
ZW
843[+ ENDFOR build_modules +]
844
845# --------------------------------------
846# Modules which run on the host machine
847# --------------------------------------
848[+ FOR host_modules +]
849.PHONY: configure-[+module+] maybe-configure-[+module+]
850maybe-configure-[+module+]:
60975492
PB
851@if [+module+]
852maybe-configure-[+module+]: configure-[+module+]
ade82b16
AO
853configure-[+module+]:
854 @test ! -f [+module+]/Makefile || exit 0; \
855 [ -d [+module+] ] || mkdir [+module+]; \
8c90b13a
L
856 r=`${PWD_COMMAND}`; export r; \
857 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
4fc4dd12 858 $(HOST_EXPORTS) \
4977bab6
ZW
859 echo Configuring in [+module+]; \
860 cd [+module+] || exit 1; \
861 case $(srcdir) in \
862 \.) \
863 srcdiroption="--srcdir=."; \
864 libsrcdir=".";; \
865 /* | [A-Za-z]:[\\/]*) \
866 srcdiroption="--srcdir=$(srcdir)/[+module+]"; \
867 libsrcdir="$$s/[+module+]";; \
868 *) \
869 srcdiroption="--srcdir=../$(srcdir)/[+module+]"; \
870 libsrcdir="$$s/[+module+]";; \
871 esac; \
872 $(SHELL) $${libsrcdir}/configure \
a52a0a7f 873 $(HOST_CONFIGARGS) $${srcdiroption} [+extra_configure_flags+] \
4977bab6 874 || exit 1
60975492 875@endif [+module+]
95ddd785 876
4977bab6
ZW
877.PHONY: all-[+module+] maybe-all-[+module+]
878maybe-all-[+module+]:
60975492
PB
879@if [+module+]
880maybe-all-[+module+]: all-[+module+]
4977bab6 881all-[+module+]: configure-[+module+]
8c90b13a
L
882 @r=`${PWD_COMMAND}`; export r; \
883 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
3aa83176 884 $(SET_LIB_PATH) \
4fc4dd12 885 $(HOST_EXPORTS) \
3aa83176
NN
886 (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+
887 IF with_x
888 +] $(X11_FLAGS_TO_PASS)[+
a52a0a7f 889 ENDIF with_x +] [+extra_make_flags+] all)
60975492 890@endif [+module+]
4977bab6 891
7e2dbcef
NN
892.PHONY: check-[+module+] maybe-check-[+module+]
893maybe-check-[+module+]:
60975492
PB
894@if [+module+]
895maybe-check-[+module+]: check-[+module+]
4977bab6 896[+ IF no_check +]
4977bab6
ZW
897check-[+module+]:
898[+ ELIF no_check_cross +]
4977bab6
ZW
899# This module is only tested in a native toolchain.
900check-[+module+]:
e89fbdfe 901 @if [ '$(host)' = '$(target)' ] ; then \
8c90b13a
L
902 r=`${PWD_COMMAND}`; export r; \
903 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
95ddd785 904 $(SET_LIB_PATH) \
4fc4dd12 905 $(HOST_EXPORTS) \
88b5521b 906 (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+
4977bab6
ZW
907 IF with_x
908 +] $(X11_FLAGS_TO_PASS)[+
a52a0a7f 909 ENDIF with_x +] [+extra_make_flags+] check); \
3aa83176
NN
910 fi
911[+ ELSE check +]
3aa83176 912check-[+module+]:
8c90b13a
L
913 @r=`${PWD_COMMAND}`; export r; \
914 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
3aa83176 915 $(SET_LIB_PATH) \
4fc4dd12 916 $(HOST_EXPORTS) \
3aa83176
NN
917 (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+
918 IF with_x
919 +] $(X11_FLAGS_TO_PASS)[+
a52a0a7f 920 ENDIF with_x +] [+extra_make_flags+] check)
4977bab6 921[+ ENDIF no_check +]
60975492 922@endif [+module+]
4977bab6 923
4977bab6
ZW
924.PHONY: install-[+module+] maybe-install-[+module+]
925maybe-install-[+module+]:
60975492
PB
926@if [+module+]
927maybe-install-[+module+]: install-[+module+]
7e2dbcef 928[+ IF no_install +]
4977bab6
ZW
929install-[+module+]:
930[+ ELSE install +]
4977bab6 931install-[+module+]: installdirs
8c90b13a
L
932 @r=`${PWD_COMMAND}`; export r; \
933 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
3aa83176 934 $(SET_LIB_PATH) \
4fc4dd12 935 $(HOST_EXPORTS) \
3aa83176
NN
936 (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+
937 IF with_x
938 +] $(X11_FLAGS_TO_PASS)[+
a52a0a7f 939 ENDIF with_x +] [+extra_make_flags+] install)
4977bab6 940[+ ENDIF no_install +]
60975492 941@endif [+module+]
295f4e42
NN
942
943# Other targets (info, dvi, etc.)
944[+ FOR recursive_targets +]
945.PHONY: maybe-[+make_target+]-[+module+] [+make_target+]-[+module+]
946maybe-[+make_target+]-[+module+]:
60975492
PB
947@if [+module+]
948maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+]
295f4e42
NN
949[+ IF (match-value? = "missing" (get "make_target") ) +]
950# [+module+] doesn't support [+make_target+].
951[+make_target+]-[+module+]:
952[+ ELSE +]
953[+make_target+]-[+module+]: [+
954 FOR depend +]\
955 [+depend+]-[+module+] [+
956 ENDFOR depend +]
957 @[ -f ./[+module+]/Makefile ] || exit 0; \
958 r=`${PWD_COMMAND}`; export r; \
959 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
960 $(SET_LIB_PATH) \
4fc4dd12 961 $(HOST_EXPORTS) \
295f4e42
NN
962 for flag in $(EXTRA_HOST_FLAGS); do \
963 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
964 done; \
965 echo "Doing [+make_target+] in [+module+]" ; \
966 (cd [+module+] && \
967 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
968 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
969 "RANLIB=$${RANLIB}" \
970 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
a52a0a7f 971 [+extra_make_flags+] [+make_target+]) \
295f4e42
NN
972 || exit 1
973[+ ENDIF +]
60975492 974@endif [+module+]
295f4e42 975[+ ENDFOR recursive_targets +]
4977bab6
ZW
976[+ ENDFOR host_modules +]
977
978# ---------------------------------------
979# Modules which run on the target machine
980# ---------------------------------------
981[+ FOR target_modules +]
982.PHONY: configure-target-[+module+] maybe-configure-target-[+module+]
983maybe-configure-target-[+module+]:
60975492
PB
984@if target-[+module+]
985maybe-configure-target-[+module+]: configure-target-[+module+]
4977bab6 986
88b5521b
NN
987# There's only one multilib.out. Cleverer subdirs shouldn't need it copied.
988$(TARGET_SUBDIR)/[+module+]/multilib.out: multilib.out
b4acb5ef 989 $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/[+module+] ; \
ade82b16 990 rm -f $(TARGET_SUBDIR)/[+module+]/Makefile || : ; \
88b5521b 991 cp multilib.out $(TARGET_SUBDIR)/[+module+]/multilib.out
95ddd785 992
ade82b16
AO
993configure-target-[+module+]: $(TARGET_SUBDIR)/[+module+]/multilib.out
994 @test ! -f $(TARGET_SUBDIR)/[+module+]/Makefile || exit 0; \
b4acb5ef 995 $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/[+module+] ; \
8c90b13a
L
996 r=`${PWD_COMMAND}`; export r; \
997 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
4fc4dd12 998 $(SET_LIB_PATH) \[+
3aa83176 999IF raw_cxx +]
4fc4dd12 1000 $(RAW_CXX_TARGET_EXPORTS) \[+
3aa83176 1001ELSE normal_cxx +]
4fc4dd12 1002 $(NORMAL_TARGET_EXPORTS) \[+
3aa83176 1003ENDIF raw_cxx +]
3aa83176
NN
1004 echo Configuring in $(TARGET_SUBDIR)/[+module+]; \
1005 cd "$(TARGET_SUBDIR)/[+module+]" || exit 1; \
1006 case $(srcdir) in \
1007 /* | [A-Za-z]:[\\/]*) \
1008 topdir=$(srcdir) ;; \
1009 *) \
1010 case "$(TARGET_SUBDIR)" in \
95ddd785
NN
1011 .) topdir="../$(srcdir)" ;; \
1012 *) topdir="../../$(srcdir)" ;; \
3aa83176 1013 esac ;; \
2c4de30b 1014 esac; \[+ IF stage +]
3aa83176
NN
1015 if [ "$(srcdir)" = "." ] ; then \
1016 if [ "$(TARGET_SUBDIR)" != "." ] ; then \
1017 if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \
1018 if [ -f Makefile ]; then \
1019 if $(MAKE) distclean; then \
1020 true; \
1021 else \
1022 exit 1; \
1023 fi; \
95ddd785 1024 else \
3aa83176 1025 true; \
95ddd785 1026 fi; \
95ddd785 1027 else \
3aa83176 1028 exit 1; \
95ddd785 1029 fi; \
3aa83176
NN
1030 else \
1031 true; \
1032 fi; \
1033 srcdiroption="--srcdir=."; \
1034 libsrcdir="."; \
2c4de30b 1035 else \[+ ENDIF stage +]
3aa83176 1036 srcdiroption="--srcdir=$${topdir}/[+module+]"; \
2c4de30b
LR
1037 libsrcdir="$$s/[+module+]"; \[+ IF stage +]
1038 fi; \[+ ENDIF stage +]
3aa83176
NN
1039 rm -f no-such-file || : ; \
1040 CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
1041 $(TARGET_CONFIGARGS) $${srcdiroption} \
a52a0a7f 1042 --with-target-subdir="$(TARGET_SUBDIR)" [+extra_configure_flags+] \
3aa83176 1043 || exit 1
60975492 1044@endif target-[+module+]
4977bab6
ZW
1045
1046.PHONY: all-target-[+module+] maybe-all-target-[+module+]
1047maybe-all-target-[+module+]:
60975492
PB
1048@if target-[+module+]
1049maybe-all-target-[+module+]: all-target-[+module+]
4977bab6 1050all-target-[+module+]: configure-target-[+module+]
8c90b13a
L
1051 @r=`${PWD_COMMAND}`; export r; \
1052 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
4fc4dd12
DJ
1053 $(SET_LIB_PATH) \[+
1054IF raw_cxx +]
1055 $(RAW_CXX_TARGET_EXPORTS) \[+
1056ELSE normal_cxx +]
1057 $(NORMAL_TARGET_EXPORTS) \[+
1058ENDIF raw_cxx +]
3aa83176
NN
1059 (cd $(TARGET_SUBDIR)/[+module+] && \
1060 $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
1061 IF raw_cxx
1062 +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+
1063 ENDIF raw_cxx
a52a0a7f 1064 +] [+extra_make_flags+] all)
60975492 1065@endif target-[+module+]
7e2dbcef
NN
1066
1067.PHONY: check-target-[+module+] maybe-check-target-[+module+]
1068maybe-check-target-[+module+]:
60975492
PB
1069@if target-[+module+]
1070maybe-check-target-[+module+]: check-target-[+module+]
4977bab6
ZW
1071[+ IF no_check +]
1072# Dummy target for uncheckable module.
4977bab6
ZW
1073check-target-[+module+]:
1074[+ ELSE check +]
4977bab6 1075check-target-[+module+]:
8c90b13a
L
1076 @r=`${PWD_COMMAND}`; export r; \
1077 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
4fc4dd12
DJ
1078 $(SET_LIB_PATH) \[+
1079IF raw_cxx +]
1080 $(RAW_CXX_TARGET_EXPORTS) \[+
1081ELSE normal_cxx +]
1082 $(NORMAL_TARGET_EXPORTS) \[+
1083ENDIF raw_cxx +]
3aa83176
NN
1084 (cd $(TARGET_SUBDIR)/[+module+] && \
1085 $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
1086 IF raw_cxx
1087 +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+
1088 ENDIF raw_cxx
a52a0a7f 1089 +] [+extra_make_flags+] check)
4977bab6 1090[+ ENDIF no_check +]
60975492 1091@endif target-[+module+]
7e2dbcef 1092
4977bab6
ZW
1093.PHONY: install-target-[+module+] maybe-install-target-[+module+]
1094maybe-install-target-[+module+]:
60975492
PB
1095@if target-[+module+]
1096maybe-install-target-[+module+]: install-target-[+module+]
7e2dbcef 1097[+ IF no_install +]
4977bab6
ZW
1098# Dummy target for uninstallable.
1099install-target-[+module+]:
1100[+ ELSE install +]
4977bab6 1101install-target-[+module+]: installdirs
8c90b13a
L
1102 @r=`${PWD_COMMAND}`; export r; \
1103 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
4fc4dd12
DJ
1104 $(SET_LIB_PATH) \[+
1105IF raw_cxx +]
1106 $(RAW_CXX_TARGET_EXPORTS) \[+
1107ELSE normal_cxx +]
1108 $(NORMAL_TARGET_EXPORTS) \[+
1109ENDIF raw_cxx +]
3aa83176 1110 (cd $(TARGET_SUBDIR)/[+module+] && \
a52a0a7f 1111 $(MAKE) $(TARGET_FLAGS_TO_PASS) [+extra_make_flags+] install)
4977bab6 1112[+ ENDIF no_install +]
60975492 1113@endif target-[+module+]
295f4e42
NN
1114
1115# Other targets (info, dvi, etc.)
1116[+ FOR recursive_targets +]
1117.PHONY: maybe-[+make_target+]-target-[+module+] [+make_target+]-target-[+module+]
1118maybe-[+make_target+]-target-[+module+]:
60975492
PB
1119@if target-[+module+]
1120maybe-[+make_target+]-target-[+module+]: [+make_target+]-target-[+module+]
295f4e42
NN
1121[+ IF (match-value? = "missing" (get "make_target") ) +]
1122# [+module+] doesn't support [+make_target+].
1123[+make_target+]-target-[+module+]:
1124[+ ELSE +]
1125[+make_target+]-target-[+module+]: [+
1126 FOR depend +]\
1127 [+depend+]-target-[+module+] [+
1128 ENDFOR depend +]
1129 @[ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] || exit 0 ; \
1130 r=`${PWD_COMMAND}`; export r; \
1131 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
4fc4dd12
DJ
1132 $(SET_LIB_PATH) \[+
1133IF raw_cxx +]
1134 $(RAW_CXX_TARGET_EXPORTS) \[+
1135ELSE normal_cxx +]
1136 $(NORMAL_TARGET_EXPORTS) \[+
1137ENDIF raw_cxx +]
295f4e42
NN
1138 echo "Doing [+make_target+] in $(TARGET_SUBDIR)/[+module+]" ; \
1139 for flag in $(EXTRA_TARGET_FLAGS); do \
1140 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
1141 done; \
1142 (cd $(TARGET_SUBDIR)/[+module+] && \
1143 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
1144 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
1145 "RANLIB=$${RANLIB}" \
1146 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
a52a0a7f 1147 [+extra_make_flags+] [+make_target+]) \
295f4e42
NN
1148 || exit 1
1149[+ ENDIF +]
60975492 1150@endif target-[+module+]
295f4e42 1151[+ ENDFOR recursive_targets +]
4977bab6 1152[+ ENDFOR target_modules +]
95ddd785 1153
4977bab6
ZW
1154# ----------
1155# GCC module
1156# ----------
95ddd785 1157
4977bab6
ZW
1158# Unfortunately, while gcc _should_ be a host module,
1159# libgcc is a target module, and gen* programs are
1160# build modules. So GCC is a sort of hybrid.
95ddd785
NN
1161
1162# gcc is the only module which uses GCC_FLAGS_TO_PASS.
78a816a6
NN
1163# Don't use shared host config.cache, as it will confuse later
1164# directories; GCC wants slightly different values for some
1165# precious variables. *sigh*
2805b53a
NN
1166
1167# We must skip configuring if toplevel bootstrap is going.
4977bab6
ZW
1168.PHONY: configure-gcc maybe-configure-gcc
1169maybe-configure-gcc:
60975492
PB
1170@if gcc
1171maybe-configure-gcc: configure-gcc
ade82b16 1172configure-gcc:
f516a7da
PB
1173@endif gcc
1174@if gcc-no-bootstrap
ade82b16
AO
1175 @test ! -f gcc/Makefile || exit 0; \
1176 [ -d gcc ] || mkdir gcc; \
8c90b13a
L
1177 r=`${PWD_COMMAND}`; export r; \
1178 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
a52a0a7f 1179 $(HOST_EXPORTS) \
4977bab6
ZW
1180 echo Configuring in gcc; \
1181 cd gcc || exit 1; \
1182 case $(srcdir) in \
1183 \.) \
1184 srcdiroption="--srcdir=."; \
1185 libsrcdir=".";; \
1186 /* | [A-Za-z]:[\\/]*) \
1187 srcdiroption="--srcdir=$(srcdir)/gcc"; \
1188 libsrcdir="$$s/gcc";; \
1189 *) \
1190 srcdiroption="--srcdir=../$(srcdir)/gcc"; \
1191 libsrcdir="$$s/gcc";; \
1192 esac; \
1193 $(SHELL) $${libsrcdir}/configure \
2b6c260d 1194 $(HOST_CONFIGARGS) $${srcdiroption} \
4977bab6 1195 || exit 1
f516a7da 1196@endif gcc-no-bootstrap
4977bab6 1197
5ecf91d1
JM
1198# Don't 'make all' in gcc if it's already been made by 'bootstrap'; that
1199# causes trouble. This wart will be fixed eventually by moving
4977bab6
ZW
1200# the bootstrap behavior to this file.
1201.PHONY: all-gcc maybe-all-gcc
1202maybe-all-gcc:
60975492
PB
1203@if gcc
1204maybe-all-gcc: all-gcc
4977bab6 1205all-gcc: configure-gcc
f516a7da
PB
1206@endif gcc
1207@if gcc-no-bootstrap
2805b53a
NN
1208 r=`${PWD_COMMAND}`; export r; \
1209 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
f516a7da 1210 $(SET_LIB_PATH) \
a52a0a7f 1211 $(HOST_EXPORTS) \
f516a7da 1212 if [ -f gcc/stage_last ] ; then \
88b5521b 1213 (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) quickstrap); \
4977bab6 1214 else \
88b5521b 1215 (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
95ddd785
NN
1216 fi
1217
1218# Building GCC uses some tools for rebuilding "source" files
1219# like texinfo, bison/byacc, etc. So we must depend on those.
1220#
1221# While building GCC, it may be necessary to run various target
1222# programs like the assembler, linker, etc. So we depend on
1223# those too.
1224#
1225# In theory, on an SMP all those dependencies can be resolved
1226# in parallel.
1227#
1ca4c6e1
PE
1228GCC_STRAP_TARGETS = bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap
1229.PHONY: $(GCC_STRAP_TARGETS)
1230$(GCC_STRAP_TARGETS): all-bootstrap configure-gcc
8c90b13a
L
1231 @r=`${PWD_COMMAND}`; export r; \
1232 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
95ddd785 1233 $(SET_LIB_PATH) \
a52a0a7f 1234 $(HOST_EXPORTS) \
95ddd785
NN
1235 echo "Bootstrapping the compiler"; \
1236 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@
8c90b13a
L
1237 @r=`${PWD_COMMAND}`; export r; \
1238 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
95ddd785
NN
1239 case "$@" in \
1240 *bootstrap4-lean ) \
3aa83176
NN
1241 msg="Comparing stage3 and stage4 of the compiler"; \
1242 compare=compare3-lean ;; \
1243 *bootstrap4 ) \
1244 msg="Comparing stage3 and stage4 of the compiler"; \
1245 compare=compare3 ;; \
1246 *-lean ) \
1247 msg="Comparing stage2 and stage3 of the compiler"; \
1248 compare=compare-lean ;; \
1249 * ) \
1250 msg="Comparing stage2 and stage3 of the compiler"; \
1251 compare=compare ;; \
95ddd785
NN
1252 esac; \
1253 $(SET_LIB_PATH) \
a52a0a7f 1254 $(HOST_EXPORTS) \
95ddd785
NN
1255 echo "$$msg"; \
1256 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
8c90b13a
L
1257 @r=`${PWD_COMMAND}`; export r; \
1258 s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
95ddd785
NN
1259 $(SET_LIB_PATH) \
1260 echo "Building runtime libraries"; \
ad6717df 1261 $(MAKE) $(RECURSE_FLAGS_TO_PASS) all
95ddd785 1262
8f231b5d 1263profiledbootstrap: all-bootstrap configure-gcc
8c90b13a
L
1264 @r=`${PWD_COMMAND}`; export r; \
1265 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
8f231b5d 1266 $(SET_LIB_PATH) \
a52a0a7f 1267 $(HOST_EXPORTS) \
8f231b5d
JH
1268 echo "Bootstrapping the compiler"; \
1269 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build
8c90b13a
L
1270 @r=`${PWD_COMMAND}`; export r; \
1271 s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
8f231b5d
JH
1272 $(SET_LIB_PATH) \
1273 echo "Building runtime libraries and training compiler"; \
ad6717df 1274 $(MAKE) $(RECURSE_FLAGS_TO_PASS) all
8c90b13a
L
1275 @r=`${PWD_COMMAND}`; export r; \
1276 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
8f231b5d 1277 $(SET_LIB_PATH) \
a52a0a7f 1278 $(HOST_EXPORTS) \
8f231b5d
JH
1279 echo "Building feedback based compiler"; \
1280 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build
1281
95ddd785
NN
1282.PHONY: cross
1283cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
8c90b13a
L
1284 @r=`${PWD_COMMAND}`; export r; \
1285 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
95ddd785 1286 $(SET_LIB_PATH) \
a52a0a7f 1287 $(HOST_EXPORTS) \
95ddd785
NN
1288 echo "Building the C and C++ compiler"; \
1289 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
8c90b13a
L
1290 @r=`${PWD_COMMAND}`; export r; \
1291 s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
95ddd785
NN
1292 $(SET_LIB_PATH) \
1293 echo "Building runtime libraries"; \
ad6717df 1294 $(MAKE) $(RECURSE_FLAGS_TO_PASS) LANGUAGES="c c++" all
f516a7da 1295@endif gcc-no-bootstrap
95ddd785 1296
afc2b62d 1297.PHONY: check-gcc maybe-check-gcc
862fced8 1298maybe-check-gcc:
60975492
PB
1299@if gcc
1300maybe-check-gcc: check-gcc
95ddd785
NN
1301check-gcc:
1302 @if [ -f ./gcc/Makefile ] ; then \
8c90b13a
L
1303 r=`${PWD_COMMAND}`; export r; \
1304 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
95ddd785 1305 $(SET_LIB_PATH) \
a52a0a7f 1306 $(HOST_EXPORTS) \
88b5521b 1307 (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
95ddd785
NN
1308 else \
1309 true; \
1310 fi
1311
6248218a
JM
1312.PHONY: check-gcc-c++
1313check-gcc-c++:
95ddd785 1314 @if [ -f ./gcc/Makefile ] ; then \
8c90b13a
L
1315 r=`${PWD_COMMAND}`; export r; \
1316 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
95ddd785 1317 $(SET_LIB_PATH) \
a52a0a7f 1318 $(HOST_EXPORTS) \
88b5521b 1319 (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
95ddd785
NN
1320 else \
1321 true; \
6248218a
JM
1322 fi
1323
1324.PHONY: check-c++
333a28b4 1325check-c++: check-target-libstdc++-v3 check-gcc-c++
60975492 1326@endif gcc
95ddd785 1327
4977bab6
ZW
1328.PHONY: install-gcc maybe-install-gcc
1329maybe-install-gcc:
60975492
PB
1330@if gcc
1331maybe-install-gcc: install-gcc
95ddd785
NN
1332install-gcc:
1333 @if [ -f ./gcc/Makefile ] ; then \
8c90b13a
L
1334 r=`${PWD_COMMAND}`; export r; \
1335 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
95ddd785 1336 $(SET_LIB_PATH) \
a52a0a7f 1337 $(HOST_EXPORTS) \
88b5521b 1338 (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
95ddd785
NN
1339 else \
1340 true; \
1341 fi
60975492 1342@endif gcc
95ddd785 1343
4977bab6
ZW
1344# Install the gcc headers files, but not the fixed include files,
1345# which Cygnus is not allowed to distribute. This rule is very
1346# dependent on the workings of the gcc Makefile.in.
1347.PHONY: gcc-no-fixedincludes
1348gcc-no-fixedincludes:
1349 @if [ -f ./gcc/Makefile ]; then \
1350 rm -rf gcc/tmp-include; \
1351 mv gcc/include gcc/tmp-include 2>/dev/null; \
1352 mkdir gcc/include; \
1353 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
1354 touch gcc/stmp-fixinc gcc/include/fixed; \
1355 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
8c90b13a
L
1356 r=`${PWD_COMMAND}`; export r; \
1357 s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
95ddd785 1358 $(SET_LIB_PATH) \
a52a0a7f 1359 $(HOST_EXPORTS) \
88b5521b 1360 (cd ./gcc && \
4977bab6
ZW
1361 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1362 rm -rf gcc/include; \
1363 mv gcc/tmp-include gcc/include 2>/dev/null; \
1364 else true; fi
95ddd785 1365
295f4e42
NN
1366# Other targets (dvi, info, etc.)
1367[+ FOR recursive_targets +]
1368.PHONY: maybe-[+make_target+]-gcc [+make_target+]-gcc
1369maybe-[+make_target+]-gcc:
60975492
PB
1370@if gcc
1371maybe-[+make_target+]-gcc: [+make_target+]-gcc
295f4e42
NN
1372[+make_target+]-gcc: [+
1373 FOR depend +]\
1374 [+depend+]-gcc [+
1375 ENDFOR depend +]
1376 @[ -f ./gcc/Makefile ] || exit 0; \
1377 r=`${PWD_COMMAND}`; export r; \
1378 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1379 $(SET_LIB_PATH) \
1380 for flag in $(EXTRA_GCC_FLAGS); do \
1381 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
1382 done; \
a52a0a7f 1383 $(HOST_EXPORTS) \
295f4e42
NN
1384 echo "Doing [+make_target+] in gcc" ; \
1385 (cd gcc && \
1386 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
1387 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
1388 "RANLIB=$${RANLIB}" \
1389 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
1390 [+make_target+]) \
1391 || exit 1
60975492 1392@endif gcc
295f4e42
NN
1393
1394[+ ENDFOR recursive_targets +]
1395
f516a7da 1396@if gcc-bootstrap
2805b53a
NN
1397# ---------------------
1398# GCC bootstrap support
1399# ---------------------
1400
148907ea
PB
1401# We track the current stage (the one in 'gcc') in the stage_last file.
1402# We name the build directories for the various stages "stage1-gcc",
1403# "stage2-gcc","stage3-gcc", etc.
1404
1405# Since the 'compare' process will fail (on debugging information) if any
1406# directory names are different, we need to link the gcc directory for
1407# the previous stage to a constant name ('gcc-prev'), and to make the name of
1408# the build directories constant as well. For the latter, we use naked names
1409# like 'gcc', because the scripts in that directory assume it. We use
1410# mv on platforms where symlinks to directories do not work or are not
1411# reliable.
1412
1413# At the end of the bootstrap, a symlink to 'stage3-gcc' named 'gcc' must
1414# be kept, so that libraries can find it. Ick!
1415
1416# It would be best to preinstall gcc into a staging area (and in the
1417# future, gather there all prebootstrap packages). This would allow
1418# assemblers and linkers can be bootstrapped as well as the compiler
1419# (both in a combined tree, or separately). This however requires some
1420# change to the gcc driver, again in order to avoid comparison failures.
2805b53a
NN
1421
1422# Bugs: This is almost certainly not parallel-make safe.
1423
1424# 'touch' doesn't work right on some platforms.
1425STAMP = echo timestamp >
1426
1427# Only build the C compiler for stage1, because that is the only one that
1428# we can guarantee will build with the native compiler, and also it is the
1429# only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS),
1430# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them
1431# overrideable (for a bootstrap build stage1 also builds gcc.info).
1432
1433STAGE1_CFLAGS=@stage1_cflags@
1434STAGE1_LANGUAGES=@stage1_languages@
1435
148907ea
PB
1436# We only want to compare .o files, so set this!
1437objext = .o
2805b53a 1438
340de83f
NN
1439# Real targets act phony if they depend on phony targets; this hack
1440# prevents gratuitous rebuilding of stage 1.
1441prebootstrap:
ad6717df 1442 $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-bootstrap
340de83f
NN
1443 $(STAMP) prebootstrap
1444
2805b53a
NN
1445# Flags to pass to stage2 and later makes.
1446BOOT_CFLAGS= -g -O2
1447POSTSTAGE1_FLAGS_TO_PASS = \
ad6717df
PB
1448 CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
1449 STAGE_PREFIX=$$r/stage[+prev+]-gcc/ \
2805b53a 1450 CFLAGS="$(BOOT_CFLAGS)" \
7caf53cb 1451 ADAC="\$$(CC)"
2805b53a 1452
148907ea
PB
1453# For stage 1:
1454# * We force-disable intermodule optimizations, even if
1455# --enable-intermodule was passed, since the installed compiler probably
1456# can't handle them. Luckily, autoconf always respects
1457# the last argument when conflicting --enable arguments are passed.
1458# * Likewise, we force-disable coverage flags, since the installed compiler
1459# probably has never heard of them.
1460# * We build only C (and possibly Ada).
1461
1462[+ FOR bootstrap-stage +]
f516a7da 1463.PHONY: stage[+id+]-start stage[+id+]-end
148907ea 1464
ad6717df 1465stage[+id+]-start::
f516a7da 1466 [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
148907ea
PB
1467 echo stage[+id+] > stage_last ; \
1468 [ -d stage[+id+]-gcc ] || mkdir stage[+id+]-gcc; \
1469 set stage[+id+]-gcc gcc ; @CREATE_LINK_TO_DIR@ [+ IF prev +] ; \
1470 set stage[+prev+]-gcc prev-gcc ; @CREATE_LINK_TO_DIR@ [+ ENDIF prev +]
1471
ad6717df 1472stage[+id+]-end::
148907ea
PB
1473 rm -f stage_last ; \
1474 set gcc stage[+id+]-gcc ; @UNDO_LINK_TO_DIR@ [+ IF prev +] ; \
1475 set prev-gcc stage[+prev+]-gcc ; @UNDO_LINK_TO_DIR@ [+ ENDIF prev +]
1476
1477# Bubble a bugfix through all the stages up to stage [+id+]. They
1478# are remade, but not reconfigured. The next stage (if any) will not
1479# be reconfigured as well.
f516a7da 1480.PHONY: stage[+id+]-bubble
ad6717df 1481stage[+id+]-bubble:: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +]
148907ea
PB
1482 @if [ -f all-stage[+id+]-gcc ] ; then \
1483 echo Remaking stage [+id+] ; \
1484 rm -f all-stage[+id+]-gcc ; \
ad6717df
PB
1485 fi ; \
1486 $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage[+id+]-gcc
1487
1488[+ IF prev +]
1489stage[+prev+]-bubble::
1490 @if [ -f configure-stage[+id+]-gcc ] ; then \
1491 $(STAMP) configure-stage[+id+]-gcc ; \
148907ea 1492 fi
ad6717df 1493[+ ENDIF prev +]
148907ea
PB
1494
1495configure-stage[+id+]-gcc: [+ IF prev +] all-stage[+prev+]-gcc [+
1496 ELSE +] prebootstrap [+ ENDIF prev +]
f516a7da 1497 $(MAKE) stage[+id+]-start
148907ea
PB
1498 @if [ -f stage[+id+]-gcc/Makefile ] ; then \
1499 $(STAMP) configure-stage[+id+]-gcc ; \
2805b53a
NN
1500 exit 0; \
1501 else \
1502 true ; \
1503 fi ; \
2805b53a 1504 r=`${PWD_COMMAND}`; export r; \
4fc4dd12
DJ
1505 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \
1506 $(STAGE_HOST_EXPORTS) [+ ELSE prev +] \
a52a0a7f 1507 $(HOST_EXPORTS) [+ ENDIF prev +] \
148907ea 1508 echo Configuring stage [+id+] in gcc ; \
2805b53a
NN
1509 cd gcc || exit 1; \
1510 case $(srcdir) in \
1511 \.) \
1512 srcdiroption="--srcdir=."; \
1513 libsrcdir=".";; \
1514 /* | [A-Za-z]:[\\/]*) \
1515 srcdiroption="--srcdir=$(srcdir)/gcc"; \
1516 libsrcdir="$$s/gcc";; \
1517 *) \
1518 srcdiroption="--srcdir=../$(srcdir)/gcc"; \
1519 libsrcdir="$$s/gcc";; \
1520 esac; \
1521 $(SHELL) $${libsrcdir}/configure \
148907ea
PB
1522 $(HOST_CONFIGARGS) $${srcdiroption} \
1523 [+extra_configure_flags+] && \
1524 $(STAMP) ../configure-stage[+id+]-gcc
2805b53a 1525
148907ea 1526all-stage[+id+]-gcc: configure-stage[+id+]-gcc
f516a7da 1527 $(MAKE) stage[+id+]-start
148907ea 1528 @r=`${PWD_COMMAND}`; export r; \
4fc4dd12
DJ
1529 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \
1530 $(STAGE_HOST_EXPORTS) [+ ELSE prev +] \
a52a0a7f 1531 $(HOST_EXPORTS) [+ ENDIF prev +] \
2805b53a 1532 cd gcc && \
148907ea 1533 $(MAKE) $(GCC_FLAGS_TO_PASS) [+ IF prev +] \
ad6717df 1534 $(POSTSTAGE1_FLAGS_TO_PASS) [+ ENDIF prev +] \
148907ea 1535 [+extra_make_flags+] && $(STAMP) ../all-stage[+id+]-gcc
2805b53a 1536
148907ea
PB
1537[+ IF compare-target +]
1538[+compare-target+]: all-stage[+id+]-gcc
f516a7da 1539 [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
148907ea 1540 @r=`${PWD_COMMAND}`; export r; \
2805b53a
NN
1541 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1542 rm -f .bad_compare ; \
148907ea 1543 cd stage[+id+]-gcc; \
2805b53a
NN
1544 files=`find . -name "*$(objext)" -print` ; \
1545 cd .. ; \
1546 for file in $${files} ; do \
148907ea 1547 f1=$$r/stage[+prev+]-gcc/$$file; f2=$$r/stage[+id+]-gcc/$$file; \
a76494aa 1548 @do_compare@ > /dev/null 2>&1; \
2805b53a
NN
1549 test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \
1550 done ; \
1551 if [ -f .bad_compare ]; then \
1552 echo "Bootstrap comparison failure!"; \
1553 cat .bad_compare; \
1554 exit 1; \
1555 else \
1556 true; \
1557 fi ; \
148907ea
PB
1558 $(STAMP) [+compare-target+]
1559[+ ENDIF compare-target +]
1560
1561[+ IF bootstrap-target +]
1562.PHONY: [+bootstrap-target+]
1563[+bootstrap-target+]:
ad6717df 1564 $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage[+id+]-bubble [+
148907ea
PB
1565 IF compare-target +] [+compare-target+] [+
1566 ENDIF compare-target +] \
f516a7da 1567 stage[+id+]-start all stage[+id+]-end
148907ea
PB
1568[+ ENDIF bootstrap-target +]
1569
ad6717df 1570.PHONY: restage[+id+] touch-stage[+id+] distclean-stage[+id+]
148907ea 1571
ad6717df
PB
1572# Rules to wipe a stage and all the following ones, used for cleanstrap
1573[+ IF prev +]distclean-stage[+prev+]:: distclean-stage[+id+] [+ ENDIF prev +]
1574distclean-stage[+id+]::
f516a7da 1575 [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
148907ea
PB
1576 rm -rf configure-stage[+id+]-gcc all-stage[+id+]-gcc stage[+id+]-gcc [+
1577 IF compare-target +][+compare-target+] [+ ENDIF compare-target +]
1578
ad6717df
PB
1579# Rules to renew the timestamp on a stage and all the following ones
1580[+ IF prev +]touch-stage[+prev+]:: touch-stage[+id+] [+ ENDIF prev +]
1581touch-stage[+id+]::
1582 @[ -f configure-stage[+id+]-gcc ] && \
1583 echo '$(STAMP) configure-stage[+id+]-gcc' && \
1584 $(STAMP) configure-stage[+id+]-gcc; \
1585 [ -f all-stage[+id+]-gcc ] && \
1586 echo '$(STAMP) all-stage[+id+]-gcc' && \
1587 $(STAMP) all-stage[+id+]-gcc; \
1588 :
1589
1590# After building a stage, touch the following ones
1591[+ IF prev +]restage[+prev+]:: touch-stage[+id+] [+ ENDIF prev +]
1592restage[+id+]::
148907ea
PB
1593 rm -rf all-stage[+id+]-gcc [+
1594 IF compare-target +][+compare-target+] [+ ENDIF compare-target +]
ad6717df 1595 $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+
148907ea
PB
1596 IF compare-target +][+compare-target+] [+
1597 ELSE +] all-stage[+id+]-gcc [+ ENDIF compare-target +]
1598
1599[+ IF cleanstrap-target +]
1600.PHONY: [+cleanstrap-target+]
1601[+cleanstrap-target+]: distclean-stage1 [+bootstrap-target+]
1602[+ ENDIF cleanstrap-target +]
1603
1604[+ ENDFOR bootstrap-stage +]
ad6717df
PB
1605
1606stagefeedback-start::
1607 @r=`${PWD_COMMAND}`; export r; \
1608 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1609 cd stageprofile-gcc && \
1610 { find . -type d | sort | sed 's,.*,$(SHELL) '"$$s"'/mkinstalldirs "../gcc/&",' | $(SHELL); } && \
1611 { find . -name '*.*da' | sed 's,.*,$(LN) -f "&" "../gcc/&",' | $(SHELL); }
1612
1613profiledbootstrap: all-bootstrap configure-gcc
1614 @r=`${PWD_COMMAND}`; export r; \
1615 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1616 $(SET_LIB_PATH) \
a52a0a7f 1617 $(HOST_EXPORTS) \
ad6717df
PB
1618 echo "Bootstrapping the compiler"; \
1619 $(MAKE) stageprofile-bubble distclean-stagefeedback stageprofile-start
1620 @r=`${PWD_COMMAND}`; export r; \
1621 s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
1622 $(SET_LIB_PATH) \
1623 echo "Building runtime libraries and training compiler"; \
1624 $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
1625 @r=`${PWD_COMMAND}`; export r; \
1626 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1627 $(SET_LIB_PATH) \
a52a0a7f 1628 $(HOST_EXPORTS) \
ad6717df
PB
1629 echo "Building feedback based compiler"; \
1630 $(MAKE) stagefeedback-bubble stagefeedback-end
1631
f516a7da 1632@endif gcc-bootstrap
03a91701 1633
4977bab6
ZW
1634# --------------------------------------
1635# Dependencies between different modules
1636# --------------------------------------
1637
1638# There are two types of dependencies here: 'hard' dependencies, where one
1639# module simply won't build without the other; and 'soft' dependencies, where
1640# if the depended-on module is missing, the depending module will do without
1641# or find a substitute somewhere (perhaps installed). Soft dependencies
1642# are specified by depending on a 'maybe-' target. If you're not sure,
1643# it's safer to use a soft dependency.
1644
1645# Host modules specific to gcc.
1646# GCC needs to identify certain tools.
56694dd9
ZW
1647# GCC also needs the information exported by the intl configure script.
1648configure-gcc: maybe-configure-intl maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex
4f4e53dd
PB
1649all-gcc: maybe-all-libiberty maybe-all-intl maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib maybe-all-libbanshee maybe-all-libcpp
1650configure-libcpp: maybe-configure-libiberty maybe-configure-intl
1651all-libcpp: maybe-all-libiberty maybe-all-intl
4977bab6
ZW
1652# This is a slightly kludgy method of getting dependencies on
1653# all-build-libiberty correct; it would be better to build it every time.
4f4e53dd 1654all-gcc: maybe-all-build-libiberty
e11283f1 1655all-bootstrap: [+ FOR host_modules +][+ IF bootstrap +]maybe-all-[+module+] [+ ENDIF bootstrap +][+ ENDFOR host_modules +]
4977bab6
ZW
1656
1657# Host modules specific to gdb.
1658# GDB needs to know that the simulator is being built.
2c30ab71 1659configure-gdb: maybe-configure-itcl maybe-configure-tcl maybe-configure-tk maybe-configure-sim
0dffceed 1660GDB_TK = @GDB_TK@
4977bab6
ZW
1661all-gdb: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-mmalloc maybe-all-readline maybe-all-bison maybe-all-byacc maybe-all-sim $(gdbnlmrequirements) $(GDB_TK)
1662install-gdb: maybe-install-tcl maybe-install-tk maybe-install-itcl maybe-install-tix maybe-install-libgui
79308c5d 1663configure-libgui: maybe-configure-tcl maybe-configure-tk
4977bab6
ZW
1664all-libgui: maybe-all-tcl maybe-all-tk maybe-all-itcl
1665
1666# Host modules specific to binutils.
1667configure-bfd: configure-libiberty
1668all-bfd: maybe-all-libiberty maybe-all-intl
1669all-binutils: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-flex maybe-all-bison maybe-all-byacc maybe-all-intl
f5e0c73c
NN
1670# We put install-opcodes before install-binutils because the installed
1671# binutils might be on PATH, and they might need the shared opcodes
1672# library.
4977bab6 1673install-binutils: maybe-install-opcodes
c3969745
AS
1674# libopcodes depends on libbfd
1675install-opcodes: maybe-install-bfd
4977bab6
ZW
1676all-gas: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-intl
1677all-gprof: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-intl
1678all-ld: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-bison maybe-all-byacc maybe-all-flex maybe-all-intl
1679all-opcodes: maybe-all-bfd maybe-all-libiberty
1680
1681# Other host modules in the 'src' repository.
1682all-dejagnu: maybe-all-tcl maybe-all-expect maybe-all-tk
1683configure-expect: maybe-configure-tcl maybe-configure-tk
1684all-expect: maybe-all-tcl maybe-all-tk
1685configure-itcl: maybe-configure-tcl maybe-configure-tk
1686all-itcl: maybe-all-tcl maybe-all-tk
f5e0c73c
NN
1687# We put install-tcl before install-itcl because itcl wants to run a
1688# program on installation which uses the Tcl libraries.
4977bab6 1689install-itcl: maybe-install-tcl
ba49f6f1 1690all-sid: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-tcl maybe-all-tk
4977bab6
ZW
1691install-sid: maybe-install-tcl maybe-install-tk
1692all-sim: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-readline maybe-configure-gdb
1693configure-tk: maybe-configure-tcl
1694all-tk: maybe-all-tcl
1695configure-tix: maybe-configure-tcl maybe-configure-tk
1696all-tix: maybe-all-tcl maybe-all-tk
1697all-texinfo: maybe-all-libiberty
1698
1699# Other host modules. Warning, these are not well tested.
1700all-autoconf: maybe-all-m4 maybe-all-texinfo
1701all-automake: maybe-all-m4 maybe-all-texinfo
1702all-bison: maybe-all-texinfo
1703all-diff: maybe-all-libiberty
1704all-fastjar: maybe-all-zlib maybe-all-libiberty
1705all-fileutils: maybe-all-libiberty
1706all-flex: maybe-all-libiberty maybe-all-bison maybe-all-byacc
4977bab6
ZW
1707all-gzip: maybe-all-libiberty
1708all-hello: maybe-all-libiberty
1709all-m4: maybe-all-libiberty maybe-all-texinfo
f43e12ce 1710all-make: maybe-all-libiberty maybe-all-intl
4977bab6
ZW
1711all-patch: maybe-all-libiberty
1712all-prms: maybe-all-libiberty
1713all-recode: maybe-all-libiberty
1714all-sed: maybe-all-libiberty
1715all-send-pr: maybe-all-prms
4977bab6
ZW
1716all-tar: maybe-all-libiberty
1717all-uudecode: maybe-all-libiberty
1718
1719ALL_GCC = maybe-all-gcc
1720ALL_GCC_C = $(ALL_GCC) maybe-all-target-newlib maybe-all-target-libgloss
1721ALL_GCC_CXX = $(ALL_GCC_C) maybe-all-target-libstdc++-v3
1722
1723# Target modules specific to gcc.
1724configure-target-boehm-gc: $(ALL_GCC_C) maybe-configure-target-qthreads
1725configure-target-fastjar: maybe-configure-target-zlib
1726all-target-fastjar: maybe-all-target-zlib maybe-all-target-libiberty
d4cd9d81 1727configure-target-libada: $(ALL_GCC_C)
6de9cd9a 1728configure-target-libgfortran: $(ALL_GCC_C)
4977bab6
ZW
1729configure-target-libffi: $(ALL_GCC_C)
1730configure-target-libjava: $(ALL_GCC_C) maybe-configure-target-zlib maybe-configure-target-boehm-gc maybe-configure-target-qthreads maybe-configure-target-libffi
1731all-target-libjava: maybe-all-fastjar maybe-all-target-zlib maybe-all-target-boehm-gc maybe-all-target-qthreads maybe-all-target-libffi
1732configure-target-libobjc: $(ALL_GCC_C)
1733all-target-libobjc: maybe-all-target-libiberty
1734configure-target-libstdc++-v3: $(ALL_GCC_C)
1735all-target-libstdc++-v3: maybe-all-target-libiberty
1736configure-target-zlib: $(ALL_GCC_C)
95ddd785 1737
4977bab6
ZW
1738# Target modules in the 'src' repository.
1739configure-target-examples: $(ALL_GCC_C)
1740configure-target-libgloss: $(ALL_GCC)
1741all-target-libgloss: maybe-configure-target-newlib
2eb98e5d 1742configure-target-libiberty: $(ALL_GCC)
4977bab6
ZW
1743configure-target-libtermcap: $(ALL_GCC_C)
1744configure-target-newlib: $(ALL_GCC)
1745configure-target-rda: $(ALL_GCC_C)
1746configure-target-winsup: $(ALL_GCC_C)
1747all-target-winsup: maybe-all-target-libiberty maybe-all-target-libtermcap
95ddd785 1748
4977bab6
ZW
1749# Other target modules. Warning, these are not well tested.
1750configure-target-gperf: $(ALL_GCC_CXX)
1751all-target-gperf: maybe-all-target-libiberty maybe-all-target-libstdc++-v3
1752configure-target-qthreads: $(ALL_GCC_C)
95ddd785 1753
4977bab6
ZW
1754# Serialization dependencies. Host configures don't work well in parallel to
1755# each other, due to contention over config.cache. Target configures and
1756# build configures are similar.
1757@serialization_dependencies@
95ddd785 1758
4977bab6
ZW
1759# --------------------------------
1760# Regenerating top level configury
1761# --------------------------------
95ddd785 1762
88b5521b
NN
1763# Multilib.out tells target dirs what multilibs they should build.
1764# There is really only one copy. We use the 'timestamp' method to
1765# work around various timestamp bugs on some systems.
1766# We use move-if-change so that it's only considered updated when it
1767# actually changes, because it has to depend on a phony target.
ade82b16 1768multilib.out: maybe-all-gcc
8c90b13a 1769 @r=`${PWD_COMMAND}`; export r; \
88b5521b
NN
1770 echo "Checking multilib configuration..."; \
1771 $(CC_FOR_TARGET) --print-multi-lib > multilib.tmp 2> /dev/null ; \
1772 $(SHELL) $(srcdir)/move-if-change multilib.tmp multilib.out ; \
88b5521b 1773
95ddd785 1774# Rebuilding Makefile.in, using autogen.
e245b0ea 1775AUTOGEN = autogen
ee03dc5e 1776$(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def
e245b0ea 1777 cd $(srcdir) && $(AUTOGEN) Makefile.def
95ddd785 1778
671aa708 1779# Rebuilding Makefile.
e245b0ea
AO
1780Makefile: $(srcdir)/Makefile.in config.status
1781 CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
1782
1783config.status: configure $(gcc_version_trigger)
e75f9147 1784 CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck
95ddd785 1785
671aa708 1786# Rebuilding configure.
e245b0ea 1787AUTOCONF = autoconf
ee03dc5e 1788$(srcdir)/configure: @MAINT@ $(srcdir)/configure.in $(srcdir)/config/acx.m4
e245b0ea 1789 cd $(srcdir) && $(AUTOCONF)
95ddd785 1790
93c834b7
NN
1791# ------------------------------
1792# Special directives to GNU Make
1793# ------------------------------
1794
93c834b7
NN
1795# Don't pass command-line variables to submakes.
1796.NOEXPORT:
1797MAKEOVERRIDES=
1798
95ddd785 1799# end of Makefile.in
This page took 0.407677 seconds and 5 git commands to generate.