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 Free Software Foundation
11 # This file is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 # -------------------------------
27 # Standard Autoconf-set variables
28 # -------------------------------
31 build_alias=@build_noncanonical@
32 build_vendor=@build_vendor@
35 host_alias=@host_noncanonical@
36 host_vendor=@host_vendor@
39 target_alias=@target_noncanonical@
40 target_vendor=@target_vendor@
44 program_transform_name = @program_transform_name@
47 exec_prefix = @exec_prefix@
53 libexecdir = @libexecdir@
55 sysconfdir = @sysconfdir@
56 sharedstatedir = @sharedstatedir@
57 localstatedir = @localstatedir@
59 includedir = @includedir@
60 oldincludedir = @oldincludedir@
62 datarootdir = @datarootdir@
67 man1dir = $(mandir)/man1
68 man2dir = $(mandir)/man2
69 man3dir = $(mandir)/man3
70 man4dir = $(mandir)/man4
71 man5dir = $(mandir)/man5
72 man6dir = $(mandir)/man6
73 man7dir = $(mandir)/man7
74 man8dir = $(mandir)/man8
75 man9dir = $(mandir)/man9
78 INSTALL_PROGRAM = @INSTALL_PROGRAM@
79 INSTALL_SCRIPT = @INSTALL_SCRIPT@
80 INSTALL_DATA = @INSTALL_DATA@
84 MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
85 MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
87 # -------------------------------------------------
88 # Miscellaneous non-standard autoconf-set variables
89 # -------------------------------------------------
91 # The gcc driver likes to know the arguments it was configured with.
92 TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@
95 build_tooldir = @build_tooldir@
99 # This is the name of the environment variable used for the path to
101 RPATH_ENVVAR = @RPATH_ENVVAR@
103 # Build programs are put under this directory.
104 BUILD_SUBDIR = @build_subdir@
105 # This is set by the configure script to the arguments to use when configuring
106 # directories built for the build system.
107 BUILD_CONFIGARGS = @build_configargs@ --with-build-subdir="$(BUILD_SUBDIR)"
109 # This is the list of variables to export in the environment when
110 # configuring any subdirectory. It must also be exported whenever
111 # recursing into a build directory in case that directory's Makefile
114 FLEX="$(FLEX)"; export FLEX; \
115 LEX="$(LEX)"; export LEX; \
116 BISON="$(BISON)"; export BISON; \
117 YACC="$(YACC)"; export YACC; \
118 M4="$(M4)"; export M4; \
119 MAKEINFO="$(MAKEINFO)"; export MAKEINFO;
121 # This is the list of variables to export in the environment when
122 # configuring subdirectories for the build system.
125 AR="$(AR_FOR_BUILD)"; export AR; \
126 AS="$(AS_FOR_BUILD)"; export AS; \
127 CC="$(CC_FOR_BUILD)"; export CC; \
128 CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
129 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
130 CXX="$(CXX_FOR_BUILD)"; export CXX; \
131 CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
132 GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
133 GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
134 DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
135 LD="$(LD_FOR_BUILD)"; export LD; \
136 LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
137 NM="$(NM_FOR_BUILD)"; export NM; \
138 RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
139 WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
140 WINDMC="$(WINDMC_FOR_BUILD)"; export WINDMC;
142 # This is the list of directories to built for the host system.
143 SUBDIRS = @configdirs@
144 # This is set by the configure script to the arguments to use when configuring
145 # directories built for the host system.
146 HOST_CONFIGARGS = @host_configargs@
147 # Host programs are put under this directory, which is . except if building
149 HOST_SUBDIR = @host_subdir@
150 # This is the list of variables to export in the environment when
151 # configuring subdirectories for the host system. We need to pass
152 # some to the GCC configure because of its hybrid host/target nature.
155 CC="$(CC)"; export CC; \
156 CFLAGS="$(CFLAGS)"; export CFLAGS; \
157 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
158 CXX="$(CXX)"; export CXX; \
159 CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
160 AR="$(AR)"; export AR; \
161 AS="$(AS)"; export AS; \
162 CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
163 DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
164 LD="$(LD)"; export LD; \
165 LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \
166 NM="$(NM)"; export NM; \
167 RANLIB="$(RANLIB)"; export RANLIB; \
168 WINDRES="$(WINDRES)"; export WINDRES; \
169 WINDMC="$(WINDMC)"; export WINDMC; \
170 OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
171 OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
172 AR_FOR_TARGET="$(AR_FOR_TARGET)"; export AR_FOR_TARGET; \
173 AS_FOR_TARGET="$(AS_FOR_TARGET)"; export AS_FOR_TARGET; \
174 GCC_FOR_TARGET="$(GCC_FOR_TARGET)"; export GCC_FOR_TARGET; \
175 LD_FOR_TARGET="$(LD_FOR_TARGET)"; export LD_FOR_TARGET; \
176 NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \
177 OBJDUMP_FOR_TARGET="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP_FOR_TARGET; \
178 RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \
179 TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
180 GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
181 GMPINC="$(HOST_GMPINC)"; export GMPINC; \
183 $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
185 $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
187 # Similar, for later GCC stages.
188 POSTSTAGE1_HOST_EXPORTS = \
190 CC="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
191 -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \
192 CC_FOR_BUILD="$(STAGE_CC_WRAPPER) \
193 $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
194 -B$$r/$(HOST_SUBDIR)/prev-gcc/ \
195 -B$(build_tooldir)/bin/"; export CC_FOR_BUILD; \
196 LDFLAGS="$(BOOT_LDFLAGS)"; export LDFLAGS;
198 # Target libraries are put under this directory:
199 TARGET_SUBDIR = @target_subdir@
200 # This is set by the configure script to the arguments to use when configuring
201 # directories built for the target.
202 TARGET_CONFIGARGS = @target_configargs@ --with-target-subdir="$(TARGET_SUBDIR)"
203 # This is the list of variables to export in the environment when
204 # configuring subdirectories for the host system.
205 BASE_TARGET_EXPORTS = \
207 AR="$(AR_FOR_TARGET)"; export AR; \
208 AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \
209 CC="$(CC_FOR_TARGET)"; export CC; \
210 CFLAGS="$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \
211 CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
212 CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
213 CXXFLAGS="$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \
214 GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
215 GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \
216 DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
217 LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \
218 LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
219 LIPO="$(LIPO_FOR_TARGET)"; export LIPO; \
220 NM="$(COMPILER_NM_FOR_TARGET)"; export NM; \
221 OBJDUMP="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP; \
222 RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
223 STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \
224 WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
225 WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \
226 $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
228 RAW_CXX_TARGET_EXPORTS = \
229 $(BASE_TARGET_EXPORTS) \
230 CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
231 CXX="$(RAW_CXX_FOR_TARGET)"; export CXX;
233 NORMAL_TARGET_EXPORTS = \
234 $(BASE_TARGET_EXPORTS) \
235 CXX="$(CXX_FOR_TARGET)"; export CXX;
238 HOST_GMPLIBS = @gmplibs@
239 HOST_GMPINC = @gmpinc@
241 # ----------------------------------------------
242 # Programs producing files for the BUILD machine
243 # ----------------------------------------------
245 SHELL = @config_shell@
247 # pwd command to use. Allow user to override default by setting PWDCMD in
248 # the environment to account for automounters. The make variable must not
249 # be called PWDCMD, otherwise the value set here is passed to make
250 # subprocesses and overrides the setting from the user's environment.
251 # Don't use PWD since it is a common shell environment variable and we
252 # don't want to corrupt it.
253 PWD_COMMAND = $${PWDCMD-pwd}
255 # compilers to use to create programs which must be run in the build
257 AR_FOR_BUILD = @AR_FOR_BUILD@
258 AS_FOR_BUILD = @AS_FOR_BUILD@
259 CC_FOR_BUILD = @CC_FOR_BUILD@
260 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
261 CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@
262 CXX_FOR_BUILD = @CXX_FOR_BUILD@
263 DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@
264 GCJ_FOR_BUILD = @GCJ_FOR_BUILD@
265 GFORTRAN_FOR_BUILD = @GFORTRAN_FOR_BUILD@
266 LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
267 LD_FOR_BUILD = @LD_FOR_BUILD@
268 NM_FOR_BUILD = @NM_FOR_BUILD@
269 RANLIB_FOR_BUILD = @RANLIB_FOR_BUILD@
270 WINDMC_FOR_BUILD = @WINDMC_FOR_BUILD@
271 WINDRES_FOR_BUILD = @WINDRES_FOR_BUILD@
273 # Special variables passed down in EXTRA_GCC_FLAGS. They are defined
274 # here so that they can be overridden by Makefile fragments.
275 BUILD_PREFIX = @BUILD_PREFIX@
276 BUILD_PREFIX_1 = @BUILD_PREFIX_1@
278 # Flags to pass to stage2 and later makes. They are defined
279 # here so that they can be overridden by Makefile fragments.
288 MAKEINFO = @MAKEINFO@
292 # This just becomes part of the MAKEINFO definition passed down to
293 # sub-makes. It lets flags be given on the command line while still
294 # using the makeinfo from the object tree.
295 # (Default to avoid splitting info files by setting the threshold high.)
296 MAKEINFOFLAGS = --split-size=5000000
298 # ---------------------------------------------
299 # Programs producing files for the HOST machine
300 # ---------------------------------------------
317 GNATBIND = @GNATBIND@
318 GNATMAKE = @GNATMAKE@
322 LIBCFLAGS = $(CFLAGS)
323 CXXFLAGS = @CXXFLAGS@
324 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
326 # Only build the C compiler for stage1, because that is the only one that
327 # we can guarantee will build with the native compiler, and also it is the
328 # only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS),
329 # MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them
330 # overrideable (for a bootstrap build stage1 also builds gcc.info).
332 STAGE1_CHECKING=@stage1_checking@
333 STAGE1_LANGUAGES=@stage1_languages@
335 STAGE1_CFLAGS=@stage1_cflags@
336 STAGE2_CFLAGS=$(BOOT_CFLAGS)
337 STAGE3_CFLAGS=$(BOOT_CFLAGS)
338 STAGE4_CFLAGS=$(BOOT_CFLAGS)
340 STAGE1_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
341 STAGE2_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
342 STAGE3_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
343 STAGE4_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
345 do-compare = @do_compare@
346 do-compare3 = $(do-compare)
347 do-compare-debug = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2
349 # -----------------------------------------------
350 # Programs producing files for the TARGET machine
351 # -----------------------------------------------
353 FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
355 AR_FOR_TARGET=@AR_FOR_TARGET@
356 AS_FOR_TARGET=@AS_FOR_TARGET@
357 CC_FOR_TARGET=$(STAGE_CC_WRAPPER) @CC_FOR_TARGET@ $(FLAGS_FOR_TARGET)
359 # If GCC_FOR_TARGET is not overriden on the command line, then this
360 # variable is passed down to the gcc Makefile, where it is used to
361 # build libgcc2.a. We define it here so that it can itself be
362 # overridden on the command line.
363 GCC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCC_FOR_TARGET@ $(FLAGS_FOR_TARGET)
364 CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @CXX_FOR_TARGET@ $(FLAGS_FOR_TARGET)
365 RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@ $(FLAGS_FOR_TARGET)
366 GCJ_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCJ_FOR_TARGET@ $(FLAGS_FOR_TARGET)
367 GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@ $(FLAGS_FOR_TARGET)
368 DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
369 LD_FOR_TARGET=@LD_FOR_TARGET@
371 LIPO_FOR_TARGET=@LIPO_FOR_TARGET@
372 NM_FOR_TARGET=@NM_FOR_TARGET@
373 OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@
374 RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
375 STRIP_FOR_TARGET=@STRIP_FOR_TARGET@
376 WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@
377 WINDMC_FOR_TARGET=@WINDMC_FOR_TARGET@
379 COMPILER_AS_FOR_TARGET=@COMPILER_AS_FOR_TARGET@
380 COMPILER_LD_FOR_TARGET=@COMPILER_LD_FOR_TARGET@
381 COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_TARGET@
383 CFLAGS_FOR_TARGET = @CFLAGS_FOR_TARGET@
384 CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@
385 SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
386 DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@
388 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
389 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
392 # ------------------------------------
393 # Miscellaneous targets and flag lists
394 # ------------------------------------
396 # The first rule in the file had better be this one. Don't put any above it.
397 # This lives here to allow makefile fragments to contain dependencies.
400 #### host and target specific makefile fragments come in here.
401 @target_makefile_frag@
407 # This is the list of directories that may be needed in RPATH_ENVVAR
408 # so that prorgams built for the target machine work.
409 TARGET_LIB_PATH = [+ FOR target_modules +][+
410 IF lib_path +]$(TARGET_LIB_PATH_[+module+])[+ ENDIF lib_path +][+
411 ENDFOR target_modules +]$(HOST_LIB_PATH_gcc)
412 [+ FOR target_modules +][+ IF lib_path +]
413 @if target-[+module+]
414 TARGET_LIB_PATH_[+module+] = $$r/$(TARGET_SUBDIR)/[+module+]/[+lib_path+]:
415 @endif target-[+module+]
416 [+ ENDIF lib_path +][+ ENDFOR target_modules +]
419 # This is the list of directories that may be needed in RPATH_ENVVAR
420 # so that programs built for the host machine work.
421 HOST_LIB_PATH = [+ FOR host_modules +][+
422 IF lib_path +]$(HOST_LIB_PATH_[+module+])[+ ENDIF lib_path +][+
423 ENDFOR host_modules +]
425 # Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch
427 HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc:$$r/$(HOST_SUBDIR)/prev-gcc:
430 [+ FOR host_modules +][+ IF lib_path +]
432 HOST_LIB_PATH_[+module+] = \
433 $$r/$(HOST_SUBDIR)/[+module+]/[+lib_path+]:[+ IF bootstrap
434 +]$$r/$(HOST_SUBDIR)/prev-[+module+]/[+lib_path+]:[+ ENDIF bootstrap +]
436 [+ ENDIF lib_path +][+ ENDFOR host_modules +]
438 # Flags to pass down to all sub-makes.
439 BASE_FLAGS_TO_PASS =[+ FOR flags_to_pass +][+ IF optional +] \
440 "`echo '[+flag+]=$([+flag+])' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"[+ ELSE optional +] \
441 "[+flag+]=$([+flag+])"[+ ENDIF optional+][+ ENDFOR flags_to_pass +] \
442 "CONFIG_SHELL=$(SHELL)" \
443 "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)"
445 # We leave this in just in case, but it is not needed anymore.
446 RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS)
448 # Flags to pass down to most sub-makes, in which we're building with
449 # the host environment.
455 'DLLTOOL=$(DLLTOOL)' \
459 'OBJDUMP=$(OBJDUMP)' \
462 'WINDRES=$(WINDRES)' \
465 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
467 # Flags that are concerned with the location of the X11 include files
470 # NOTE: until the top-level is getting the values via autoconf, it only
471 # causes problems to have this top-level Makefile overriding the autoconf-set
472 # values in child directories. Only variables that don't conflict with
473 # autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
475 X11_FLAGS_TO_PASS = \
476 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
477 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
479 # Flags to pass to stage2 and later makes.
481 POSTSTAGE1_FLAGS_TO_PASS = \
482 CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
483 GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind" \
484 LDFLAGS="$(BOOT_LDFLAGS)" \
485 "`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
487 # Flags to pass down to makes which are built with the target environment.
488 # The double $ decreases the length of the command line; those variables
489 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. The
490 # *_CFLAGS_FOR_TARGET variables are not passed down and most often empty,
491 # so we expand them here.
492 EXTRA_TARGET_FLAGS = \
493 'AR=$$(AR_FOR_TARGET)' \
494 'AS=$(COMPILER_AS_FOR_TARGET)' \
495 'CC=$$(CC_FOR_TARGET)' \
496 'CFLAGS=$$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \
497 'CXX=$$(CXX_FOR_TARGET)' \
498 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \
499 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
500 'LD=$(COMPILER_LD_FOR_TARGET)' \
501 'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \
502 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \
503 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \
504 'NM=$(COMPILER_NM_FOR_TARGET)' \
505 'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \
506 'RANLIB=$$(RANLIB_FOR_TARGET)' \
507 'WINDRES=$$(WINDRES_FOR_TARGET)' \
508 'WINDMC=$$(WINDMC_FOR_TARGET)'
510 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
512 # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
513 # unfortunately needs the native compiler and the target ar and
515 # If any variables are added here, they must be added to do-*, below.
516 # The BUILD_* variables are a special case, which are used for the gcc
517 # cross-building scheme.
519 "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
520 "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
521 "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
522 "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
523 "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
524 "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
526 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS)
528 .PHONY: configure-host
530 FOR host_modules +] \
531 maybe-configure-[+module+][+
532 ENDFOR host_modules +]
533 .PHONY: configure-target
535 FOR target_modules +] \
536 maybe-configure-target-[+module+][+
537 ENDFOR target_modules +]
539 # The target built for a native non-bootstrap build.
543 [ -f stage_final ] || echo stage3 > stage_final
544 @r=`${PWD_COMMAND}`; export r; \
545 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
546 $(MAKE) $(RECURSE_FLAGS_TO_PASS) `cat stage_final`-bubble
548 @: $(MAKE); $(unstage)
549 @r=`${PWD_COMMAND}`; export r; \
550 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
551 if [ -f stage_last ]; then \
552 $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target; \
554 $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target; \
558 [+ FOR build_modules +]
559 all-build: maybe-all-build-[+module+][+ ENDFOR build_modules +]
562 [+ FOR host_modules +][+ IF bootstrap +]
563 @if [+module+]-no-bootstrap[+ ENDIF bootstrap +]
564 all-host: maybe-all-[+module+][+ IF bootstrap +]
565 @endif [+module+]-no-bootstrap[+ ENDIF bootstrap +][+ ENDFOR host_modules +]
568 [+ FOR target_modules +][+ IF bootstrap +]
569 @if target-[+module+]-no-bootstrap[+ ENDIF bootstrap +]
570 all-target: maybe-all-target-[+module+][+ IF bootstrap +]
571 @endif target-[+module+]-no-bootstrap[+
572 ENDIF bootstrap +][+ ENDFOR target_modules +]
574 # Do a target for all the subdirectories. A ``make do-X'' will do a
575 # ``make X'' in all subdirectories (because, in general, there is a
576 # dependency (below) of X upon do-X, a ``make X'' will also do this,
577 # but it may do additional work as well).
578 [+ FOR recursive_targets +]
579 .PHONY: do-[+make_target+]
581 @: $(MAKE); $(unstage)
582 @r=`${PWD_COMMAND}`; export r; \
583 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
584 $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+make_target+]-host \
585 [+make_target+]-target
588 .PHONY: [+make_target+]-host
589 [+ FOR host_modules +]
590 [+make_target+]-host: maybe-[+make_target+]-[+module+][+ ENDFOR host_modules +]
592 .PHONY: [+make_target+]-target
593 [+ FOR target_modules +]
594 [+make_target+]-target: maybe-[+make_target+]-target-[+module+][+ ENDFOR target_modules +]
595 [+ ENDFOR recursive_targets +]
597 # Here are the targets which correspond to the do-X targets.
599 .PHONY: info installcheck dvi pdf html
600 .PHONY: install-info install-pdf install-html
601 .PHONY: clean distclean mostlyclean maintainer-clean realclean
602 .PHONY: local-clean local-distclean local-maintainer-clean
604 installcheck: do-installcheck
609 # Make sure makeinfo is built before we do a `make info', if we're
610 # in fact building texinfo.
611 do-info: maybe-all-texinfo
613 install-info: do-install-info dir.info
614 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
615 if [ -f dir.info ] ; then \
616 $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \
619 install-pdf: do-install-pdf
621 install-html: do-install-html
624 -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
627 -rm -f Makefile config.status config.cache mh-frag mt-frag
628 -rm -f maybedep.tmp serdep.tmp
629 -if [ "$(TARGET_SUBDIR)" != "." ]; then \
630 rm -rf $(TARGET_SUBDIR); \
632 -rm -rf $(BUILD_SUBDIR)
633 -if [ "$(HOST_SUBDIR)" != "." ]; then \
634 rm -rf $(HOST_SUBDIR); \
636 -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
637 -rm -f texinfo/doc/Makefile texinfo/po/POTFILES
638 -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
639 -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null
640 -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null
642 local-maintainer-clean:
643 @echo "This command is intended for maintainers to use;"
644 @echo "it deletes files that may require special tools to rebuild."
646 clean: do-clean local-clean
647 mostlyclean: do-mostlyclean local-clean
648 distclean: do-distclean local-clean local-distclean
649 maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
650 maintainer-clean: local-distclean
651 realclean: maintainer-clean
655 .PHONY: check do-check
658 # Only include modules actually being configured and built.
661 FOR host_modules +] \
662 maybe-check-[+module+][+
663 ENDFOR host_modules +]
667 FOR target_modules +] \
668 maybe-check-target-[+module+][+
669 ENDFOR target_modules +]
672 @: $(MAKE); $(unstage)
673 @r=`${PWD_COMMAND}`; export r; \
674 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
675 $(MAKE) $(RECURSE_FLAGS_TO_PASS) check-host check-target
677 # Automated reporting of test results.
679 warning.log: build.log
680 $(srcdir)/contrib/warn_summary build.log > $@
683 if test x'$(BOOT_CFLAGS)' != x''; then \
684 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
686 $(srcdir)/contrib/test_summary -t >$@
688 echo If you really want to send e-mail, run ./$@ now
690 mail-report-with-warnings.log: warning.log
691 if test x'$(BOOT_CFLAGS)' != x''; then \
692 BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
694 $(srcdir)/contrib/test_summary -t -i warning.log >$@
696 echo If you really want to send e-mail, run ./$@ now
698 # Installation targets.
700 .PHONY: install uninstall
702 @: $(MAKE); $(unstage)
703 @r=`${PWD_COMMAND}`; export r; \
704 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
705 $(MAKE) $(RECURSE_FLAGS_TO_PASS) installdirs install-host install-target
707 .PHONY: install-host-nogcc
708 install-host-nogcc: [+
709 FOR host_modules +][+ IF (not (= (get "module") "gcc")) +] \
710 maybe-install-[+module+][+ ENDIF +][+
711 ENDFOR host_modules +]
715 FOR host_modules +] \
716 maybe-install-[+module+][+
717 ENDFOR host_modules +]
719 .PHONY: install-target
721 FOR target_modules +] \
722 maybe-install-target-[+module+][+
723 ENDFOR target_modules +]
726 @echo "the uninstall target is not supported in this tree"
729 install.all: install-no-fixedincludes
730 @if [ -f ./gcc/Makefile ] ; then \
731 r=`${PWD_COMMAND}` ; export r ; \
732 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
735 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
740 # install-no-fixedincludes is used because Cygnus can not distribute
741 # the fixed header files.
742 .PHONY: install-no-fixedincludes
743 install-no-fixedincludes: installdirs install-host-nogcc \
744 install-target gcc-no-fixedincludes
746 ### other supporting targets
749 $(DESTDIR)$(prefix) \
750 $(DESTDIR)$(exec_prefix)
752 installdirs: mkinstalldirs
753 $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
755 dir.info: do-install-info
756 if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
757 $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
758 mv -f dir.info.new dir.info ; \
763 @echo "Building a full distribution of this tree isn't done"
764 @echo "via 'make dist'. Check out the etc/ subdirectory"
768 # Right now this just builds TAGS in each subdirectory. emacs19 has the
769 # ability to use several tags files at once, so there is probably no need
770 # to combine them into one big TAGS file (like CVS 1.3 does). We could
771 # (if we felt like it) have this Makefile write a piece of elisp which
772 # the user could load to tell emacs19 where all the TAGS files we just
776 # ------------------------------------
777 # Macros for configure and all targets
778 # ------------------------------------
780 [+ DEFINE configure +]
781 .PHONY: configure-[+prefix+][+module+] maybe-configure-[+prefix+][+module+]
782 maybe-configure-[+prefix+][+module+]:
784 configure-[+prefix+][+module+]: stage_current
786 @if [+prefix+][+module+]
787 maybe-configure-[+prefix+][+module+]: configure-[+prefix+][+module+]
788 configure-[+prefix+][+module+]: [+ IF bootstrap +][+ ELSE +]
789 @: $(MAKE); $(unstage)[+ ENDIF bootstrap +]
790 @r=`${PWD_COMMAND}`; export r; \
791 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
792 [+ IF check_multilibs
793 +]echo "Checking multilib configuration for [+module+]..."; \
794 $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \
795 $(CC_FOR_TARGET) --print-multi-lib > [+subdir+]/[+module+]/multilib.tmp 2> /dev/null ; \
796 if test -r [+subdir+]/[+module+]/multilib.out; then \
797 if cmp -s [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; then \
798 rm -f [+subdir+]/[+module+]/multilib.tmp; \
800 rm -f [+subdir+]/[+module+]/Makefile; \
801 mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
804 mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
806 [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \
807 $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \
809 echo Configuring in [+subdir+]/[+module+]; \
810 cd "[+subdir+]/[+module+]" || exit 1; \
812 /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
813 *) topdir=`echo [+subdir+]/[+module+]/ | \
814 sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
816 srcdiroption="--srcdir=$${topdir}/[+module+]"; \
817 libsrcdir="$$s/[+module+]"; \
818 [+ IF no-config-site +]rm -f no-such-file || : ; \
819 CONFIG_SITE=no-such-file [+ ENDIF +]$(SHELL) $${libsrcdir}/configure \
820 [+args+] --build=${build_alias} --host=[+host_alias+] \
821 --target=[+target_alias+] $${srcdiroption} [+extra_configure_flags+] \
823 @endif [+prefix+][+module+]
826 [+ FOR bootstrap_stage +]
827 .PHONY: configure-stage[+id+]-[+prefix+][+module+] maybe-configure-stage[+id+]-[+prefix+][+module+]
828 maybe-configure-stage[+id+]-[+prefix+][+module+]:
829 @if [+prefix+][+module+]-bootstrap
830 maybe-configure-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
831 configure-stage[+id+]-[+prefix+][+module+]:
832 @[ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start
833 @$(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]
834 @r=`${PWD_COMMAND}`; export r; \
835 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
836 [+ IF check_multilibs
837 +]echo "Checking multilib configuration for [+module+]..."; \
838 $(CC_FOR_TARGET) --print-multi-lib > [+subdir+]/[+module+]/multilib.tmp 2> /dev/null ; \
839 if test -r [+subdir+]/[+module+]/multilib.out; then \
840 if cmp -s [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; then \
841 rm -f [+subdir+]/[+module+]/multilib.tmp; \
843 rm -f [+subdir+]/[+module+]/Makefile; \
844 mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
847 mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
849 [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \
850 [+exports+][+ IF prev +] \
851 [+poststage1_exports+][+ ENDIF prev +] [+ IF prefix +] \
852 CFLAGS="[+stage_libcflags+] $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \
853 CXXFLAGS="[+stage_libcflags+] $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; [+ ELSE +] \
854 CFLAGS="[+stage_cflags+]"; export CFLAGS; \
855 CXXFLAGS="[+stage_cflags+]"; export CXXFLAGS; [+ ENDIF +] \
856 echo Configuring stage [+id+] in [+subdir+]/[+module+] ; \
857 $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \
858 cd [+subdir+]/[+module+] || exit 1; \
860 /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
861 *) topdir=`echo [+subdir+]/[+module+]/ | \
862 sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
864 srcdiroption="--srcdir=$${topdir}/[+module+]"; \
865 libsrcdir="$$s/[+module+]"; \
866 $(SHELL) $${libsrcdir}/configure \
867 [+args+] --build=${build_alias} --host=[+host_alias+] \
868 --target=[+target_alias+] $${srcdiroption} \
869 [+ IF prev +]--with-build-libsubdir=$(HOST_SUBDIR)[+ ENDIF prev +] \
870 [+stage_configure_flags+] [+extra_configure_flags+]
871 @endif [+prefix+][+module+]-bootstrap
872 [+ ENDFOR bootstrap_stage +]
873 [+ ENDIF bootstrap +]
877 .PHONY: all-[+prefix+][+module+] maybe-all-[+prefix+][+module+]
878 maybe-all-[+prefix+][+module+]:
880 all-[+prefix+][+module+]: stage_current
882 @if [+prefix+][+module+]
883 TARGET-[+prefix+][+module+]=[+
884 IF all_target +][+all_target+][+ ELSE +]all[+ ENDIF all_target +]
885 maybe-all-[+prefix+][+module+]: all-[+prefix+][+module+]
886 all-[+prefix+][+module+]: configure-[+prefix+][+module+][+ IF bootstrap +][+ ELSE +]
887 @: $(MAKE); $(unstage)[+ ENDIF bootstrap +]
888 @r=`${PWD_COMMAND}`; export r; \
889 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
891 (cd [+subdir+]/[+module+] && \
892 $(MAKE) $(BASE_FLAGS_TO_PASS) [+args+] [+extra_make_flags+] \
893 $(TARGET-[+prefix+][+module+]))
894 @endif [+prefix+][+module+]
897 [+ FOR bootstrap_stage +]
898 .PHONY: all-stage[+id+]-[+prefix+][+module+] maybe-all-stage[+id+]-[+prefix+][+module+]
899 .PHONY: clean-stage[+id+]-[+prefix+][+module+] maybe-clean-stage[+id+]-[+prefix+][+module+]
900 maybe-all-stage[+id+]-[+prefix+][+module+]:
901 maybe-clean-stage[+id+]-[+prefix+][+module+]:
902 @if [+prefix+][+module+]-bootstrap
903 maybe-all-stage[+id+]-[+prefix+][+module+]: all-stage[+id+]-[+prefix+][+module+]
904 all-stage[+id+]: all-stage[+id+]-[+prefix+][+module+]
905 TARGET-stage[+id+]-[+prefix+][+module+] = $(TARGET-[+prefix+][+module+])
906 all-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
907 @[ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start
908 @r=`${PWD_COMMAND}`; export r; \
909 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
910 [+exports+][+ IF prev +] \
911 [+poststage1_exports+][+ ENDIF prev +] \
912 cd [+subdir+]/[+module+] && \
913 $(MAKE) $(BASE_FLAGS_TO_PASS) \
914 CFLAGS="[+stage_cflags+]" CXXFLAGS="[+stage_cflags+]" \
915 LIBCFLAGS="[+stage_libcflags+]" \
916 CFLAGS_FOR_TARGET="[+stage_libcflags+]" \
917 CXXFLAGS_FOR_TARGET="[+stage_libcflags+]" [+args+] [+
918 IF prev +][+poststage1_args+][+ ENDIF prev
919 +] [+extra_make_flags+] \
920 $(TARGET-stage[+id+]-[+prefix+][+module+])
922 maybe-clean-stage[+id+]-[+prefix+][+module+]: clean-stage[+id+]-[+prefix+][+module+]
923 clean-stage[+id+]: clean-stage[+id+]-[+prefix+][+module+]
924 clean-stage[+id+]-[+prefix+][+module+]:
925 @if [ $(current_stage) = stage[+id+] ]; then \
926 [ -f [+subdir+]/[+module+]/Makefile ] || exit 0; \
928 [ -f [+subdir+]/stage[+id+]-[+module+]/Makefile ] || exit 0; \
929 $(MAKE) stage[+id+]-start; \
931 cd [+subdir+]/[+module+] && \
932 $(MAKE) [+args+] [+ IF prev +] \
933 [+poststage1_args+] [+ ENDIF prev +] \
934 [+extra_make_flags+] clean
935 @endif [+prefix+][+module+]-bootstrap
937 [+ ENDFOR bootstrap_stage +]
938 [+ ENDIF bootstrap +]
941 # --------------------------------------
942 # Modules which run on the build machine
943 # --------------------------------------
944 [+ FOR build_modules +]
945 [+ configure prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)"
946 host_alias=(get "host" "${build_alias}")
947 target_alias=(get "target" "${target_alias}")
948 args="$(BUILD_CONFIGARGS)" no-config-site=true +]
950 [+ all prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)" +]
951 [+ ENDFOR build_module +]
953 # --------------------------------------
954 # Modules which run on the host machine
955 # --------------------------------------
956 [+ FOR host_modules +]
957 [+ configure prefix="" subdir="$(HOST_SUBDIR)"
958 exports="$(HOST_EXPORTS)"
959 poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)"
960 host_alias=(get "host" "${host_alias}")
961 target_alias=(get "target" "${target_alias}")
962 args="$(HOST_CONFIGARGS)" +]
964 [+ all prefix="" subdir="$(HOST_SUBDIR)"
965 exports="$(HOST_EXPORTS)"
966 poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)"
967 args="$(EXTRA_HOST_FLAGS)"
968 poststage1_args="$(POSTSTAGE1_FLAGS_TO_PASS)" +]
970 .PHONY: check-[+module+] maybe-check-[+module+]
971 maybe-check-[+module+]:
973 maybe-check-[+module+]: check-[+module+]
976 [+ ELIF no_check_cross +]
977 # This module is only tested in a native toolchain.
979 @: $(MAKE); $(unstage)
980 @if [ '$(host)' = '$(target)' ] ; then \
981 r=`${PWD_COMMAND}`; export r; \
982 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
984 (cd $(HOST_SUBDIR)/[+module+] && \
985 $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] check); \
989 @: $(MAKE); $(unstage)
990 @r=`${PWD_COMMAND}`; export r; \
991 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
993 (cd $(HOST_SUBDIR)/[+module+] && \
994 $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] check)
998 .PHONY: install-[+module+] maybe-install-[+module+]
999 maybe-install-[+module+]:
1001 maybe-install-[+module+]: install-[+module+]
1005 install-[+module+]: installdirs
1006 @: $(MAKE); $(unstage)
1007 @r=`${PWD_COMMAND}`; export r; \
1008 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1010 (cd $(HOST_SUBDIR)/[+module+] && \
1011 $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] install)
1012 [+ ENDIF no_install +]
1015 # Other targets (info, dvi, pdf, etc.)
1016 [+ FOR recursive_targets +]
1017 .PHONY: maybe-[+make_target+]-[+module+] [+make_target+]-[+module+]
1018 maybe-[+make_target+]-[+module+]:
1020 maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+]
1021 [+ IF (match-value? = "missing" (get "make_target") ) +]
1022 # [+module+] doesn't support [+make_target+].
1023 [+make_target+]-[+module+]:
1025 [+make_target+]-[+module+]: [+
1027 [+depend+]-[+module+] [+
1029 @[+ IF bootstrap +][+ ELSE +]: $(MAKE); $(unstage)
1030 @[+ ENDIF bootstrap +][ -f ./[+module+]/Makefile ] || exit 0; \
1031 r=`${PWD_COMMAND}`; export r; \
1032 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1034 for flag in $(EXTRA_HOST_FLAGS) [+extra_make_flags+]; do \
1035 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
1037 echo "Doing [+make_target+] in [+module+]" ; \
1038 (cd $(HOST_SUBDIR)/[+module+] && \
1039 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
1040 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
1041 "RANLIB=$${RANLIB}" \
1042 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
1047 [+ ENDFOR recursive_targets +]
1048 [+ ENDFOR host_modules +]
1050 # ---------------------------------------
1051 # Modules which run on the target machine
1052 # ---------------------------------------
1053 [+ FOR target_modules +]
1056 [+ configure prefix="target-" subdir="$(TARGET_SUBDIR)"
1057 check_multilibs=true
1058 exports="$(RAW_CXX_TARGET_EXPORTS)"
1059 host_alias=(get "host" "${target_alias}")
1060 target_alias=(get "target" "${target_alias}")
1061 args="$(TARGET_CONFIGARGS)" no-config-site=true +]
1063 [+ all prefix="target-" subdir="$(TARGET_SUBDIR)"
1064 exports="$(RAW_CXX_TARGET_EXPORTS)"
1065 args="$(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'" +]
1067 [+ configure prefix="target-" subdir="$(TARGET_SUBDIR)"
1068 check_multilibs=true
1069 exports="$(NORMAL_TARGET_EXPORTS)"
1070 host_alias=(get "host" "${target_alias}")
1071 target_alias=(get "target" "${target_alias}")
1072 args="$(TARGET_CONFIGARGS)" no-config-site=true +]
1074 [+ all prefix="target-" subdir="$(TARGET_SUBDIR)"
1075 exports="$(NORMAL_TARGET_EXPORTS)"
1076 args="$(EXTRA_TARGET_FLAGS)" +]
1079 .PHONY: check-target-[+module+] maybe-check-target-[+module+]
1080 maybe-check-target-[+module+]:
1081 @if target-[+module+]
1082 maybe-check-target-[+module+]: check-target-[+module+]
1084 # Dummy target for uncheckable module.
1085 check-target-[+module+]:
1087 check-target-[+module+]:
1088 @: $(MAKE); $(unstage)
1089 @r=`${PWD_COMMAND}`; export r; \
1090 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
1092 $(RAW_CXX_TARGET_EXPORTS) \[+
1094 $(NORMAL_TARGET_EXPORTS) \[+
1096 (cd $(TARGET_SUBDIR)/[+module+] && \
1097 $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
1099 +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+
1101 +] [+extra_make_flags+] check)
1102 [+ ENDIF no_check +]
1103 @endif target-[+module+]
1105 .PHONY: install-target-[+module+] maybe-install-target-[+module+]
1106 maybe-install-target-[+module+]:
1107 @if target-[+module+]
1108 maybe-install-target-[+module+]: install-target-[+module+]
1110 # Dummy target for uninstallable.
1111 install-target-[+module+]:
1113 install-target-[+module+]: installdirs
1114 @: $(MAKE); $(unstage)
1115 @r=`${PWD_COMMAND}`; export r; \
1116 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
1118 $(RAW_CXX_TARGET_EXPORTS) \[+
1120 $(NORMAL_TARGET_EXPORTS) \[+
1122 (cd $(TARGET_SUBDIR)/[+module+] && \
1123 $(MAKE) $(TARGET_FLAGS_TO_PASS) [+extra_make_flags+] install)
1124 [+ ENDIF no_install +]
1125 @endif target-[+module+]
1127 # Other targets (info, dvi, pdf, etc.)
1128 [+ FOR recursive_targets +]
1129 .PHONY: maybe-[+make_target+]-target-[+module+] [+make_target+]-target-[+module+]
1130 maybe-[+make_target+]-target-[+module+]:
1131 @if target-[+module+]
1132 maybe-[+make_target+]-target-[+module+]: [+make_target+]-target-[+module+]
1133 [+ IF (match-value? = "missing" (get "make_target") ) +]
1134 # [+module+] doesn't support [+make_target+].
1135 [+make_target+]-target-[+module+]:
1137 [+make_target+]-target-[+module+]: [+
1139 [+depend+]-target-[+module+] [+
1141 @: $(MAKE); $(unstage)
1142 @[ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] || exit 0 ; \
1143 r=`${PWD_COMMAND}`; export r; \
1144 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
1146 $(RAW_CXX_TARGET_EXPORTS) \[+
1148 $(NORMAL_TARGET_EXPORTS) \[+
1150 echo "Doing [+make_target+] in $(TARGET_SUBDIR)/[+module+]" ; \
1151 for flag in $(EXTRA_TARGET_FLAGS); do \
1152 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
1154 (cd $(TARGET_SUBDIR)/[+module+] && \
1155 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
1156 "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
1157 "RANLIB=$${RANLIB}" \
1158 "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
1159 [+extra_make_flags+] [+make_target+]) \
1162 @endif target-[+module+]
1163 [+ ENDFOR recursive_targets +]
1164 [+ ENDFOR target_modules +]
1170 @if gcc-no-bootstrap
1172 cross: all-build all-gas all-ld
1173 @r=`${PWD_COMMAND}`; export r; \
1174 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1176 echo "Building the C and C++ compiler"; \
1177 cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
1178 @r=`${PWD_COMMAND}`; export r; \
1179 s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
1180 echo "Building runtime libraries"; \
1181 $(MAKE) $(RECURSE_FLAGS_TO_PASS) LANGUAGES="c c++" all
1182 @endif gcc-no-bootstrap
1185 .PHONY: check-gcc-c++
1187 @if [ -f ./gcc/Makefile ] ; then \
1188 r=`${PWD_COMMAND}`; export r; \
1189 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1191 (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
1197 check-c++: check-target-libstdc++-v3 check-gcc-c++
1199 # Install the gcc headers files, but not the fixed include files,
1200 # which Cygnus is not allowed to distribute. This rule is very
1201 # dependent on the workings of the gcc Makefile.in.
1202 .PHONY: gcc-no-fixedincludes
1203 gcc-no-fixedincludes:
1204 @if [ -f ./gcc/Makefile ]; then \
1205 rm -rf gcc/tmp-include; \
1206 mv gcc/include gcc/tmp-include 2>/dev/null; \
1207 mkdir gcc/include; \
1208 cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
1209 touch gcc/stmp-fixinc gcc/include/fixed; \
1210 rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
1211 r=`${PWD_COMMAND}`; export r; \
1212 s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
1215 $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1216 rm -rf gcc/include; \
1217 mv gcc/tmp-include gcc/include 2>/dev/null; \
1221 # ---------------------
1222 # GCC bootstrap support
1223 # ---------------------
1225 # We track the current stage (the one in 'gcc') in the stage_current file.
1226 # stage_last instead tracks the stage that was built last. These targets
1227 # are dummy when toplevel bootstrap is not active.
1229 # While making host and target tools, symlinks to the final stage must be
1230 # there, so $(unstage) should be run at various points. To avoid excessive
1231 # recursive invocations of make, we "inline" them using a variable. These
1232 # must be referenced as ": $(MAKE) ; $(unstage)" rather than "$(unstage)"
1233 # to avoid warnings from the GNU Make job server.
1240 unstage = if [ -f stage_last ]; then [ -f stage_current ] || $(MAKE) `cat stage_last`-start || exit 1; else :; fi
1241 stage = if [ -f stage_current ]; then $(MAKE) `cat stage_current`-end || exit 1; else :; fi
1242 current_stage = "`cat stage_current 2> /dev/null`"
1243 @endif gcc-bootstrap
1245 .PHONY: unstage stage
1247 @: $(MAKE); $(unstage)
1249 @: $(MAKE); $(stage)
1251 # Disable commands for lean bootstrap.
1254 # We name the build directories for the various stages "stage1-gcc",
1255 # "stage2-gcc","stage3-gcc", etc.
1257 # Since the 'compare' process will fail (on debugging information) if any
1258 # directory names are different, we need to link the gcc directory for
1259 # the previous stage to a constant name ('prev-gcc'), and to make the name of
1260 # the build directories constant as well. For the latter, we use naked names
1261 # like 'gcc', because the scripts in that directory assume it. We use
1262 # mv on platforms where symlinks to directories do not work or are not
1265 # 'touch' doesn't work right on some platforms.
1266 STAMP = echo timestamp >
1268 # We only want to compare .o files, so set this!
1271 [+ FOR bootstrap-stage +]
1272 .PHONY: stage[+id+]-start stage[+id+]-end
1275 @: $(MAKE); $(stage); \
1276 echo stage[+id+] > stage_current ; \
1277 echo stage[+id+] > stage_last; \
1278 $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)[+
1279 FOR host_modules +][+ IF bootstrap +]
1281 @cd $(HOST_SUBDIR); [ -d stage[+id+]-[+module+] ] || \
1282 mkdir stage[+id+]-[+module+]; \
1283 mv stage[+id+]-[+module+] [+module+] [+ IF prev +] ; \
1284 mv stage[+prev+]-[+module+] prev-[+module+] || test -f stage[+prev+]-lean [+ ENDIF prev +]
1285 @endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
1286 @[ -d stage[+id+]-$(TARGET_SUBDIR) ] || \
1287 mkdir stage[+id+]-$(TARGET_SUBDIR); \
1288 mv stage[+id+]-$(TARGET_SUBDIR) $(TARGET_SUBDIR) [+ IF prev +] ; \
1289 mv stage[+prev+]-$(TARGET_SUBDIR) prev-$(TARGET_SUBDIR) || test -f stage[+prev+]-lean [+ ENDIF prev +]
1291 stage[+id+]-end:: [+ FOR host_modules +][+ IF bootstrap +]
1293 @if test -d $(HOST_SUBDIR)/[+module+] ; then \
1294 cd $(HOST_SUBDIR); mv [+module+] stage[+id+]-[+module+] [+ IF prev +]; \
1295 mv prev-[+module+] stage[+prev+]-[+module+] ; : [+ ENDIF prev +] ; \
1297 @endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
1298 @if test -d $(TARGET_SUBDIR) ; then \
1299 mv $(TARGET_SUBDIR) stage[+id+]-$(TARGET_SUBDIR) [+ IF prev +] ; \
1300 mv prev-$(TARGET_SUBDIR) stage[+prev+]-$(TARGET_SUBDIR) ; : [+ ENDIF prev +] ; \
1304 # Bubble a bug fix through all the stages up to stage [+id+]. They are
1305 # remade, but not reconfigured. The next stage (if any) will not be
1306 # reconfigured as well.
1307 .PHONY: stage[+id+]-bubble
1308 stage[+id+]-bubble:: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +]
1309 @r=`${PWD_COMMAND}`; export r; \
1310 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1311 if test -f stage[+id+]-lean [+
1312 IF prev +]|| test -f stage[+prev+]-lean [+ ENDIF prev +] ; then \
1313 echo Skipping rebuild of stage[+id+] ; \
1315 $(MAKE) stage[+id+]-start; \[+IF lean +]
1317 rm -rf stage[+lean+]-* ; \
1318 $(STAMP) stage[+lean+]-lean ; \
1319 fi; \[+ ENDIF lean +]
1320 $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage[+id+]; \
1321 fi[+ IF compare-target +]
1322 $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+compare-target+][+ ENDIF compare-target +]
1324 .PHONY: all-stage[+id+] clean-stage[+id+]
1325 do-clean: clean-stage[+id+]
1327 # FIXME: Will not need to be conditional when toplevel bootstrap is the
1328 # only possibility, but now it conflicts with no-bootstrap rules
1330 [+ IF compare-target +]
1332 @r=`${PWD_COMMAND}`; export r; \
1333 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1334 if test -f stage[+prev+]-lean; then \
1335 echo Cannot compare object files as stage [+prev+] was deleted. ; \
1338 : $(MAKE); $(stage); \
1339 rm -f .bad_compare ; \
1340 echo Comparing stages [+prev+] and [+id+] ; \
1341 cd stage[+id+]-gcc; \
1342 files=`find . -name "*$(objext)" -print` ; \
1344 for file in $${files} ; do \
1345 f1=$$r/stage[+prev+]-gcc/$$file; f2=$$r/stage[+id+]-gcc/$$file; \
1346 $(do-[+compare-target+]) > /dev/null 2>&1; \
1347 if test $$? -eq 1; then \
1349 ./cc*-checksum$(objext) | ./libgcc/* ) \
1350 echo warning: $$file differs ;; \
1352 echo $$file differs >> .bad_compare ;; \
1356 if [ -f .bad_compare ]; then \
1357 echo "Bootstrap comparison failure!"; \
1361 echo Comparison successful.; \
1363 $(STAMP) [+compare-target+][+ IF prev +]
1365 rm -rf stage[+prev+]-*; \
1366 $(STAMP) stage[+prev+]-lean; \
1368 [+ ENDIF compare-target +]
1370 [+ IF bootstrap-target +]
1371 .PHONY: [+bootstrap-target+] [+bootstrap-target+]-lean
1372 [+bootstrap-target+]:
1373 echo stage[+id+] > stage_final
1374 @r=`${PWD_COMMAND}`; export r; \
1375 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1376 $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage[+id+]-bubble
1377 @: $(MAKE); $(unstage)
1378 @r=`${PWD_COMMAND}`; export r; \
1379 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1380 $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
1382 [+bootstrap-target+]-lean:
1383 echo stage[+id+] > stage_final
1384 @r=`${PWD_COMMAND}`; export r; \
1385 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1386 $(MAKE) $(RECURSE_FLAGS_TO_PASS) LEAN=: stage[+id+]-bubble
1387 @: $(MAKE); $(unstage)
1388 @r=`${PWD_COMMAND}`; export r; \
1389 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1390 $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
1391 [+ ENDIF bootstrap-target +]
1393 # Rules to wipe a stage and all the following ones, also used for cleanstrap
1394 [+ IF prev +]distclean-stage[+prev+]:: distclean-stage[+id+] [+ ENDIF prev +]
1395 .PHONY: distclean-stage[+id+]
1396 distclean-stage[+id+]::
1397 @: $(MAKE); $(stage)
1398 @test "`cat stage_last`" != stage[+id+] || rm -f stage_last
1399 rm -rf stage[+id+]-* [+
1400 IF compare-target +][+compare-target+] [+ ENDIF compare-target +]
1402 [+ IF cleanstrap-target +]
1403 .PHONY: [+cleanstrap-target+]
1404 [+cleanstrap-target+]: do-distclean local-clean
1405 echo stage[+id+] > stage_final
1406 @r=`${PWD_COMMAND}`; export r; \
1407 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1408 $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage[+id+]-bubble
1409 @: $(MAKE); $(unstage)
1410 @r=`${PWD_COMMAND}`; export r; \
1411 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1412 $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
1413 [+ ENDIF cleanstrap-target +]
1414 @endif gcc-bootstrap
1416 [+ ENDFOR bootstrap-stage +]
1419 $(MAKE) distclean-stagefeedback
1421 stagefeedback-start::
1422 @r=`${PWD_COMMAND}`; export r; \
1423 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
1424 for i in prev-*; do \
1425 j=`echo $$i | sed s/^prev-//` ; \
1427 { find . -type d | sort | sed 's,.*,$(SHELL) '"$$s"'/mkinstalldirs "../'$$j'/&",' | $(SHELL) ; } && \
1428 { find . -name '*.*da' | sed 's,.*,$(LN) -f "&" "../'$$j'/&",' | $(SHELL) ; } ; \
1432 do-distclean: distclean-stage1
1434 # Provide a GCC build when we're building target libraries. This does
1435 # not work as a dependency, just as the minimum necessary to avoid errors.
1437 $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage1-bubble
1439 # Same as unstage, but not phony and defaulting to stage1-start. We place
1440 # it in the dependency so that for example `make -j3 all-gcc' works.
1442 @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi
1446 @: $(MAKE); $(stage)
1447 rm -rf stage1-$(TARGET_SUBDIR) [+ FOR bootstrap-stage +][+ IF prev
1448 +]stage[+id+]-* [+ ENDIF prev +][+ ENDFOR bootstrap-stage +]
1449 $(MAKE) $(RECURSE_FLAGS_TO_PASS) all
1450 @endif gcc-bootstrap
1452 # --------------------------------------
1453 # Dependencies between different modules
1454 # --------------------------------------
1456 # Generic dependencies for target modules on host stuff, especially gcc
1457 @if gcc-bootstrap[+ FOR target_modules +][+ IF bootstrap
1458 +][+ FOR bootstrap_stage +]
1459 configure-stage[+id+]-target-[+module+]: maybe-all-stage[+id+]-gcc[+
1460 ENDFOR +][+ ELSE bootstrap +]
1461 configure-target-[+module+]: stage_last[+
1462 ENDIF bootstrap +][+ ENDFOR target_modules +]
1463 @endif gcc-bootstrap
1465 @if gcc-no-bootstrap[+ FOR target_modules +]
1466 configure-target-[+module+]: maybe-all-gcc[+
1467 ENDFOR target_modules +]
1468 @endif gcc-no-bootstrap
1471 # There are two types of dependencies here: 'hard' dependencies, where one
1472 # module simply won't build without the other; and 'soft' dependencies, where
1473 # if the depended-on module is missing, the depending module will do without
1474 # or find a substitute somewhere (perhaps installed). Soft dependencies
1475 # are made here to depend on a 'maybe-' target. If you're not sure,
1476 # it's safer to use a soft dependency.
1478 [+ ;; These Scheme functions build the bulk of the dependencies.
1479 ;; dep-target builds a string like "maybe-all-MODULE_KIND-gcc",
1480 ;; where "maybe-" is only included if HARD is true, and all-gcc
1481 ;; is taken from VAR-NAME.
1482 (define dep-target (lambda (module-kind var-name hard)
1484 (if hard "" "maybe-")
1485 (dep-subtarget var-name)
1487 (dep-module var-name)
1490 ;; make-dep builds a dependency from the MODULE and ON AutoGen vars.
1491 (define make-dep (lambda (module-kind on-kind)
1493 (dep-target module-kind "module" #t) ": "
1494 (dep-target on-kind "on" (exist? "hard")))))
1496 ;; dep-subtarget extracts everything up to the first dash in the given
1497 ;; AutoGen variable, for example it extracts "all-" out of "all-gcc".
1498 (define dep-subtarget (lambda (var-name)
1499 (substring (get var-name) 0 (+ 1 (string-index (get var-name) #\-)))))
1501 ;; dep-module extracts everything up to the first dash in the given
1502 ;; AutoGen variable, for example it extracts "gcc" out of "all-gcc".
1503 (define dep-module (lambda (var-name)
1504 (substring (get var-name) (+ 1 (string-index (get var-name) #\-)))))
1506 ;; dep-stage builds a string for the prefix of a bootstrap stage.
1507 (define dep-stage (lambda ()
1513 ;; dep-maybe is the same as the AutoGen expression "- hard 'maybe-'"
1514 ;; but is written in Scheme.
1515 (define dep-maybe (lambda ()
1516 (if (exist? "hard") "" "maybe-")))
1518 ;; dep-kind returns "normal" if the dependency is on an "install" target,
1519 ;; or if either module is not bootstrapped. It returns "bootstrap" for
1520 ;; configure or build dependencies between bootstrapped modules; it returns
1521 ;; "prebootstrap" for configure or build dependencies of bootstrapped
1522 ;; modules on a build module (e.g. all-gcc on all-build-bison). All this
1523 ;; is only necessary for host modules.
1524 (define dep-kind (lambda ()
1525 (if (and (hash-ref boot-modules (dep-module "module"))
1526 (=* (dep-module "on") "build-"))
1529 (if (or (= (dep-subtarget "on") "install-")
1530 (not (hash-ref boot-modules (dep-module "module")))
1531 (not (hash-ref boot-modules (dep-module "on"))))
1535 ;; We now build the hash table that is used by dep-kind.
1536 (define boot-modules (make-hash-table 113))
1539 [+ FOR host_modules +][+
1540 (if (exist? "bootstrap")
1541 (hash-create-handle! boot-modules (get "module") #t))
1542 "" +][+ ENDFOR host_modules +]
1543 [+ FOR target_modules +][+
1544 (if (exist? "bootstrap")
1545 (hash-create-handle! boot-modules (string-append "target-" (get "module")) #t))
1546 "" +][+ ENDFOR target_modules +]
1548 # With all the machinery above in place, it is pretty easy to generate
1549 # dependencies. Host dependencies are a bit more complex because we have
1550 # to check for bootstrap/prebootstrap dependencies. To resolve
1551 # prebootstrap dependencies, prebootstrap modules are gathered in
1553 [+ FOR dependencies +][+ (make-dep "" "") +]
1554 [+ CASE (dep-kind) +]
1555 [+ == "prebootstrap"
1556 +][+ FOR bootstrap_stage +]
1557 [+ (make-dep (dep-stage) "") +][+
1558 ENDFOR bootstrap_stage +]
1560 +][+ FOR bootstrap_stage +]
1561 [+ (make-dep (dep-stage) (dep-stage)) +][+
1562 ENDFOR bootstrap_stage +]
1564 ENDFOR dependencies +]
1566 # Dependencies for target modules on other target modules are
1567 # described by lang_env_dependencies; the defaults apply to anything
1568 # not mentioned there.
1570 ;; Predicate for whether LANG was specified in lang_env_dependencies.
1571 (define lang-dep (lambda (lang)
1572 (hash-ref lang-env-deps (string-append (get "module") "-" lang))))
1574 ;; Build the hash table we will need.
1575 (define lang-env-deps (make-hash-table 7))
1576 +][+ FOR lang_env_dependencies +][+
1578 (hash-create-handle! lang-env-deps
1579 (string-append (get "module") "-" "cxx") #t))
1582 (hash-create-handle! lang-env-deps
1583 (string-append (get "module") "-" "no_c") #t))
1585 (if (exist? "no_gcc")
1586 (hash-create-handle! lang-env-deps
1587 (string-append (get "module") "-" "no_gcc") #t))
1588 "" +][+ ENDFOR lang_env_dependencies +]
1590 @if gcc-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc"))
1591 +][+ IF bootstrap +][+ FOR bootstrap_stage +]
1592 configure-stage[+id+]-target-[+module+]: maybe-all-stage[+id+]-target-libgcc[+
1593 ENDFOR +][+ ENDIF bootstrap +][+ ENDIF +][+ ENDFOR target_modules +]
1594 @endif gcc-bootstrap
1596 @if gcc-no-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc")) +]
1597 configure-target-[+module+]: maybe-all-target-libgcc[+
1598 ENDIF +][+ ENDFOR target_modules +]
1599 @endif gcc-no-bootstrap
1601 [+ FOR target_modules +][+ IF (not (lang-dep "no_c")) +]
1602 configure-target-[+module+]: maybe-all-target-newlib maybe-all-target-libgloss[+
1603 ENDIF +][+ IF (lang-dep "cxx") +]
1604 configure-target-[+module+]: maybe-all-target-libstdc++-v3[+
1606 [+ ENDFOR target_modules +]
1608 CONFIGURE_GDB_TK = @CONFIGURE_GDB_TK@
1610 INSTALL_GDB_TK = @INSTALL_GDB_TK@
1611 configure-gdb: $(CONFIGURE_GDB_TK)
1612 all-gdb: $(gdbnlmrequirements) $(GDB_TK)
1613 install-gdb: $(INSTALL_GDB_TK)
1615 # Serialization dependencies. Host configures don't work well in parallel to
1616 # each other, due to contention over config.cache. Target configures and
1617 # build configures are similar.
1618 @serialization_dependencies@
1620 # --------------------------------
1621 # Regenerating top level configury
1622 # --------------------------------
1624 # Rebuilding Makefile.in, using autogen.
1626 $(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def
1627 cd $(srcdir) && $(AUTOGEN) Makefile.def
1629 # Rebuilding Makefile.
1630 Makefile: $(srcdir)/Makefile.in config.status
1631 CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
1633 config.status: configure
1634 CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck
1636 # Rebuilding configure.
1638 $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4
1639 cd $(srcdir) && $(AUTOCONF)
1641 # ------------------------------
1642 # Special directives to GNU Make
1643 # ------------------------------
1645 # Don't pass command-line variables to submakes.
1649 # end of Makefile.in