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