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