struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / cpp / Makefile.tpl
blob05742ee4e462ea1c51041f0f0851303654ab8853
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, 2008, 2009, 2010, 2011
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 ifeq (,$(.VARIABLES)) # The variable .VARIABLES, new with 3.80, is never empty.
30 $(error GNU make version 3.80 or newer is required.)
31 endif
33 # -------------------------------
34 # Standard Autoconf-set variables
35 # -------------------------------
36 VPATH=@srcdir@
38 build_alias=@build_noncanonical@
39 build_vendor=@build_vendor@
40 build_os=@build_os@
41 build=@build@
42 host_alias=@host_noncanonical@
43 host_vendor=@host_vendor@
44 host_os=@host_os@
45 host=@host@
46 target_alias=@target_noncanonical@
47 target_vendor=@target_vendor@
48 target_os=@target_os@
49 target=@target@
51 program_transform_name = @program_transform_name@
53 prefix = @prefix@
54 exec_prefix = @exec_prefix@
56 srcdir = @srcdir@
58 bindir = @bindir@
59 sbindir = @sbindir@
60 libexecdir = @libexecdir@
61 datadir = @datadir@
62 sysconfdir = @sysconfdir@
63 sharedstatedir = @sharedstatedir@
64 localstatedir = @localstatedir@
65 libdir = @libdir@
66 includedir = @includedir@
67 oldincludedir = @oldincludedir@
68 infodir = @infodir@
69 datarootdir = @datarootdir@
70 docdir = @docdir@
71 pdfdir = @pdfdir@
72 htmldir = @htmldir@
73 mandir = @mandir@
74 man1dir = $(mandir)/man1
75 man2dir = $(mandir)/man2
76 man3dir = $(mandir)/man3
77 man4dir = $(mandir)/man4
78 man5dir = $(mandir)/man5
79 man6dir = $(mandir)/man6
80 man7dir = $(mandir)/man7
81 man8dir = $(mandir)/man8
82 man9dir = $(mandir)/man9
84 INSTALL = @INSTALL@
85 INSTALL_PROGRAM = @INSTALL_PROGRAM@
86 INSTALL_SCRIPT = @INSTALL_SCRIPT@
87 INSTALL_DATA = @INSTALL_DATA@
88 LN = @LN@
89 LN_S = @LN_S@
90 MAINT = @MAINT@
91 MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
92 MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
94 # -------------------------------------------------
95 # Miscellaneous non-standard autoconf-set variables
96 # -------------------------------------------------
98 # The gcc driver likes to know the arguments it was configured with.
99 TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@
101 tooldir = @tooldir@
102 build_tooldir = @build_tooldir@
104 # This is the name of the environment variable used for the path to
105 # the libraries.
106 RPATH_ENVVAR = @RPATH_ENVVAR@
108 # On targets where RPATH_ENVVAR is PATH, a subdirectory of the GCC build path
109 # is used instead of the directory itself to avoid including built
110 # executables in PATH.
111 GCC_SHLIB_SUBDIR = @GCC_SHLIB_SUBDIR@
113 # If the build should make suitable code for shared host resources.
114 host_shared = @host_shared@
116 # Build programs are put under this directory.
117 BUILD_SUBDIR = @build_subdir@
118 # This is set by the configure script to the arguments to use when configuring
119 # directories built for the build system.
120 BUILD_CONFIGARGS = @build_configargs@ --with-build-subdir="$(BUILD_SUBDIR)"
122 # Linker flags to use on the host, for stage1 or when not
123 # bootstrapping.
124 STAGE1_LDFLAGS = @stage1_ldflags@
126 # Libraries to use on the host, for stage1 or when not bootstrapping.
127 STAGE1_LIBS = @stage1_libs@
129 # Linker flags to use for stage2 and later.
130 POSTSTAGE1_LDFLAGS = @poststage1_ldflags@
132 # Libraries to use for stage2 and later.
133 POSTSTAGE1_LIBS = @poststage1_libs@
135 # This is the list of variables to export in the environment when
136 # configuring any subdirectory.  It must also be exported whenever
137 # recursing into a build directory in case that directory's Makefile
138 # re-runs configure.
139 BASE_EXPORTS = \
140         FLEX="$(FLEX)"; export FLEX; \
141         LEX="$(LEX)"; export LEX; \
142         BISON="$(BISON)"; export BISON; \
143         YACC="$(YACC)"; export YACC; \
144         M4="$(M4)"; export M4; \
145         SED="$(SED)"; export SED; \
146         AWK="$(AWK)"; export AWK; \
147         MAKEINFO="$(MAKEINFO)"; export MAKEINFO;
149 # This is the list of variables to export in the environment when
150 # configuring subdirectories for the build system.
151 BUILD_EXPORTS = \
152         $(BASE_EXPORTS) \
153         AR="$(AR_FOR_BUILD)"; export AR; \
154         AS="$(AS_FOR_BUILD)"; export AS; \
155         CC="$(CC_FOR_BUILD)"; export CC; \
156         CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
157         CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
158         CPP="$(CPP_FOR_BUILD)"; export CPP; \
159         CPPFLAGS="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS; \
160         CXX="$(CXX_FOR_BUILD)"; export CXX; \
161         CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
162         GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
163         GOC="$(GOC_FOR_BUILD)"; export GOC; \
164         GOCFLAGS="$(GOCFLAGS_FOR_BUILD)"; export GOCFLAGS; \
165         GDC="$(GDC_FOR_BUILD)"; export GDC; \
166         GDCFLAGS="$(GDCFLAGS_FOR_BUILD)"; export GDCFLAGS; \
167         DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
168         DSYMUTIL="$(DSYMUTIL_FOR_BUILD)"; export DSYMUTIL; \
169         LD="$(LD_FOR_BUILD)"; export LD; \
170         LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
171         NM="$(NM_FOR_BUILD)"; export NM; \
172         RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
173         WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
174         WINDMC="$(WINDMC_FOR_BUILD)"; export WINDMC;
176 # These variables must be set on the make command line for directories
177 # built for the build system to override those in BASE_FLAGS_TO_PASS.
178 EXTRA_BUILD_FLAGS = \
179         CFLAGS="$(CFLAGS_FOR_BUILD)" \
180         LDFLAGS="$(LDFLAGS_FOR_BUILD)"
182 # This is the list of directories to built for the host system.
183 SUBDIRS = @configdirs@
184 TARGET_CONFIGDIRS = @target_configdirs@
185 # This is set by the configure script to the arguments to use when configuring
186 # directories built for the host system.
187 HOST_CONFIGARGS = @host_configargs@
188 # Host programs are put under this directory, which is . except if building
189 # with srcdir=..
190 HOST_SUBDIR = @host_subdir@
191 # This is the list of variables to export in the environment when
192 # configuring subdirectories for the host system.  We need to pass
193 # some to the GCC configure because of its hybrid host/target nature.
194 HOST_EXPORTS = \
195         $(BASE_EXPORTS) \
196         CC="$(CC)"; export CC; \
197         ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
198         CFLAGS="$(CFLAGS)"; export CFLAGS; \
199         CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
200         CXX="$(CXX)"; export CXX; \
201         CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
202         GFORTRAN="$(GFORTRAN)"; export GFORTRAN; \
203         GOC="$(GOC)"; export GOC; \
204         GDC="$(GDC)"; export GDC; \
205         AR="$(AR)"; export AR; \
206         AS="$(AS)"; export AS; \
207         CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
208         CPP_FOR_BUILD="$(CPP_FOR_BUILD)"; export CPP_FOR_BUILD; \
209         CPPFLAGS_FOR_BUILD="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS_FOR_BUILD; \
210         CXX_FOR_BUILD="$(CXX_FOR_BUILD)"; export CXX_FOR_BUILD; \
211         DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
212         DSYMUTIL="$(DSYMUTIL)"; export DSYMUTIL; \
213         LD="$(LD)"; export LD; \
214         LDFLAGS="$(STAGE1_LDFLAGS) $(LDFLAGS)"; export LDFLAGS; \
215         NM="$(NM)"; export NM; \
216         RANLIB="$(RANLIB)"; export RANLIB; \
217         WINDRES="$(WINDRES)"; export WINDRES; \
218         WINDMC="$(WINDMC)"; export WINDMC; \
219         OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
220         OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
221         OTOOL="$(OTOOL)"; export OTOOL; \
222         READELF="$(READELF)"; export READELF; \
223         AR_FOR_TARGET="$(AR_FOR_TARGET)"; export AR_FOR_TARGET; \
224         AS_FOR_TARGET="$(AS_FOR_TARGET)"; export AS_FOR_TARGET; \
225         DSYMUTIL_FOR_TARGET="$(DSYMUTIL_FOR_TARGET)"; export DSYMUTIL_FOR_TARGET; \
226         GCC_FOR_TARGET="$(GCC_FOR_TARGET)"; export GCC_FOR_TARGET; \
227         LD_FOR_TARGET="$(LD_FOR_TARGET)"; export LD_FOR_TARGET; \
228         NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \
229         OBJDUMP_FOR_TARGET="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP_FOR_TARGET; \
230         OBJCOPY_FOR_TARGET="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY_FOR_TARGET; \
231         OTOOL_FOR_TARGET="$(OTOOL_FOR_TARGET)"; export OTOOL_FOR_TARGET; \
232         RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \
233         READELF_FOR_TARGET="$(READELF_FOR_TARGET)"; export READELF_FOR_TARGET; \
234         TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
235         HOST_LIBS="$(STAGE1_LIBS)"; export HOST_LIBS; \
236         GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
237         GMPINC="$(HOST_GMPINC)"; export GMPINC; \
238         ISLLIBS="$(HOST_ISLLIBS)"; export ISLLIBS; \
239         ISLINC="$(HOST_ISLINC)"; export ISLINC; \
240         LIBELFLIBS="$(HOST_LIBELFLIBS)"; export LIBELFLIBS; \
241         LIBELFINC="$(HOST_LIBELFINC)"; export LIBELFINC; \
242         XGCC_FLAGS_FOR_TARGET="$(XGCC_FLAGS_FOR_TARGET)"; export XGCC_FLAGS_FOR_TARGET; \
243         $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
245 POSTSTAGE1_CXX_EXPORT = \
246         CXX='$(CXX)'; export CXX; \
247         CXX_FOR_BUILD='$(CXX_FOR_BUILD)'; export CXX_FOR_BUILD;
249 # Similar, for later GCC stages.
250 POSTSTAGE1_HOST_EXPORTS = \
251         $(HOST_EXPORTS) \
252         CC="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
253           -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ \
254           $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
255         CC_FOR_BUILD="$$CC"; export CC_FOR_BUILD; \
256         $(POSTSTAGE1_CXX_EXPORT) \
257         $(LTO_EXPORTS) \
258         GDC="$$r/$(HOST_SUBDIR)/prev-gcc/gdc$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/ \
259           -B$(build_tooldir)/bin/ $(GDCFLAGS_FOR_TARGET) \
260           -B$$r/prev-$(TARGET_SUBDIR)/libphobos/libdruntime/gcc \
261           -B$$r/prev-$(TARGET_SUBDIR)/libphobos/src \
262           -B$$r/prev-$(TARGET_SUBDIR)/libphobos/src/.libs \
263           -I$$r/prev-$(TARGET_SUBDIR)/libphobos/libdruntime -I$$s/libphobos/libdruntime \
264           -L$$r/prev-$(TARGET_SUBDIR)/libphobos/src/.libs \
265           -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
266           -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs"; \
267         export GDC; \
268         GDC_FOR_BUILD="$$GDC"; export GDC_FOR_BUILD; \
269         GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND; \
270         LDFLAGS="$(POSTSTAGE1_LDFLAGS) $(BOOT_LDFLAGS)"; export LDFLAGS; \
271         HOST_LIBS="$(POSTSTAGE1_LIBS)"; export HOST_LIBS;
273 # Target libraries are put under this directory:
274 TARGET_SUBDIR = @target_subdir@
275 # This is set by the configure script to the arguments to use when configuring
276 # directories built for the target.
277 TARGET_CONFIGARGS = @target_configargs@ --with-target-subdir="$(TARGET_SUBDIR)"
278 # This is the list of variables to export in the environment when
279 # configuring subdirectories for the target system.
280 BASE_TARGET_EXPORTS = \
281         $(BASE_EXPORTS) \
282         AR="$(AR_FOR_TARGET)"; export AR; \
283         AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \
284         CC="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
285         CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
286         CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
287         CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
288         CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
289         GFORTRAN="$(GFORTRAN_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GFORTRAN; \
290         GOC="$(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GOC; \
291         GDC="$(GDC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GDC; \
292         DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
293         DSYMUTIL="$(DSYMUTIL_FOR_TARGET)"; export DSYMUTIL; \
294         LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \
295         LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
296         LIPO="$(LIPO_FOR_TARGET)"; export LIPO; \
297         NM="$(COMPILER_NM_FOR_TARGET)"; export NM; \
298         OBJDUMP="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP; \
299         OBJCOPY="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY; \
300         OTOOL="$(OTOOL_FOR_TARGET)"; export OTOOL; \
301         RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
302         READELF="$(READELF_FOR_TARGET)"; export READELF; \
303         STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \
304         WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
305         WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \
306         $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
307         TARGET_CONFIGDIRS="$(TARGET_CONFIGDIRS)"; export TARGET_CONFIGDIRS;
309 RAW_CXX_TARGET_EXPORTS = \
310         $(BASE_TARGET_EXPORTS) \
311         CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
312         CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
314 NORMAL_TARGET_EXPORTS = \
315         $(BASE_TARGET_EXPORTS) \
316         CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
318 # Where to find GMP
319 HOST_GMPLIBS = @gmplibs@
320 HOST_GMPINC = @gmpinc@
322 # Where to find isl
323 HOST_ISLLIBS = @isllibs@
324 HOST_ISLINC = @islinc@
326 # Where to find libelf
327 HOST_LIBELFLIBS = @libelflibs@
328 HOST_LIBELFINC = @libelfinc@
330 # ----------------------------------------------
331 # Programs producing files for the BUILD machine
332 # ----------------------------------------------
334 SHELL = @SHELL@
336 # pwd command to use.  Allow user to override default by setting PWDCMD in
337 # the environment to account for automounters.  The make variable must not
338 # be called PWDCMD, otherwise the value set here is passed to make
339 # subprocesses and overrides the setting from the user's environment.
340 # Don't use PWD since it is a common shell environment variable and we
341 # don't want to corrupt it.
342 PWD_COMMAND = $${PWDCMD-pwd}
344 # compilers to use to create programs which must be run in the build
345 # environment.
346 AR_FOR_BUILD = @AR_FOR_BUILD@
347 AS_FOR_BUILD = @AS_FOR_BUILD@
348 CC_FOR_BUILD = @CC_FOR_BUILD@
349 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
350 CPP_FOR_BUILD = @CPP_FOR_BUILD@
351 CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@
352 CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@
353 CXX_FOR_BUILD = @CXX_FOR_BUILD@
354 DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@
355 DSYMUTIL_FOR_BUILD = @DSYMUTIL_FOR_BUILD@
356 GFORTRAN_FOR_BUILD = @GFORTRAN_FOR_BUILD@
357 GOC_FOR_BUILD = @GOC_FOR_BUILD@
358 GDC_FOR_BUILD = @GDC_FOR_BUILD@
359 LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
360 LD_FOR_BUILD = @LD_FOR_BUILD@
361 NM_FOR_BUILD = @NM_FOR_BUILD@
362 RANLIB_FOR_BUILD = @RANLIB_FOR_BUILD@
363 WINDMC_FOR_BUILD = @WINDMC_FOR_BUILD@
364 WINDRES_FOR_BUILD = @WINDRES_FOR_BUILD@
366 # Special variables passed down in EXTRA_GCC_FLAGS.  They are defined
367 # here so that they can be overridden by Makefile fragments.
368 BUILD_PREFIX = @BUILD_PREFIX@
369 BUILD_PREFIX_1 = @BUILD_PREFIX_1@
371 # Flags to pass to stage2 and later makes.  They are defined
372 # here so that they can be overridden by Makefile fragments.
373 BOOT_CFLAGS= -g -O2
374 BOOT_LDFLAGS=
375 BOOT_ADAFLAGS= -gnatpg
377 AWK = @AWK@
378 SED = @SED@
379 BISON = @BISON@
380 YACC = @YACC@
381 FLEX = @FLEX@
382 LEX = @LEX@
383 M4 = @M4@
384 MAKEINFO = @MAKEINFO@
385 EXPECT = @EXPECT@
386 RUNTEST = @RUNTEST@
388 AUTO_PROFILE = gcc-auto-profile -c 10000000
390 # This just becomes part of the MAKEINFO definition passed down to
391 # sub-makes.  It lets flags be given on the command line while still
392 # using the makeinfo from the object tree.
393 # (Default to avoid splitting info files by setting the threshold high.)
394 MAKEINFOFLAGS = --split-size=5000000
396 # ---------------------------------------------
397 # Programs producing files for the HOST machine
398 # ---------------------------------------------
400 AS = @AS@
401 AR = @AR@
402 AR_FLAGS = rc
403 CC = @CC@
404 CXX = @CXX@
405 DLLTOOL = @DLLTOOL@
406 DSYMUTIL = @DSYMUTIL@
407 LD = @LD@
408 LIPO = @LIPO@
409 NM = @NM@
410 OBJDUMP = @OBJDUMP@
411 OTOOL = @OTOOL@
412 RANLIB = @RANLIB@
413 READELF = @READELF@
414 STRIP = @STRIP@
415 WINDRES = @WINDRES@
416 WINDMC = @WINDMC@
418 GDC = @GDC@
419 GNATBIND = @GNATBIND@
420 GNATMAKE = @GNATMAKE@
422 CFLAGS = @CFLAGS@
423 LDFLAGS = @LDFLAGS@
424 LIBCFLAGS = $(CFLAGS)
425 CXXFLAGS = @CXXFLAGS@
426 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
427 GOCFLAGS = $(CFLAGS)
428 GDCFLAGS = $(CFLAGS)
430 # Pass additional PGO and LTO compiler options to the PGO build.
431 BUILD_CFLAGS = $(PGO_BUILD_CFLAGS) $(PGO_BUILD_LTO_CFLAGS)
432 override CFLAGS += $(BUILD_CFLAGS)
433 override CXXFLAGS += $(BUILD_CFLAGS)
435 # NB: Filter out any compiler options which may fail PGO training runs.
436 PGO_BUILD_TRAINING_CFLAGS:= \
437         $(filter-out -Werror=%,$(CFLAGS))
438 PGO_BUILD_TRAINING_CXXFLAGS:=\
439         $(filter-out -Werror=%,$(CXXFLAGS))
440 PGO_BUILD_TRAINING_CFLAGS:= \
441         $(filter-out -Wall,$(PGO_BUILD_TRAINING_CFLAGS))
442 PGO_BUILD_TRAINING_CXXFLAGS:= \
443         $(filter-out -Wall,$(PGO_BUILD_TRAINING_CXXFLAGS))
444 PGO_BUILD_TRAINING_CFLAGS:= \
445         $(filter-out -specs=%,$(PGO_BUILD_TRAINING_CFLAGS))
446 PGO_BUILD_TRAINING_CXXFLAGS:= \
447         $(filter-out -specs=%,$(PGO_BUILD_TRAINING_CXXFLAGS))
448 PGO_BUILD_TRAINING_FLAGS_TO_PASS = \
449         PGO_BUILD_TRAINING=yes \
450         CFLAGS_FOR_TARGET="$(PGO_BUILD_TRAINING_CFLAGS)" \
451         CXXFLAGS_FOR_TARGET="$(PGO_BUILD_TRAINING_CXXFLAGS)"
453 # Ignore "make check" errors in PGO training runs.
454 PGO_BUILD_TRAINING_MFLAGS = -i
456 # Additional PGO and LTO compiler options to use profiling data for the
457 # PGO build.
458 PGO_BUILD_USE_FLAGS_TO_PASS = \
459         PGO_BUILD_CFLAGS="@PGO_BUILD_USE_CFLAGS@" \
460         PGO_BUILD_LTO_CFLAGS="@PGO_BUILD_LTO_CFLAGS@"
462 CREATE_GCOV = create_gcov
464 TFLAGS =
466 # Defaults for all stages; some are overridden below.
468 STAGE_CFLAGS = $(BOOT_CFLAGS)
469 STAGE_TFLAGS = $(TFLAGS)
470 STAGE_CONFIGURE_FLAGS=@stage2_werror_flag@
472 [+ FOR bootstrap-stage +]
473 # Defaults for stage [+id+]; some are overridden below.
474 STAGE[+id+]_CFLAGS = $(STAGE_CFLAGS)
475 STAGE[+id+]_CXXFLAGS = $(CXXFLAGS)
476 STAGE[+id+]_TFLAGS = $(STAGE_TFLAGS)
477 STAGE[+id+]_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
478 [+ ENDFOR bootstrap-stage +]
480 # By default, C and C++ are the only stage1 languages, because they are the
481 # only ones we require to build with the bootstrap compiler, and also the
482 # only ones useful for building stage2.
484 STAGE1_CFLAGS = @stage1_cflags@
485 STAGE1_CHECKING = @stage1_checking@
486 STAGE1_LANGUAGES = @stage1_languages@
487 # * We force-disable intermodule optimizations, even if
488 #   --enable-intermodule was passed, since the installed compiler
489 #   probably can't handle them.  Luckily, autoconf always respects
490 #   the last argument when conflicting --enable arguments are passed.
491 # * Likewise, we force-disable coverage flags, since the installed
492 #   compiler probably has never heard of them.
493 # * We also disable -Wformat, since older GCCs don't understand newer %s.
494 STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
495           --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
496           --disable-build-format-warnings
498 # When using the slow stage1 compiler disable IL verification and forcefully
499 # enable it when using the stage2 compiler instead.  As we later compare
500 # stage2 and stage3 we are merely avoid doing redundant work, plus we apply
501 # checking when building all target libraries for release builds.
502 STAGE1_TFLAGS += -fno-checking
503 STAGE2_CFLAGS += -fno-checking
504 STAGE2_TFLAGS += -fno-checking
505 STAGE3_CFLAGS += -fchecking=1
506 STAGE3_TFLAGS += -fchecking=1
508 STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
509 STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
511 STAGEtrain_CFLAGS = $(filter-out -fchecking=1,$(STAGE3_CFLAGS))
512 STAGEtrain_TFLAGS = $(filter-out -fchecking=1,$(STAGE3_TFLAGS))
514 STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use -fprofile-reproducible=parallel-runs
515 STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS)
517 STAGEautoprofile_CFLAGS = $(STAGE2_CFLAGS) -g
518 STAGEautoprofile_TFLAGS = $(STAGE2_TFLAGS)
520 STAGEautofeedback_CFLAGS = $(STAGE3_CFLAGS)
521 STAGEautofeedback_TFLAGS = $(STAGE3_TFLAGS)
523 do-compare = @do_compare@
524 do-compare3 = $(do-compare)
526 # -----------------------------------------------
527 # Programs producing files for the TARGET machine
528 # -----------------------------------------------
530 AR_FOR_TARGET=@AR_FOR_TARGET@
531 AS_FOR_TARGET=@AS_FOR_TARGET@
532 CC_FOR_TARGET=$(STAGE_CC_WRAPPER) @CC_FOR_TARGET@
534 # If GCC_FOR_TARGET is not overriden on the command line, then this
535 # variable is passed down to the gcc Makefile, where it is used to
536 # build libgcc2.a.  We define it here so that it can itself be
537 # overridden on the command line.
538 GCC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCC_FOR_TARGET@
539 CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @CXX_FOR_TARGET@
540 RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@
541 GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@
542 GOC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GOC_FOR_TARGET@
543 GDC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GDC_FOR_TARGET@
544 DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
545 DSYMUTIL_FOR_TARGET=@DSYMUTIL_FOR_TARGET@
546 LD_FOR_TARGET=@LD_FOR_TARGET@
548 LIPO_FOR_TARGET=@LIPO_FOR_TARGET@
549 NM_FOR_TARGET=@NM_FOR_TARGET@
550 OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@
551 OBJCOPY_FOR_TARGET=@OBJCOPY_FOR_TARGET@
552 OTOOL_FOR_TARGET=@OTOOL_FOR_TARGET@
553 RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
554 READELF_FOR_TARGET=@READELF_FOR_TARGET@
555 STRIP_FOR_TARGET=@STRIP_FOR_TARGET@
556 WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@
557 WINDMC_FOR_TARGET=@WINDMC_FOR_TARGET@
559 COMPILER_AS_FOR_TARGET=@COMPILER_AS_FOR_TARGET@
560 COMPILER_LD_FOR_TARGET=@COMPILER_LD_FOR_TARGET@
561 COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_TARGET@
563 CFLAGS_FOR_TARGET = @CFLAGS_FOR_TARGET@
564 CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@
566 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
567 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
568 LDFLAGS_FOR_TARGET = @LDFLAGS_FOR_TARGET@
569 GOCFLAGS_FOR_TARGET = -O2 -g
570 GDCFLAGS_FOR_TARGET = -O2 -g
572 FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
573 SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
574 DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@
576 XGCC_FLAGS_FOR_TARGET = $(FLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)
578 # ------------------------------------
579 # Miscellaneous targets and flag lists
580 # ------------------------------------
582 # The first rule in the file had better be this one.  Don't put any above it.
583 # This lives here to allow makefile fragments to contain dependencies.
584 all:
586 #### host and target specific makefile fragments come in here.
587 ### @target_makefile_frag@
588 ### @alphaieee_frag@
589 ### @ospace_frag@
590 ### @host_makefile_frag@
593 # This is the list of directories that may be needed in RPATH_ENVVAR
594 # so that programs built for the target machine work.
595 TARGET_LIB_PATH = [+ FOR target_modules +][+
596   IF lib_path +]$(TARGET_LIB_PATH_[+module+])[+ ENDIF lib_path +][+
597   ENDFOR target_modules +]$(HOST_LIB_PATH_gcc)
598 [+ FOR target_modules +][+ IF lib_path +]
599 @if target-[+module+]
600 TARGET_LIB_PATH_[+module+] = $$r/$(TARGET_SUBDIR)/[+module+]/[+lib_path+]:
601 @endif target-[+module+]
602 [+ ENDIF lib_path +][+ ENDFOR target_modules +]
605 # This is the list of directories that may be needed in RPATH_ENVVAR
606 # so that programs built for the host machine work.
607 HOST_LIB_PATH = [+ FOR host_modules +][+
608   IF lib_path +]$(HOST_LIB_PATH_[+module+])[+ ENDIF lib_path +][+
609   ENDFOR host_modules +]
611 # Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch
612 HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc$(GCC_SHLIB_SUBDIR):$$r/$(HOST_SUBDIR)/prev-gcc$(GCC_SHLIB_SUBDIR):
614 [+ FOR host_modules +][+ IF lib_path +]
615 @if [+module+]
616 HOST_LIB_PATH_[+module+] = \
617   $$r/$(HOST_SUBDIR)/[+module+]/[+lib_path+]:[+ IF bootstrap
618   +]$$r/$(HOST_SUBDIR)/prev-[+module+]/[+lib_path+]:[+ ENDIF bootstrap +]
619 @endif [+module+]
620 [+ ENDIF lib_path +][+ ENDFOR host_modules +]
622 CXX_FOR_TARGET_FLAG_TO_PASS = \
623         "CXX_FOR_TARGET=$(CXX_FOR_TARGET)"
625 # Flags to pass down to all sub-makes. STAGE*FLAGS,
626 # MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them
627 # overrideable (for a bootstrap build stage1 also builds gcc.info).
628 BASE_FLAGS_TO_PASS =[+ FOR flags_to_pass +][+ IF optional +] \
629         "`echo '[+flag+]=$([+flag+])' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"[+ ELSE optional +] \
630         "[+flag+]=$([+flag+])"[+ ENDIF optional+][+ ENDFOR flags_to_pass +][+ FOR bootstrap-stage +] \
631         "STAGE[+id+]_CFLAGS=$(STAGE[+id+]_CFLAGS)" \
632         "STAGE[+id+]_CXXFLAGS=$(STAGE[+id+]_CXXFLAGS)" \
633         "STAGE[+id+]_GENERATOR_CFLAGS=$(STAGE[+id+]_GENERATOR_CFLAGS)" \
634         "STAGE[+id+]_TFLAGS=$(STAGE[+id+]_TFLAGS)"[+ ENDFOR bootstrap-stage +] \
635         $(CXX_FOR_TARGET_FLAG_TO_PASS) \
636         "TFLAGS=$(TFLAGS)" \
637         "CONFIG_SHELL=$(SHELL)" \
638         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
639         $(if $(LSAN_OPTIONS),"LSAN_OPTIONS=$(LSAN_OPTIONS)")
641 # We leave this in just in case, but it is not needed anymore.
642 RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS)
644 # Flags to pass down to most sub-makes, in which we're building with
645 # the host environment.
646 EXTRA_HOST_FLAGS = \
647         'AR=$(AR)' \
648         'AS=$(AS)' \
649         'CC=$(CC)' \
650         'CXX=$(CXX)' \
651         'DLLTOOL=$(DLLTOOL)' \
652         'DSYMUTIL=$(DSYMUTIL)' \
653         'GFORTRAN=$(GFORTRAN)' \
654         'GOC=$(GOC)' \
655         'GDC=$(GDC)' \
656         'LD=$(LD)' \
657         'LIPO=$(LIPO)' \
658         'NM=$(NM)' \
659         'OBJDUMP=$(OBJDUMP)' \
660         'OTOOL=$(OTOOL)' \
661         'RANLIB=$(RANLIB)' \
662         'READELF=$(READELF)' \
663         'STRIP=$(STRIP)' \
664         'WINDRES=$(WINDRES)' \
665         'WINDMC=$(WINDMC)' \
666         'CREATE_GCOV=$(CREATE_GCOV)'
668 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
670 # Flags to pass to stage1 or when not bootstrapping.
672 STAGE1_FLAGS_TO_PASS = \
673         LDFLAGS="$${LDFLAGS}" \
674         HOST_LIBS="$${HOST_LIBS}"
676 # Flags to pass to stage2 and later makes.
678 POSTSTAGE1_FLAGS_TO_PASS = \
679         CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
680         CXX="$${CXX}" CXX_FOR_BUILD="$${CXX_FOR_BUILD}" \
681         GDC="$${GDC}" GDC_FOR_BUILD="$${GDC_FOR_BUILD}" \
682         GNATBIND="$${GNATBIND}" \
683         LDFLAGS="$${LDFLAGS}" \
684         HOST_LIBS="$${HOST_LIBS}" \
685         $(LTO_FLAGS_TO_PASS) \
686         "`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
688 # Flags to pass down to makes which are built with the target environment.
689 # The double $ decreases the length of the command line; those variables
690 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.  The
691 # *_CFLAGS_FOR_TARGET variables are not passed down and most often empty,
692 # so we expand them here.
693 EXTRA_TARGET_FLAGS = \
694         'AR=$$(AR_FOR_TARGET)' \
695         'AS=$(COMPILER_AS_FOR_TARGET)' \
696         'CC=$$(CC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
697         'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
698         'CXX=$$(CXX_FOR_TARGET) -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
699          -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \
700          $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
701         'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
702         'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
703         'DSYMUTIL=$$(DSYMUTIL_FOR_TARGET)' \
704         'GFORTRAN=$$(GFORTRAN_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
705         'GOC=$$(GOC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
706         'GOCFLAGS=$$(GOCFLAGS_FOR_TARGET)' \
707         'GDC=$$(GDC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
708         'GDCFLAGS=$$(GDCFLAGS_FOR_TARGET)' \
709         'LD=$(COMPILER_LD_FOR_TARGET)' \
710         'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \
711         'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
712         'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
713         'NM=$(COMPILER_NM_FOR_TARGET)' \
714         'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \
715         'OBJCOPY=$$(OBJCOPY_FOR_TARGET)' \
716         'RANLIB=$$(RANLIB_FOR_TARGET)' \
717         'READELF=$$(READELF_FOR_TARGET)' \
718         'WINDRES=$$(WINDRES_FOR_TARGET)' \
719         'WINDMC=$$(WINDMC_FOR_TARGET)' \
720         'XGCC_FLAGS_FOR_TARGET=$(XGCC_FLAGS_FOR_TARGET)' \
721         'STAGE1_LDFLAGS=$$(POSTSTAGE1_LDFLAGS)' \
722         'STAGE1_LIBS=$$(POSTSTAGE1_LIBS)' \
723         "TFLAGS=$$TFLAGS"
725 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
727 # Flags to pass down to gcc.  gcc builds a library, libgcc.a, so it
728 # unfortunately needs the native compiler and the target ar and
729 # ranlib.
730 # If any variables are added here, they must be added to do-*, below.
731 # The BUILD_* variables are a special case, which are used for the gcc
732 # cross-building scheme.
733 EXTRA_GCC_FLAGS = \
734         "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
735         "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
736         "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
738 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS)
740 BUILD_CONFIG = @BUILD_CONFIG@
741 ifneq ($(BUILD_CONFIG),)
742 include $(foreach CONFIG, $(BUILD_CONFIG), $(srcdir)/config/$(CONFIG).mk)
743 endif
745 .PHONY: configure-host
746 configure-host: [+
747   FOR host_modules +] \
748     maybe-configure-[+module+][+
749   ENDFOR host_modules +]
750 .PHONY: configure-target
751 configure-target: [+
752   FOR target_modules +] \
753     maybe-configure-target-[+module+][+
754   ENDFOR target_modules +]
756 # The target built for a native non-bootstrap build.
757 .PHONY: all
759 # --enable-pgo-build enables the PGO build.
760 # 1. First build with -fprofile-generate.
761 # 2. Use "make maybe-check-*" to generate profiling data.
762 # 3. Use "make clean" to remove the previous build.
763 # 4. Rebuild with -fprofile-use.
764 all:
765         @: $(MAKE); $(unstage)
766         +@r=`${PWD_COMMAND}`; export r; \
767         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
768           $(MAKE) $(RECURSE_FLAGS_TO_PASS) \
769                 $(PGO_BUILD_GEN_FLAGS_TO_PASS) all-host all-target \
770         && :
772 .PHONY: all-build
773 [+ FOR build_modules +]
774 all-build: maybe-all-build-[+module+][+ ENDFOR build_modules +]
776 .PHONY: all-host
777 [+ FOR host_modules +][+ IF bootstrap +]
778 #@if [+module+]-no-bootstrap[+ ENDIF bootstrap +]
779 all-host: maybe-all-[+module+][+ IF bootstrap +]
780 #@endif [+module+]-no-bootstrap[+ ENDIF bootstrap +][+ ENDFOR host_modules +]
782 .PHONY: all-target
783 [+ FOR target_modules +][+ IF bootstrap +]
784 #@if target-[+module+]-no-bootstrap[+ ENDIF bootstrap +]
785 all-target: maybe-all-target-[+module+][+ IF bootstrap +]
786 #@endif target-[+module+]-no-bootstrap[+
787   ENDIF bootstrap +][+ ENDFOR target_modules +]
789 # Do a target for all the subdirectories.  A ``make do-X'' will do a
790 # ``make X'' in all subdirectories (because, in general, there is a
791 # dependency (below) of X upon do-X, a ``make X'' will also do this,
792 # but it may do additional work as well).
793 [+ FOR recursive_targets +]
794 .PHONY: do-[+make_target+]
795 do-[+make_target+]:
796         @: $(MAKE); $(unstage)
797         @r=`${PWD_COMMAND}`; export r; \
798         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
799         $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+make_target+]-host \
800           [+make_target+]-target
803 .PHONY: [+make_target+]-host
804 [+ FOR host_modules +]
805 [+make_target+]-host: maybe-[+make_target+]-[+module+][+ ENDFOR host_modules +]
807 .PHONY: [+make_target+]-target
808 [+ FOR target_modules +]
809 [+make_target+]-target: maybe-[+make_target+]-target-[+module+][+ ENDFOR target_modules +]
810 [+ ENDFOR recursive_targets +]
812 # Here are the targets which correspond to the do-X targets.
814 .PHONY: info installcheck dvi pdf html
815 .PHONY: install-info install-dvi install-pdf install-html
816 .PHONY: clean distclean mostlyclean maintainer-clean realclean
817 .PHONY: local-clean local-distclean local-maintainer-clean
818 info: do-info
819 installcheck: do-installcheck
820 dvi: do-dvi
821 pdf: do-pdf
822 html: do-html
824 # Make sure makeinfo is built before we do a `make info', if we're
825 # in fact building texinfo.
826 do-info: maybe-all-texinfo
828 install-info: do-install-info dir.info
829         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
830         if [ -f dir.info ]; then \
831           $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info; \
832         else true; fi
834 install-dvi: do-install-dvi
836 install-pdf: do-install-pdf
838 install-html: do-install-html
840 local-clean:
841         -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
843 local-distclean:
844         -rm -f Makefile config.status config.cache mh-frag mt-frag
845         -rm -f maybedep.tmp serdep.tmp stage_final
846         -if [ "$(TARGET_SUBDIR)" != "." ]; then \
847           rm -rf $(TARGET_SUBDIR); \
848         else true; fi
849         -rm -rf $(BUILD_SUBDIR)
850         -if [ "$(HOST_SUBDIR)" != "." ]; then \
851           rm -rf $(HOST_SUBDIR); \
852         else true; fi
853         -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
854         -rm -f texinfo/doc/Makefile texinfo/po/POTFILES
855         -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
856         -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null
857         -rmdir c++tools fastjar gcc gnattools gotools 2>/dev/null
858         -rmdir libcc1 libiberty texinfo zlib 2>/dev/null
859         -find . -name config.cache -exec rm -f {} \; \; 2>/dev/null
861 local-maintainer-clean:
862         @echo "This command is intended for maintainers to use;"
863         @echo "it deletes files that may require special tools to rebuild."
865 clean: do-clean local-clean
866 mostlyclean: do-mostlyclean local-clean
867 distclean: do-distclean local-clean local-distclean
868 maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean 
869 maintainer-clean: local-distclean
870 realclean: maintainer-clean
872 # Check target.
874 .PHONY: check do-check
875 check: do-check
877 # Only include modules actually being configured and built.
878 .PHONY: check-host
879 check-host: [+
880   FOR host_modules +] \
881     maybe-check-[+module+][+
882   ENDFOR host_modules +]
884 .PHONY: check-target
885 check-target: [+
886   FOR target_modules +] \
887     maybe-check-target-[+module+][+
888   ENDFOR target_modules +]
890 do-check:
891         @: $(MAKE); $(unstage)
892         @r=`${PWD_COMMAND}`; export r; \
893         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
894         $(MAKE) $(RECURSE_FLAGS_TO_PASS) check-host check-target
896 # Automated reporting of test results.
898 warning.log: build.log
899         $(srcdir)/contrib/warn_summary build.log > $@
901 mail-report.log:
902         if test x'$(BOOT_CFLAGS)' != x''; then \
903             BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
904         fi; \
905         $(srcdir)/contrib/test_summary -t >$@
906         chmod +x $@
907         echo If you really want to send e-mail, run ./$@ now
909 mail-report-with-warnings.log: warning.log
910         if test x'$(BOOT_CFLAGS)' != x''; then \
911             BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
912         fi; \
913         $(srcdir)/contrib/test_summary -t -i warning.log >$@
914         chmod +x $@
915         echo If you really want to send e-mail, run ./$@ now
917 # Local Vim config
919 $(srcdir)/.local.vimrc:
920         $(LN_S) contrib/vimrc $@
922 $(srcdir)/.lvimrc:
923         $(LN_S) contrib/vimrc $@
925 vimrc: $(srcdir)/.local.vimrc $(srcdir)/.lvimrc
927 .PHONY: vimrc
929 # clang-format config
931 $(srcdir)/.clang-format:
932         $(LN_S) contrib/clang-format $@
934 clang-format: $(srcdir)/.clang-format
936 .PHONY: clang-format
938 # Installation targets.
940 .PHONY: install uninstall
941 install:
942         @: $(MAKE); $(unstage)
943         @r=`${PWD_COMMAND}`; export r; \
944         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
945         $(MAKE) $(RECURSE_FLAGS_TO_PASS) installdirs install-host install-target
947 .PHONY: install-host-nogcc
948 install-host-nogcc: [+
949   FOR host_modules +][+ IF (not (= (get "module") "gcc")) +] \
950     maybe-install-[+module+][+ ENDIF +][+
951   ENDFOR host_modules +]
953 .PHONY: install-host
954 install-host: [+
955   FOR host_modules +] \
956     maybe-install-[+module+][+
957   ENDFOR host_modules +]
959 .PHONY: install-target
960 install-target: [+
961   FOR target_modules +] \
962     maybe-install-target-[+module+][+
963   ENDFOR target_modules +]
965 uninstall:
966         @echo "the uninstall target is not supported in this tree"
968 .PHONY: install.all
969 install.all: install-no-fixedincludes
970         @if [ -f ./gcc/Makefile ]; then \
971                 r=`${PWD_COMMAND}`; export r; \
972                 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
973                 $(HOST_EXPORTS) \
974                 (cd ./gcc && \
975                 $(MAKE) $(FLAGS_TO_PASS) install-headers); \
976         else \
977                 true; \
978         fi
980 # install-no-fixedincludes is used to allow the elaboration of binary packages
981 # suitable for distribution, where we cannot include the fixed system header
982 # files.
983 .PHONY: install-no-fixedincludes
984 install-no-fixedincludes: installdirs install-host-nogcc \
985         install-target gcc-install-no-fixedincludes
987 .PHONY: install-strip
988 install-strip:
989         @: $(MAKE); $(unstage)
990         @r=`${PWD_COMMAND}`; export r; \
991         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
992         $(MAKE) $(RECURSE_FLAGS_TO_PASS) installdirs install-strip-host install-strip-target
994 .PHONY: install-strip-host
995 install-strip-host: [+
996   FOR host_modules +] \
997     maybe-install-strip-[+module+][+
998   ENDFOR host_modules +]
1000 .PHONY: install-strip-target
1001 install-strip-target: [+
1002   FOR target_modules +] \
1003     maybe-install-strip-target-[+module+][+
1004   ENDFOR target_modules +]
1007 ### other supporting targets
1009 MAKEDIRS= \
1010         $(DESTDIR)$(prefix) \
1011         $(DESTDIR)$(exec_prefix)
1012 .PHONY: installdirs
1013 installdirs: mkinstalldirs
1014         $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
1016 dir.info: do-install-info
1017         if [ -f $(srcdir)/texinfo/gen-info-dir ]; then \
1018           $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new; \
1019           mv -f dir.info.new dir.info; \
1020         else true; \
1021         fi
1023 dist:
1024         @echo "Building a full distribution of this tree isn't done"
1025         @echo "via 'make dist'.  Check out the etc/ subdirectory" 
1027 etags tags: TAGS
1029 # Right now this just builds TAGS in each subdirectory.  emacs19 has the
1030 # ability to use several tags files at once, so there is probably no need
1031 # to combine them into one big TAGS file (like CVS 1.3 does).  We could
1032 # (if we felt like it) have this Makefile write a piece of elisp which
1033 # the user could load to tell emacs19 where all the TAGS files we just
1034 # built are.
1035 TAGS: do-TAGS
1037 # ------------------------------------
1038 # Macros for configure and all targets
1039 # ------------------------------------
1041 [+ DEFINE configure +]
1042 .PHONY: configure-[+prefix+][+module+] maybe-configure-[+prefix+][+module+]
1043 maybe-configure-[+prefix+][+module+]:
1044 @if [+prefix+][+module+]
1045 maybe-configure-[+prefix+][+module+]: configure-[+prefix+][+module+]
1046 configure-[+prefix+][+module+]: [+ IF bootstrap +][+ ELSE +]
1047         @: $(MAKE); $(unstage)[+ ENDIF bootstrap +]
1048         @r=`${PWD_COMMAND}`; export r; \
1049         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1050         [+ IF check_multilibs
1051         +]echo "Checking multilib configuration for [+module+]..."; \
1052         $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]; \
1053         $(CC_FOR_TARGET) --print-multi-lib > [+subdir+]/[+module+]/multilib.tmp 2> /dev/null; \
1054         if test -r [+subdir+]/[+module+]/multilib.out; then \
1055           if cmp -s [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; then \
1056             rm -f [+subdir+]/[+module+]/multilib.tmp; \
1057           else \
1058             rm -f [+subdir+]/[+module+]/Makefile; \
1059             mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
1060           fi; \
1061         else \
1062           mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
1063         fi; \
1064         [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \
1065         $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]; \
1066         [+exports+] [+extra_exports+] \
1067         echo Configuring in [+subdir+]/[+module+]; \
1068         cd "[+subdir+]/[+module+]" || exit 1; \
1069         case $(srcdir) in \
1070           /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
1071           *) topdir=`echo [+subdir+]/[+module+]/ | \
1072                 sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
1073         esac; \
1074         module_srcdir=[+? module_srcdir (get "module_srcdir") (get "module")+]; \
1075         [+ IF no-config-site +]rm -f no-such-file || : ; \
1076         CONFIG_SITE=no-such-file [+ ENDIF +]$(SHELL) \
1077           $$s/$$module_srcdir/configure \
1078           --srcdir=$${topdir}/$$module_srcdir \
1079           [+args+] --build=${build_alias} --host=[+host_alias+] \
1080           --target=[+target_alias+] [+extra_configure_flags+] \
1081           || exit 1
1082 @endif [+prefix+][+module+]
1084 [+ ENDDEF +]
1086 [+ DEFINE all +]
1087 .PHONY: all-[+prefix+][+module+] maybe-all-[+prefix+][+module+]
1088 maybe-all-[+prefix+][+module+]:
1089 @if [+prefix+][+module+]
1090 TARGET-[+prefix+][+module+]=[+
1091   IF all_target +][+all_target+][+ ELSE +]all[+ ENDIF all_target +]
1092 maybe-all-[+prefix+][+module+]: all-[+prefix+][+module+]
1093 all-[+prefix+][+module+]: configure-[+prefix+][+module+][+ IF bootstrap +][+ ELSE +]
1094         @: $(MAKE); $(unstage)[+ ENDIF bootstrap +]
1095         @r=`${PWD_COMMAND}`; export r; \
1096         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1097         [+exports+] [+extra_exports+] \
1098         (cd [+subdir+]/[+module+] && \
1099           $(MAKE) $(BASE_FLAGS_TO_PASS) [+args+] [+stage1_args+] [+extra_make_flags+] \
1100                 $(TARGET-[+prefix+][+module+]))
1101 @endif [+prefix+][+module+]
1103 [+ IF bootstrap +]
1104 [+ FOR bootstrap_stage +]
1105 .PHONY: all-stage[+id+]-[+prefix+][+module+] maybe-all-stage[+id+]-[+prefix+][+module+]
1106 .PHONY: clean-stage[+id+]-[+prefix+][+module+] maybe-clean-stage[+id+]-[+prefix+][+module+]
1107 maybe-all-stage[+id+]-[+prefix+][+module+]:
1108 maybe-clean-stage[+id+]-[+prefix+][+module+]:
1109 @if [+prefix+][+module+]-bootstrap
1110 maybe-all-stage[+id+]-[+prefix+][+module+]: all-stage[+id+]-[+prefix+][+module+]
1111 all-stage[+id+]: all-stage[+id+]-[+prefix+][+module+]
1112 TARGET-stage[+id+]-[+prefix+][+module+] = $(TARGET-[+prefix+][+module+])
1113 all-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
1114         @[ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start
1115         @r=`${PWD_COMMAND}`; export r; \
1116         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1117         TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
1118         [+exports+][+ IF prev +] \
1119         [+poststage1_exports+][+ ENDIF prev +] [+extra_exports+] \
1120         cd [+subdir+]/[+module+] && \
1121         [+autoprofile+] \
1122         $(MAKE) $(BASE_FLAGS_TO_PASS)[+ IF prefix +] \
1123                 CFLAGS="$(CFLAGS_FOR_TARGET)" \
1124                 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \
1125                 LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"[+ ELSE prefix +] \
1126                 CFLAGS="$(STAGE[+id+]_CFLAGS)" \
1127                 GENERATOR_CFLAGS="$(STAGE[+id+]_GENERATOR_CFLAGS)" \
1128                 CXXFLAGS="$(STAGE[+id+]_CXXFLAGS)"[+ IF prev +] \
1129                 LIBCFLAGS="$(STAGE[+id+]_CFLAGS)"[+ ELSE prev +] \
1130                 LIBCFLAGS="$(LIBCFLAGS)"[+ ENDIF prev +][+ ENDIF prefix +] \
1131                 CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
1132                 CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
1133                 LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
1134                 [+args+] [+IF prev +][+poststage1_args+][+ ELSE prev +] \
1135                 [+stage1_args+][+ ENDIF prev +] [+extra_make_flags+] \
1136                 TFLAGS="$(STAGE[+id+]_TFLAGS)" [+profile_data+] \
1137                 $(TARGET-stage[+id+]-[+prefix+][+module+])
1139 maybe-clean-stage[+id+]-[+prefix+][+module+]: clean-stage[+id+]-[+prefix+][+module+]
1140 clean-stage[+id+]: clean-stage[+id+]-[+prefix+][+module+]
1141 clean-stage[+id+]-[+prefix+][+module+]:
1142         @if [ $(current_stage) = stage[+id+] ]; then \
1143           [ -f [+subdir+]/[+module+]/Makefile ] || exit 0; \
1144         else \
1145           [ -f [+subdir+]/stage[+id+]-[+module+]/Makefile ] || exit 0; \
1146           $(MAKE) stage[+id+]-start; \
1147         fi; \
1148         cd [+subdir+]/[+module+] && \
1149         $(MAKE) [+args+] [+ IF prev +][+poststage1_args+][+ ELSE prev +] \
1150         [+stage1_args+][+ ENDIF prev +] [+extra_make_flags+] clean
1151 @endif [+prefix+][+module+]-bootstrap
1153 [+ ENDFOR bootstrap_stage +]
1154 [+ ENDIF bootstrap +]
1155 [+ ENDDEF +]
1157 # --------------------------------------
1158 # Modules which run on the build machine
1159 # --------------------------------------
1160 [+ FOR build_modules +]
1161 [+ configure prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)"
1162              host_alias=(get "host" "${build_alias}")
1163              target_alias=(get "target" "${target_alias}")
1164              args="$(BUILD_CONFIGARGS)" no-config-site=true +]
1166 [+ all prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)"
1167              args="$(EXTRA_BUILD_FLAGS)" +]
1168 [+ ENDFOR build_module +]
1170 # --------------------------------------
1171 # Modules which run on the host machine
1172 # --------------------------------------
1173 [+ FOR host_modules +]
1174 [+ configure prefix="" subdir="$(HOST_SUBDIR)"
1175              exports="$(HOST_EXPORTS)"
1176              poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)"
1177              host_alias=(get "host" "${host_alias}")
1178              target_alias=(get "target" "${target_alias}")
1179              args="$(HOST_CONFIGARGS)" +]
1181 [+ all prefix="" subdir="$(HOST_SUBDIR)"
1182        exports="$(HOST_EXPORTS)"
1183        poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)"
1184        args="$(EXTRA_HOST_FLAGS)"
1185        stage1_args="$(STAGE1_FLAGS_TO_PASS)"
1186        poststage1_args="$(POSTSTAGE1_FLAGS_TO_PASS)" +]
1188 .PHONY: check-[+module+] maybe-check-[+module+]
1189 maybe-check-[+module+]:
1190 @if [+module+]
1191 maybe-check-[+module+]: check-[+module+]
1192 [+ IF no_check +]
1193 check-[+module+]:
1194 [+ ELIF no_check_cross +]
1195 # This module is only tested in a native toolchain.
1196 check-[+module+]:
1197         @: $(MAKE); $(unstage)
1198         @if [ '$(host)' = '$(target)' ]; then \
1199           r=`${PWD_COMMAND}`; export r; \
1200           s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1201           $(HOST_EXPORTS) [+ IF bootstrap +]$(EXTRA_HOST_EXPORTS)[+
1202           ENDIF bootstrap +] \
1203           (cd $(HOST_SUBDIR)/[+module+] && \
1204             $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+][+
1205             IF bootstrap +] $(EXTRA_BOOTSTRAP_FLAGS)[+ ENDIF bootstrap +] check)
1206         fi
1207 [+ ELSE check +]
1208 check-[+module+]:
1209         @: $(MAKE); $(unstage)
1210         @r=`${PWD_COMMAND}`; export r; \
1211         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1212         $(HOST_EXPORTS) [+ IF bootstrap +]$(EXTRA_HOST_EXPORTS)[+
1213         ENDIF bootstrap +] \
1214         (cd $(HOST_SUBDIR)/[+module+] && \
1215           $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+][+
1216           IF bootstrap +] $(EXTRA_BOOTSTRAP_FLAGS)[+ ENDIF bootstrap +] check)
1217 [+ ENDIF no_check +]
1218 @endif [+module+]
1220 .PHONY: install-[+module+] maybe-install-[+module+]
1221 maybe-install-[+module+]:
1222 @if [+module+]
1223 maybe-install-[+module+]: install-[+module+]
1224 [+ IF no_install +]
1225 install-[+module+]:
1226 [+ ELSE install +]
1227 install-[+module+]: installdirs
1228         @: $(MAKE); $(unstage)
1229         @r=`${PWD_COMMAND}`; export r; \
1230         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1231         $(HOST_EXPORTS) \
1232         (cd $(HOST_SUBDIR)/[+module+] && \
1233           $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] install)
1234 [+ ENDIF no_install +]
1235 @endif [+module+]
1237 .PHONY: install-strip-[+module+] maybe-install-strip-[+module+]
1238 maybe-install-strip-[+module+]:
1239 @if [+module+]
1240 maybe-install-strip-[+module+]: install-strip-[+module+]
1241 [+ IF no_install +]
1242 install-strip-[+module+]:
1243 [+ ELSE install +]
1244 install-strip-[+module+]: installdirs
1245         @: $(MAKE); $(unstage)
1246         @r=`${PWD_COMMAND}`; export r; \
1247         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1248         $(HOST_EXPORTS) \
1249         (cd $(HOST_SUBDIR)/[+module+] && \
1250           $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] install-strip)
1251 [+ ENDIF no_install +]
1252 @endif [+module+]
1254 # Other targets (info, dvi, pdf, etc.)
1255 [+ FOR recursive_targets +]
1256 .PHONY: maybe-[+make_target+]-[+module+] [+make_target+]-[+module+]
1257 maybe-[+make_target+]-[+module+]:
1258 @if [+module+]
1259 maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+]
1260 [+ IF (match-value? = "missing" (get "make_target") ) +]
1261 # [+module+] doesn't support [+make_target+].
1262 [+make_target+]-[+module+]:
1263 [+ ELSE +]
1264 [+make_target+]-[+module+]: [+
1265   FOR depend +]\
1266     [+depend+]-[+module+] [+
1267   ENDFOR depend +]
1268         @[+ IF bootstrap +][+ ELSE +]: $(MAKE); $(unstage)
1269         @[+ ENDIF bootstrap +][ -f ./[+module+]/Makefile ] || exit 0; \
1270         r=`${PWD_COMMAND}`; export r; \
1271         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1272         $(HOST_EXPORTS) \
1273         for flag in $(EXTRA_HOST_FLAGS) [+extra_make_flags+]; do \
1274           eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
1275         done; \
1276         echo "Doing [+make_target+] in [+module+]"; \
1277         (cd $(HOST_SUBDIR)/[+module+] && \
1278           $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
1279                   "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
1280                   "RANLIB=$${RANLIB}" \
1281                   "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
1282                   [+make_target+]) \
1283           || exit 1
1284 [+ ENDIF +]
1285 @endif [+module+]
1286 [+ ENDFOR recursive_targets +]
1287 [+ ENDFOR host_modules +]
1289 # ---------------------------------------
1290 # Modules which run on the target machine
1291 # ---------------------------------------
1292 [+ FOR target_modules +]
1294 [+ IF raw_cxx +]
1295 [+ configure prefix="target-" subdir="$(TARGET_SUBDIR)"
1296              check_multilibs=true
1297              exports="$(RAW_CXX_TARGET_EXPORTS)"
1298              host_alias=(get "host" "${target_alias}")
1299              target_alias=(get "target" "${target_alias}")
1300              args="$(TARGET_CONFIGARGS)" no-config-site=true +]
1302 [+ all prefix="target-" subdir="$(TARGET_SUBDIR)"
1303        exports="$(RAW_CXX_TARGET_EXPORTS)"
1304        args="$(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'" +]
1305 [+ ELSE +]
1306 [+ configure prefix="target-" subdir="$(TARGET_SUBDIR)"
1307              check_multilibs=true
1308              exports="$(NORMAL_TARGET_EXPORTS)"
1309              host_alias=(get "host" "${target_alias}")
1310              target_alias=(get "target" "${target_alias}")
1311              args="$(TARGET_CONFIGARGS)" no-config-site=true +]
1313 [+ all prefix="target-" subdir="$(TARGET_SUBDIR)"
1314        exports="$(NORMAL_TARGET_EXPORTS)"
1315        args="$(EXTRA_TARGET_FLAGS)" +]
1316 [+ ENDIF +]
1318 .PHONY: check-target-[+module+] maybe-check-target-[+module+]
1319 maybe-check-target-[+module+]:
1320 @if target-[+module+]
1321 maybe-check-target-[+module+]: check-target-[+module+]
1322 [+ IF no_check +]
1323 # Dummy target for uncheckable module.
1324 check-target-[+module+]:
1325 [+ ELSE check +]
1326 check-target-[+module+]:
1327         @: $(MAKE); $(unstage)
1328         @r=`${PWD_COMMAND}`; export r; \
1329         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
1330 IF raw_cxx +]
1331         $(RAW_CXX_TARGET_EXPORTS) \[+
1332 ELSE normal_cxx +]
1333         $(NORMAL_TARGET_EXPORTS) \[+
1334 ENDIF raw_cxx +]
1335         (cd $(TARGET_SUBDIR)/[+module+] && \
1336           $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
1337             IF raw_cxx 
1338               +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ 
1339             ENDIF raw_cxx 
1340           +] [+extra_make_flags+] check)
1341 [+ ENDIF no_check +]
1342 @endif target-[+module+]
1344 .PHONY: install-target-[+module+] maybe-install-target-[+module+]
1345 maybe-install-target-[+module+]:
1346 @if target-[+module+]
1347 maybe-install-target-[+module+]: install-target-[+module+]
1348 [+ IF no_install +]
1349 # Dummy target for uninstallable.
1350 install-target-[+module+]:
1351 [+ ELSE install +]
1352 install-target-[+module+]: installdirs
1353         @: $(MAKE); $(unstage)
1354         @r=`${PWD_COMMAND}`; export r; \
1355         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
1356 IF raw_cxx +]
1357         $(RAW_CXX_TARGET_EXPORTS) \[+
1358 ELSE normal_cxx +]
1359         $(NORMAL_TARGET_EXPORTS) \[+
1360 ENDIF raw_cxx +]
1361         (cd $(TARGET_SUBDIR)/[+module+] && \
1362           $(MAKE) $(TARGET_FLAGS_TO_PASS) [+extra_make_flags+] install)
1363 [+ ENDIF no_install +]
1364 @endif target-[+module+]
1366 .PHONY: install-strip-target-[+module+] maybe-install-strip-target-[+module+]
1367 maybe-install-strip-target-[+module+]:
1368 @if target-[+module+]
1369 maybe-install-strip-target-[+module+]: install-strip-target-[+module+]
1370 [+ IF no_install +]
1371 # Dummy target for uninstallable.
1372 install-strip-target-[+module+]:
1373 [+ ELSE install +]
1374 install-strip-target-[+module+]: installdirs
1375         @: $(MAKE); $(unstage)
1376         @r=`${PWD_COMMAND}`; export r; \
1377         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
1378 IF raw_cxx +]
1379         $(RAW_CXX_TARGET_EXPORTS) \[+
1380 ELSE normal_cxx +]
1381         $(NORMAL_TARGET_EXPORTS) \[+
1382 ENDIF raw_cxx +]
1383         (cd $(TARGET_SUBDIR)/[+module+] && \
1384           $(MAKE) $(TARGET_FLAGS_TO_PASS) [+extra_make_flags+] install-strip)
1385 [+ ENDIF no_install +]
1386 @endif target-[+module+]
1388 # Other targets (info, dvi, pdf, etc.)
1389 [+ FOR recursive_targets +]
1390 .PHONY: maybe-[+make_target+]-target-[+module+] [+make_target+]-target-[+module+]
1391 maybe-[+make_target+]-target-[+module+]:
1392 @if target-[+module+]
1393 maybe-[+make_target+]-target-[+module+]: [+make_target+]-target-[+module+]
1394 [+ IF (match-value? = "missing" (get "make_target") ) +]
1395 # [+module+] doesn't support [+make_target+].
1396 [+make_target+]-target-[+module+]:
1397 [+ ELSE +]
1398 [+make_target+]-target-[+module+]: [+
1399   FOR depend +]\
1400     [+depend+]-target-[+module+] [+
1401   ENDFOR depend +]
1402         @: $(MAKE); $(unstage)
1403         @[ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] || exit 0; \
1404         r=`${PWD_COMMAND}`; export r; \
1405         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
1406 IF raw_cxx +]
1407         $(RAW_CXX_TARGET_EXPORTS) \[+
1408 ELSE normal_cxx +]
1409         $(NORMAL_TARGET_EXPORTS) \[+
1410 ENDIF raw_cxx +]
1411         echo "Doing [+make_target+] in $(TARGET_SUBDIR)/[+module+]"; \
1412         for flag in $(EXTRA_TARGET_FLAGS); do \
1413           eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
1414         done; \
1415         (cd $(TARGET_SUBDIR)/[+module+] && \
1416           $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
1417                   "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
1418                   "RANLIB=$${RANLIB}" \
1419                   "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
1420                   [+extra_make_flags+] [+make_target+]) \
1421           || exit 1
1422 [+ ENDIF +]
1423 @endif target-[+module+]
1424 [+ ENDFOR recursive_targets +]
1425 [+ ENDFOR target_modules +]
1427 @if target-libgomp
1428 .PHONY: check-target-libgomp-c++
1429 check-target-libgomp-c++:
1430         $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) c++.exp" check-target-libgomp
1432 .PHONY: check-target-libgomp-fortran
1433 check-target-libgomp-fortran:
1434         $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) fortran.exp" check-target-libgomp
1436 @endif target-libgomp
1438 @if target-libitm
1439 .PHONY: check-target-libitm-c++
1440 check-target-libitm-c++:
1441         $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) c++.exp" check-target-libitm
1443 @endif target-libitm
1445 # ----------
1446 # GCC module
1447 # ----------
1449 .PHONY: cross
1450 cross: all-build all-gas all-ld
1451         @r=`${PWD_COMMAND}`; export r; \
1452         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1453         $(HOST_EXPORTS) \
1454         echo "Building the C and C++ compiler"; \
1455         cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
1456         @r=`${PWD_COMMAND}`; export r; \
1457         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1458         echo "Building runtime libraries"; \
1459         $(MAKE) $(RECURSE_FLAGS_TO_PASS) LANGUAGES="c c++" all
1461 [+ FOR languages +]
1462 .PHONY: check-gcc-[+language+] check-[+language+]
1463 check-gcc-[+language+]:
1464         r=`${PWD_COMMAND}`; export r; \
1465         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1466         $(HOST_EXPORTS) \
1467         (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) [+gcc-check-target+]);
1468 check-[+language+]: check-gcc-[+language+][+ FOR lib-check-target +] [+ lib-check-target +][+ ENDFOR lib-check-target +]
1469 [+ ENDFOR languages +]
1471 # The gcc part of install-no-fixedincludes, which relies on an intimate
1472 # knowledge of how a number of gcc internal targets (inter)operate.  Delegate.
1473 .PHONY: gcc-install-no-fixedincludes
1474 gcc-install-no-fixedincludes:
1475         @if [ -f ./gcc/Makefile ]; then \
1476           r=`${PWD_COMMAND}`; export r; \
1477           s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1478           $(HOST_EXPORTS) \
1479           (cd ./gcc \
1480            && $(MAKE) $(GCC_FLAGS_TO_PASS) install-no-fixedincludes); \
1481         else true; fi
1483 # ---------------------
1484 # GCC bootstrap support
1485 # ---------------------
1487 # We track the current stage (the one in 'gcc') in the stage_current file.
1488 # stage_last instead tracks the stage that was built last.  These targets
1489 # are dummy when toplevel bootstrap is not active.
1491 # While making host and target tools, symlinks to the final stage must be
1492 # there, so $(unstage) should be run at various points.  To avoid excessive
1493 # recursive invocations of make, we "inline" them using a variable.  These
1494 # must be referenced as ": $(MAKE) ; $(unstage)" rather than "$(unstage)"
1495 # to avoid warnings from the GNU Make job server.
1497 unstage = :
1498 stage = :
1499 current_stage = ""
1501 .PHONY: unstage stage
1502 unstage:
1503         @: $(MAKE); $(unstage)
1504 stage:
1505         @: $(MAKE); $(stage)
1507 # Disable commands for lean bootstrap.
1508 LEAN = false
1510 # We name the build directories for the various stages "stage1-gcc",
1511 # "stage2-gcc","stage3-gcc", etc.
1513 # Since the 'compare' process will fail (on debugging information) if any
1514 # directory names are different, we need to link the gcc directory for
1515 # the previous stage to a constant name ('prev-gcc'), and to make the name of
1516 # the build directories constant as well. For the latter, we use naked names
1517 # like 'gcc', because the scripts in that directory assume it.  We use
1518 # mv on platforms where symlinks to directories do not work or are not
1519 # reliable.
1521 # 'touch' doesn't work right on some platforms.
1522 STAMP = echo timestamp > 
1524 # We only want to compare .o files, so set this!
1525 objext = .o
1527 [+ FOR bootstrap-stage +]
1528 .PHONY: stage[+id+]-start stage[+id+]-end
1530 stage[+id+]-start::
1531         @: $(MAKE); $(stage); \
1532         echo stage[+id+] > stage_current; \
1533         echo stage[+id+] > stage_last; \
1534         $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)[+
1535    FOR host_modules +][+ IF bootstrap +]
1536 @if [+ module +]
1537         @cd $(HOST_SUBDIR); [ -d stage[+id+]-[+module+] ] || \
1538           mkdir stage[+id+]-[+module+]; \
1539         mv stage[+id+]-[+module+] [+module+][+ IF prev +]; \
1540         mv stage[+prev+]-[+module+] prev-[+module+] || test -f stage[+prev+]-lean [+ ENDIF prev +]
1541 @endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
1542         @[ -d stage[+id+]-$(TARGET_SUBDIR) ] || \
1543           mkdir stage[+id+]-$(TARGET_SUBDIR); \
1544         mv stage[+id+]-$(TARGET_SUBDIR) $(TARGET_SUBDIR)[+ IF prev +]; \
1545         mv stage[+prev+]-$(TARGET_SUBDIR) prev-$(TARGET_SUBDIR) || test -f stage[+prev+]-lean [+ ENDIF prev +]
1547 stage[+id+]-end:: [+ FOR host_modules +][+ IF bootstrap +]
1548 @if [+ module +]
1549         @if test -d $(HOST_SUBDIR)/[+module+]; then \
1550           cd $(HOST_SUBDIR); mv [+module+] stage[+id+]-[+module+][+ IF prev +]; \
1551           mv prev-[+module+] stage[+prev+]-[+module+]; : [+ ENDIF prev +]; \
1552         fi
1553 @endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
1554         @if test -d $(TARGET_SUBDIR); then \
1555           mv $(TARGET_SUBDIR) stage[+id+]-$(TARGET_SUBDIR)[+ IF prev +]; \
1556           mv prev-$(TARGET_SUBDIR) stage[+prev+]-$(TARGET_SUBDIR); : [+ ENDIF prev +]; \
1557         fi
1558         rm -f stage_current
1560 # Bubble a bug fix through all the stages up to stage [+id+].  They are
1561 # remade, but not reconfigured.  The next stage (if any) will not be
1562 # reconfigured either.
1563 .PHONY: stage[+id+]-bubble
1564 stage[+id+]-bubble:: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +]
1565         @r=`${PWD_COMMAND}`; export r; \
1566         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1567         if test -f stage[+id+]-lean [+
1568           IF prev +]|| test -f stage[+prev+]-lean [+ ENDIF prev +]; then \
1569           echo Skipping rebuild of stage[+id+]; \
1570         else \
1571           $(MAKE) stage[+id+]-start; \[+IF lean +]
1572           if $(LEAN); then \
1573             rm -rf stage[+lean+]-*; \
1574             $(STAMP) stage[+lean+]-lean; \
1575           fi; \[+ ENDIF lean +]
1576           $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage[+id+]; \
1577         fi[+ IF compare-target +]
1578         $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+compare-target+][+ ENDIF compare-target +]
1580 .PHONY: all-stage[+id+] clean-stage[+id+]
1581 do-clean: clean-stage[+id+]
1583 # FIXME: Will not need to be conditional when toplevel bootstrap is the
1584 # only possibility, but now it conflicts with no-bootstrap rules
1586 [+ ENDFOR bootstrap-stage +]
1588 stageprofile-end::
1589         $(MAKE) distclean-stagefeedback
1591 stagefeedback-start::
1592         @r=`${PWD_COMMAND}`; export r; \
1593         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1594         for i in prev-*; do \
1595           j=`echo $$i | sed s/^prev-//`; \
1596           cd $$r/$$i && \
1597           { find . -type d | sort | sed 's,.*,$(SHELL) '"$$s"'/mkinstalldirs "../'$$j'/&",' | $(SHELL); } && \
1598           { find . -name '*.*da' | sed 's,.*,$(LN) -f "&" "../'$$j'/&",' | $(SHELL); }; \
1599         done
1602 # --------------------------------------
1603 # Dependencies between different modules
1604 # --------------------------------------
1606 [+ FOR target_modules +]
1607 configure-target-[+module+]: maybe-all-gcc[+
1608   ENDFOR target_modules +]
1611 # There are two types of dependencies here: 'hard' dependencies, where one
1612 # module simply won't build without the other; and 'soft' dependencies, where
1613 # if the depended-on module is missing, the depending module will do without
1614 # or find a substitute somewhere (perhaps installed).  Soft dependencies
1615 # are made here to depend on a 'maybe-' target.  If you're not sure,
1616 # it's safer to use a soft dependency.
1618 [+ ;; These Scheme functions build the bulk of the dependencies.
1619    ;; dep-target builds a string like "maybe-all-MODULE_KIND-gcc",
1620    ;; where "maybe-" is only included if HARD is not true, and all-gcc
1621    ;; is taken from VAR-NAME.
1622    (define dep-target (lambda (module-kind var-name hard)
1623       (string-append
1624          (if hard "" "maybe-")
1625          (dep-subtarget var-name)
1626          module-kind
1627          (dep-module var-name)
1628       )))
1630    ;; make-dep builds a dependency from the MODULE and ON AutoGen vars.
1631    (define make-dep (lambda (module-kind on-kind)
1632       (string-append
1633          (dep-target module-kind "module" #t) ": "
1634          (dep-target on-kind "on" (exist? "hard")))))
1636    ;; dep-subtarget extracts everything up to the first dash in the given
1637    ;; AutoGen variable, for example it extracts "all-" out of "all-gcc".
1638    (define dep-subtarget (lambda (var-name)
1639       (substring (get var-name) 0 (+ 1 (string-index (get var-name) #\-)))))
1641    ;; dep-module extracts everything up to the first dash in the given
1642    ;; AutoGen variable, for example it extracts "gcc" out of "all-gcc".
1643    (define dep-module (lambda (var-name)
1644       (substring (get var-name) (+ 1 (string-index (get var-name) #\-)))))
1646    ;; dep-stage builds a string for the prefix of a bootstrap stage.
1647    (define dep-stage (lambda ()
1648       (string-append
1649          "stage"
1650          (get "id")
1651          "-")))
1653    ;; dep-maybe is the same as the AutoGen expression "- hard 'maybe-'"
1654    ;; but is written in Scheme.
1655    (define dep-maybe (lambda ()
1656       (if (exist? "hard") "" "maybe-")))
1658    ;; dep-kind returns returns "prebootstrap" for configure or build
1659    ;; dependencies of bootstrapped modules on a build module
1660    ;; (e.g. all-gcc on all-build-bison); "normal" if the dependency is
1661    ;; on an "install" target, or if the dependence module is not
1662    ;; bootstrapped; otherwise, it returns "bootstrap" or
1663    ;; "postbootstrap" depending on whether the dependent module is
1664    ;; bootstrapped.  All this is only necessary for host and target
1665    ;; modules.  It might seem like, in order to avoid build races, we
1666    ;; might need more elaborate detection between prebootstrap and
1667    ;; postbootstrap modules, but there are no host prebootstrap
1668    ;; modules.  If there were any non-bootstrap host modules that
1669    ;; bootstrap modules depended on, we'd get unsatisfied per-stage
1670    ;; dependencies on them, which would be immediately noticed.
1671    (define dep-kind (lambda ()
1672       (cond
1673        ((and (hash-ref boot-modules (dep-module "module"))
1674              (=* (dep-module "on") "build-"))
1675         "prebootstrap")
1677        ((or (= (dep-subtarget "on") "install-")
1678             (not (hash-ref boot-modules (dep-module "on"))))
1679         "normal")
1681        ((hash-ref boot-modules (dep-module "module"))
1682         "bootstrap")
1684        (1 "postbootstrap"))))
1686    (define make-postboot-dep (lambda ()
1687      (let ((target (dep-module "module")) (dep "stage_last"))
1688        (unless (= (hash-ref postboot-targets target) dep)
1689          (hash-create-handle! postboot-targets target dep)
1690          ;; All non-bootstrap modules' configure target already
1691          ;; depend on dep.
1692          (unless (=* target "target-")
1693            (string-append "configure-" target ": " dep "\n"))))))
1695    ;; We now build the hash table that is used by dep-kind.
1696    (define boot-modules (make-hash-table 113))
1697    (define postboot-targets (make-hash-table 113))
1700 [+ FOR host_modules +][+
1701    (if (exist? "bootstrap")
1702        (hash-create-handle! boot-modules (get "module") #t))
1703    "" +][+ ENDFOR host_modules +]
1704 [+ FOR target_modules +][+
1705    (if (exist? "bootstrap")
1706        (hash-create-handle! boot-modules (string-append "target-" (get "module")) #t))
1707    "" +][+ ENDFOR target_modules +]
1709 # With all the machinery above in place, it is pretty easy to generate
1710 # dependencies.  Host dependencies are a bit more complex because we have
1711 # to check for bootstrap/prebootstrap dependencies.  To resolve
1712 # prebootstrap dependencies, prebootstrap modules are gathered in
1713 # a hash table.
1714 [+ FOR dependencies +][+ CASE (dep-kind) +]
1715 [+ == "prebootstrap" +][+ (make-dep "" "") +][+ FOR bootstrap_stage +]
1716 [+ (make-dep (dep-stage) "") +][+ ENDFOR bootstrap_stage +]
1717 [+ == "bootstrap" +][+ (make-dep "" "") +][+ FOR bootstrap_stage +]
1718 [+ (make-dep (dep-stage) (dep-stage)) +][+ ENDFOR bootstrap_stage +]
1719 [+ == "normal" +][+ (make-dep "" "") +]
1720 [+ ESAC +][+ ENDFOR dependencies +]
1722 [+ FOR dependencies +][+ CASE (dep-kind) +]
1723 [+ == "postbootstrap" +][+ (make-dep "" "") +]
1724 [+ ESAC +][+ ENDFOR dependencies +]@endunless gcc-bootstrap
1726 # Dependencies for target modules on other target modules are
1727 # described by lang_env_dependencies; the defaults apply to anything
1728 # not mentioned there.
1730    ;; Predicate for whether LANG was specified in lang_env_dependencies.
1731    (define lang-dep (lambda (lang)
1732       (hash-ref lang-env-deps (string-append (get "module") "-" lang))))
1734    ;; Build the hash table we will need.
1735    (define lang-env-deps (make-hash-table 7))
1736 +][+ FOR lang_env_dependencies +][+
1737    (if (exist? "cxx")
1738        (hash-create-handle! lang-env-deps
1739           (string-append (get "module") "-" "cxx") #t))
1741    (if (exist? "no_c")
1742        (hash-create-handle! lang-env-deps
1743           (string-append (get "module") "-" "no_c") #t))
1745    (if (exist? "no_gcc")
1746        (hash-create-handle! lang-env-deps
1747           (string-append (get "module") "-" "no_gcc") #t))
1748    "" +][+ ENDFOR lang_env_dependencies +]
1750 [+ FOR target_modules +][+ IF (not (lang-dep "no_gcc")) +]
1751 configure-target-[+module+]: maybe-all-target-libgcc[+
1752   ENDIF +][+ ENDFOR target_modules +]
1754 [+ FOR target_modules +][+ IF (not (lang-dep "no_c")) +]
1755 configure-target-[+module+]: maybe-all-target-newlib maybe-all-target-libgloss[+
1756   ENDIF +][+ IF (lang-dep "cxx") +]
1757 configure-target-[+module+]: maybe-all-target-libstdc++-v3[+
1758   ENDIF +]
1759 [+ ENDFOR target_modules +]
1761 CONFIGURE_GDB_TK = @CONFIGURE_GDB_TK@
1762 GDB_TK = @GDB_TK@
1763 INSTALL_GDB_TK = @INSTALL_GDB_TK@
1764 configure-gdb: $(CONFIGURE_GDB_TK)
1765 all-gdb: $(gdbnlmrequirements) $(GDB_TK)
1766 install-gdb: $(INSTALL_GDB_TK)
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@
1773 # --------------------------------
1774 # Regenerating top level configury
1775 # --------------------------------
1777 # Rebuilding Makefile.in, using autogen.
1778 AUTOGEN = autogen
1779 $(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def
1780         cd $(srcdir) && $(AUTOGEN) Makefile.def
1782 # Rebuilding Makefile.
1783 Makefile: $(srcdir)/Makefile.in config.status
1784         CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
1786 config.status: configure
1787         CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck
1789 # Rebuilding configure.
1790 AUTOCONF = autoconf
1791 $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 \
1792         $(srcdir)/config/override.m4 $(srcdir)/config/proginstall.m4 \
1793         $(srcdir)/config/elf.m4 $(srcdir)/config/isl.m4 \
1794         $(srcdir)/libtool.m4 $(srcdir)/ltoptions.m4 $(srcdir)/ltsugar.m4 \
1795         $(srcdir)/ltversion.m4 $(srcdir)/lt~obsolete.m4
1796         cd $(srcdir) && $(AUTOCONF)
1798 # ------------------------------
1799 # Special directives to GNU Make
1800 # ------------------------------
1802 # Don't pass command-line variables to submakes.
1803 .NOEXPORT:
1804 MAKEOVERRIDES=
1806 # end of Makefile.in