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