1 [+ AutoGen5 template -*- Mode: Makefile -*-
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.
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.
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.)
33 # -------------------------------
34 # Standard Autoconf-set variables
35 # -------------------------------
38 build_alias=@build_noncanonical@
39 build_vendor=@build_vendor@
42 host_alias=@host_noncanonical@
43 host_vendor=@host_vendor@
46 target_alias=@target_noncanonical@
47 target_vendor=@target_vendor@
51 program_transform_name = @program_transform_name@
54 exec_prefix = @exec_prefix@
60 libexecdir = @libexecdir@
62 sysconfdir = @sysconfdir@
63 sharedstatedir = @sharedstatedir@
64 localstatedir = @localstatedir@
66 includedir = @includedir@
67 oldincludedir = @oldincludedir@
69 datarootdir = @datarootdir@
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
85 INSTALL_PROGRAM = @INSTALL_PROGRAM@
86 INSTALL_SCRIPT = @INSTALL_SCRIPT@
87 INSTALL_DATA = @INSTALL_DATA@
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@
102 build_tooldir = @build_tooldir@
104 # This is the name of the environment variable used for the path to
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
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
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.
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
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.
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 = \
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) \
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"; \
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 = \
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;
319 HOST_GMPLIBS = @gmplibs@
320 HOST_GMPINC = @gmpinc@
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 # ----------------------------------------------
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
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.
375 BOOT_ADAFLAGS= -gnatpg
384 MAKEINFO = @MAKEINFO@
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 # ---------------------------------------------
406 DSYMUTIL = @DSYMUTIL@
419 GNATBIND = @GNATBIND@
420 GNATMAKE = @GNATMAKE@
424 LIBCFLAGS = $(CFLAGS)
425 CXXFLAGS = @CXXFLAGS@
426 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
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
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
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.
586 #### host and target specific makefile fragments come in here.
587 ### @target_makefile_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 +]
616 HOST_LIB_PATH_[+module+] = \
617 $$r/$(HOST_SUBDIR)/[+module+]/[+lib_path+]:[+ IF bootstrap
618 +]$$r/$(HOST_SUBDIR)/prev-[+module+]/[+lib_path+]:[+ ENDIF bootstrap +]
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) \
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.
651 'DLLTOOL=$(DLLTOOL)' \
652 'DSYMUTIL=$(DSYMUTIL)' \
653 'GFORTRAN=$(GFORTRAN)' \
659 'OBJDUMP=$(OBJDUMP)' \
662 'READELF=$(READELF)' \
664 'WINDRES=$(WINDRES)' \
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)' \
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
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.
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)
745 .PHONY: configure-host
747 FOR host_modules +] \
748 maybe-configure-[+module+][+
749 ENDFOR host_modules +]
750 .PHONY: 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.
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.
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 \
773 [+ FOR build_modules +]
774 all-build: maybe-all-build-[+module+][+ ENDFOR build_modules +]
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 +]
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+]
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
819 installcheck: do-installcheck
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; \
834 install-dvi: do-install-dvi
836 install-pdf: do-install-pdf
838 install-html: do-install-html
841 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
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); \
849 -rm -rf $(BUILD_SUBDIR)
850 -if [ "$(HOST_SUBDIR)" != "." ]; then \
851 rm -rf $(HOST_SUBDIR); \
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
874 .PHONY: check do-check
877 # Only include modules actually being configured and built.
880 FOR host_modules +] \
881 maybe-check-[+module+][+
882 ENDFOR host_modules +]
886 FOR target_modules +] \
887 maybe-check-target-[+module+][+
888 ENDFOR target_modules +]
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 > $@
902 if test x'$(BOOT_CFLAGS)' != x''; then \
903 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
905 $(srcdir)/contrib/test_summary -t >$@
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; \
913 $(srcdir)/contrib/test_summary -t -i warning.log >$@
915 echo If you really want to send e-mail, run ./$@ now
919 $(srcdir)/.local.vimrc:
920 $(LN_S) contrib/vimrc $@
923 $(LN_S) contrib/vimrc $@
925 vimrc: $(srcdir)/.local.vimrc $(srcdir)/.lvimrc
929 # clang-format config
931 $(srcdir)/.clang-format:
932 $(LN_S) contrib/clang-format $@
934 clang-format: $(srcdir)/.clang-format
938 # Installation targets.
940 .PHONY: install uninstall
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 +]
955 FOR host_modules +] \
956 maybe-install-[+module+][+
957 ENDFOR host_modules +]
959 .PHONY: install-target
961 FOR target_modules +] \
962 maybe-install-target-[+module+][+
963 ENDFOR target_modules +]
966 @echo "the uninstall target is not supported in this tree"
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; \
975 $(MAKE) $(FLAGS_TO_PASS) install-headers); \
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
983 .PHONY: install-no-fixedincludes
984 install-no-fixedincludes: installdirs install-host-nogcc \
985 install-target gcc-install-no-fixedincludes
987 .PHONY: 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
1010 $(DESTDIR)$(prefix) \
1011 $(DESTDIR)$(exec_prefix)
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; \
1024 @echo "Building a full distribution of this tree isn't done"
1025 @echo "via 'make dist'. Check out the etc/ subdirectory"
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
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; \
1058 rm -f [+subdir+]/[+module+]/Makefile; \
1059 mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
1062 mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
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; \
1070 /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
1071 *) topdir=`echo [+subdir+]/[+module+]/ | \
1072 sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
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+] \
1082 @endif [+prefix+][+module+]
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+]
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+] && \
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; \
1145 [ -f [+subdir+]/stage[+id+]-[+module+]/Makefile ] || exit 0; \
1146 $(MAKE) stage[+id+]-start; \
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 +]
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+]:
1191 maybe-check-[+module+]: check-[+module+]
1194 [+ ELIF no_check_cross +]
1195 # This module is only tested in a native toolchain.
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)
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 +]
1220 .PHONY: install-[+module+] maybe-install-[+module+]
1221 maybe-install-[+module+]:
1223 maybe-install-[+module+]: install-[+module+]
1227 install-[+module+]: installdirs
1228 @: $(MAKE); $(unstage)
1229 @r=`${PWD_COMMAND}`; export r; \
1230 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1232 (cd $(HOST_SUBDIR)/[+module+] && \
1233 $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] install)
1234 [+ ENDIF no_install +]
1237 .PHONY: install-strip-[+module+] maybe-install-strip-[+module+]
1238 maybe-install-strip-[+module+]:
1240 maybe-install-strip-[+module+]: install-strip-[+module+]
1242 install-strip-[+module+]:
1244 install-strip-[+module+]: installdirs
1245 @: $(MAKE); $(unstage)
1246 @r=`${PWD_COMMAND}`; export r; \
1247 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1249 (cd $(HOST_SUBDIR)/[+module+] && \
1250 $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] install-strip)
1251 [+ ENDIF no_install +]
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+]:
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+]:
1264 [+make_target+]-[+module+]: [+
1266 [+depend+]-[+module+] [+
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; \
1273 for flag in $(EXTRA_HOST_FLAGS) [+extra_make_flags+]; do \
1274 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
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}" \
1286 [+ ENDFOR recursive_targets +]
1287 [+ ENDFOR host_modules +]
1289 # ---------------------------------------
1290 # Modules which run on the target machine
1291 # ---------------------------------------
1292 [+ FOR target_modules +]
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)'" +]
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)" +]
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+]
1323 # Dummy target for uncheckable module.
1324 check-target-[+module+]:
1326 check-target-[+module+]:
1327 @: $(MAKE); $(unstage)
1328 @r=`${PWD_COMMAND}`; export r; \
1329 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
1331 $(RAW_CXX_TARGET_EXPORTS) \[+
1333 $(NORMAL_TARGET_EXPORTS) \[+
1335 (cd $(TARGET_SUBDIR)/[+module+] && \
1336 $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
1338 +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+
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+]
1349 # Dummy target for uninstallable.
1350 install-target-[+module+]:
1352 install-target-[+module+]: installdirs
1353 @: $(MAKE); $(unstage)
1354 @r=`${PWD_COMMAND}`; export r; \
1355 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
1357 $(RAW_CXX_TARGET_EXPORTS) \[+
1359 $(NORMAL_TARGET_EXPORTS) \[+
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+]
1371 # Dummy target for uninstallable.
1372 install-strip-target-[+module+]:
1374 install-strip-target-[+module+]: installdirs
1375 @: $(MAKE); $(unstage)
1376 @r=`${PWD_COMMAND}`; export r; \
1377 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
1379 $(RAW_CXX_TARGET_EXPORTS) \[+
1381 $(NORMAL_TARGET_EXPORTS) \[+
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+]:
1398 [+make_target+]-target-[+module+]: [+
1400 [+depend+]-target-[+module+] [+
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; \[+
1407 $(RAW_CXX_TARGET_EXPORTS) \[+
1409 $(NORMAL_TARGET_EXPORTS) \[+
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|"`; \
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+]) \
1423 @endif target-[+module+]
1424 [+ ENDFOR recursive_targets +]
1425 [+ ENDFOR target_modules +]
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
1439 .PHONY: check-target-libitm-c++
1440 check-target-libitm-c++:
1441 $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) c++.exp" check-target-libitm
1443 @endif target-libitm
1450 cross: all-build all-gas all-ld
1451 @r=`${PWD_COMMAND}`; export r; \
1452 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
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
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; \
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; \
1480 && $(MAKE) $(GCC_FLAGS_TO_PASS) install-no-fixedincludes); \
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.
1501 .PHONY: unstage stage
1503 @: $(MAKE); $(unstage)
1505 @: $(MAKE); $(stage)
1507 # Disable commands for lean bootstrap.
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
1521 # 'touch' doesn't work right on some platforms.
1522 STAMP = echo timestamp >
1524 # We only want to compare .o files, so set this!
1527 [+ FOR bootstrap-stage +]
1528 .PHONY: stage[+id+]-start stage[+id+]-end
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 +]
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 +]
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 +]; \
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 +]; \
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+]; \
1571 $(MAKE) stage[+id+]-start; \[+IF lean +]
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 +]
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-//`; \
1597 { find . -type d | sort | sed 's,.*,$(SHELL) '"$$s"'/mkinstalldirs "../'$$j'/&",' | $(SHELL); } && \
1598 { find . -name '*.*da' | sed 's,.*,$(LN) -f "&" "../'$$j'/&",' | $(SHELL); }; \
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)
1624 (if hard "" "maybe-")
1625 (dep-subtarget var-name)
1627 (dep-module var-name)
1630 ;; make-dep builds a dependency from the MODULE and ON AutoGen vars.
1631 (define make-dep (lambda (module-kind on-kind)
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 ()
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 ()
1673 ((and (hash-ref boot-modules (dep-module "module"))
1674 (=* (dep-module "on") "build-"))
1677 ((or (= (dep-subtarget "on") "install-")
1678 (not (hash-ref boot-modules (dep-module "on"))))
1681 ((hash-ref boot-modules (dep-module "module"))
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
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
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 +][+
1738 (hash-create-handle! lang-env-deps
1739 (string-append (get "module") "-" "cxx") #t))
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[+
1759 [+ ENDFOR target_modules +]
1761 CONFIGURE_GDB_TK = @CONFIGURE_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.
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.
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.
1806 # end of Makefile.in