#
# Makefile for directory with subdirs to build.
# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-# 1999, 2000, 2001, 2002, 2003 Free Software Foundation
+# 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# This is set by the configure script to the arguments to use when configuring
# directories built for the build system.
BUILD_CONFIGARGS = @build_configargs@
+# This is the list of variables to export in the environment when
+# configuring subdirectories for the build system. It must also be
+# exported whenever recursing into a build directory in case that
+# directory's Makefile re-runs configure.
+BUILD_EXPORTS = \
+ AR="$(AR_FOR_BUILD)"; export AR; \
+ AS="$(AS_FOR_BUILD)"; export AS; \
+ CC="$(CC_FOR_BUILD)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+ CXX="$(CXX_FOR_BUILD)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
+ GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
+ DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
+ LD="$(LD_FOR_BUILD)"; export LD; \
+ LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
+ NM="$(NM_FOR_BUILD)"; export NM; \
+ RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES;
# This is the list of directories to built for the host system.
SUBDIRS = @configdirs@
# This is set by the configure script to the arguments to use when configuring
# directories built for the host system.
HOST_CONFIGARGS = @host_configargs@
+# This is the list of variables to export in the environment when
+# configuring subdirectories for the host system. It must also be
+# exported whenever recursing into a host directory in case that
+# directory's Makefile re-runs configure.
+HOST_EXPORTS = \
+ CC="$(CC)"; export CC; \
+ CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+ CXX="$(CXX)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
+ AR="$(AR)"; export AR; \
+ AS="$(AS)"; export AS; \
+ CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
+ DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
+ LD="$(LD)"; export LD; \
+ LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \
+ NM="$(NM)"; export NM; \
+ RANLIB="$(RANLIB)"; export RANLIB; \
+ WINDRES="$(WINDRES)"; export WINDRES; \
+ OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
+ OBJDUMP="$(OBJDUMP)"; export OBJDUMP;
+
+# Similar, for the gcc directory.
+GCC_HOST_EXPORTS = \
+ $(HOST_EXPORTS) \
+ TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
+ GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
+ GMPINC="$(HOST_GMPINC)"; export GMPINC;
+
+# Similar, for later GCC stages.
+STAGE_HOST_EXPORTS = \
+ $(GCC_HOST_EXPORTS) \
+ CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \
+ CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC_FOR_BUILD;
# This is set by the configure script to the list of directories which
# should be built using the target tools.
# This is set by the configure script to the arguments to use when configuring
# directories built for the target.
TARGET_CONFIGARGS = @target_configargs@
+# This is the list of variables to export in the environment when
+# configuring subdirectories for the host system. It must also be
+# exported whenever recursing into a host directory in case that
+# directory's Makefile re-runs configure.
+BASE_TARGET_EXPORTS = \
+ AR="$(AR_FOR_TARGET)"; export AR; \
+ AS="$(AS_FOR_TARGET)"; export AS; \
+ CC="$(CC_FOR_TARGET)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+ CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+ GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+ GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \
+ DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+ LD="$(LD_FOR_TARGET)"; export LD; \
+ LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
+ NM="$(NM_FOR_TARGET)"; export NM; \
+ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES;
+
+RAW_CXX_TARGET_EXPORTS = \
+ $(BASE_TARGET_EXPORTS) \
+ CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
+ CXX="$(RAW_CXX_FOR_TARGET)"; export CXX;
+
+NORMAL_TARGET_EXPORTS = \
+ $(BASE_TARGET_EXPORTS) \
+ CXX="$(CXX_FOR_TARGET)"; export CXX;
# Where to find GMP
HOST_GMPLIBS = @gmplibs@
# The first rule in the file had better be this one. Don't put any above it.
# This lives here to allow makefile fragments to contain dependencies.
-all: all.normal
-.PHONY: all
+@default_target@:
#### host and target specific makefile fragments come in here.
@target_makefile_frag@
maybe-configure-target-[+module+][+
ENDFOR target_modules +]
-# The target built for a native build.
-.PHONY: all.normal
-all.normal: @all_build_modules@ all-host all-target
+# The target built for a native non-bootstrap build.
+.PHONY: all
+all: @all_build_modules@ all-host all-target
.PHONY: all-host
all-host: maybe-all-gcc [+
@if [ -f ./gcc/Makefile ] ; then \
r=`${PWD_COMMAND}` ; export r ; \
$(SET_LIB_PATH) \
+ $(GCC_HOST_EXPORTS) \
(cd ./gcc && \
$(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
else \
$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/[+module+] ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
- AR="$(AR_FOR_BUILD)"; export AR; \
- AS="$(AS_FOR_BUILD)"; export AS; \
- CC="$(CC_FOR_BUILD)"; export CC; \
- CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
- CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
- CXX="$(CXX_FOR_BUILD)"; export CXX; \
- CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
- GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
- GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
- DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
- LD="$(LD_FOR_BUILD)"; export LD; \
- LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
- NM="$(NM_FOR_BUILD)"; export NM; \
- RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
- WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
+ $(BUILD_EXPORTS) \
echo Configuring in $(BUILD_SUBDIR)/[+module+]; \
cd "$(BUILD_SUBDIR)/[+module+]" || exit 1; \
case $(srcdir) in \
all-build-[+module+]: configure-build-[+module+]
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(BUILD_EXPORTS) \
(cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) all)
@endif build-[+module+]
[+ ENDFOR build_modules +]
[ -d [+module+] ] || mkdir [+module+]; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
- CC="$(CC)"; export CC; \
- CFLAGS="$(CFLAGS)"; export CFLAGS; \
- CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
- CXX="$(CXX)"; export CXX; \
- CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
- AR="$(AR)"; export AR; \
- AS="$(AS)"; export AS; \
- CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
- DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
- LD="$(LD)"; export LD; \
- LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \
- NM="$(NM)"; export NM; \
- RANLIB="$(RANLIB)"; export RANLIB; \
- WINDRES="$(WINDRES)"; export WINDRES; \
- OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
- OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+ $(HOST_EXPORTS) \
echo Configuring in [+module+]; \
cd [+module+] || exit 1; \
case $(srcdir) in \
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
+ $(HOST_EXPORTS) \
(cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+
IF with_x
+] $(X11_FLAGS_TO_PASS)[+
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
+ $(HOST_EXPORTS) \
(cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+
IF with_x
+] $(X11_FLAGS_TO_PASS)[+
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
+ $(HOST_EXPORTS) \
(cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+
IF with_x
+] $(X11_FLAGS_TO_PASS)[+
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
+ $(HOST_EXPORTS) \
(cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+
IF with_x
+] $(X11_FLAGS_TO_PASS)[+
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
+ $(HOST_EXPORTS) \
for flag in $(EXTRA_HOST_FLAGS); do \
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
done; \
$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/[+module+] ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
- $(SET_LIB_PATH) \
- AR="$(AR_FOR_TARGET)"; export AR; \
- AS="$(AS_FOR_TARGET)"; export AS; \
- CC="$(CC_FOR_TARGET)"; export CC; \
- CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
- CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
- CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \[+
+ $(SET_LIB_PATH) \[+
IF raw_cxx +]
- CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
- CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \[+
+ $(RAW_CXX_TARGET_EXPORTS) \[+
ELSE normal_cxx +]
- CXX="$(CXX_FOR_TARGET)"; export CXX; \[+
+ $(NORMAL_TARGET_EXPORTS) \[+
ENDIF raw_cxx +]
- CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
- GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
- GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \
- DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
- LD="$(LD_FOR_TARGET)"; export LD; \
- LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
- NM="$(NM_FOR_TARGET)"; export NM; \
- RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
- WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
echo Configuring in $(TARGET_SUBDIR)/[+module+]; \
cd "$(TARGET_SUBDIR)/[+module+]" || exit 1; \
case $(srcdir) in \
all-target-[+module+]: configure-target-[+module+]
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
- $(SET_LIB_PATH) \
+ $(SET_LIB_PATH) \[+
+IF raw_cxx +]
+ $(RAW_CXX_TARGET_EXPORTS) \[+
+ELSE normal_cxx +]
+ $(NORMAL_TARGET_EXPORTS) \[+
+ENDIF raw_cxx +]
(cd $(TARGET_SUBDIR)/[+module+] && \
$(MAKE) $(TARGET_FLAGS_TO_PASS) [+
IF raw_cxx
check-target-[+module+]:
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
- $(SET_LIB_PATH) \
+ $(SET_LIB_PATH) \[+
+IF raw_cxx +]
+ $(RAW_CXX_TARGET_EXPORTS) \[+
+ELSE normal_cxx +]
+ $(NORMAL_TARGET_EXPORTS) \[+
+ENDIF raw_cxx +]
(cd $(TARGET_SUBDIR)/[+module+] && \
$(MAKE) $(TARGET_FLAGS_TO_PASS) [+
IF raw_cxx
install-target-[+module+]: installdirs
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
- $(SET_LIB_PATH) \
+ $(SET_LIB_PATH) \[+
+IF raw_cxx +]
+ $(RAW_CXX_TARGET_EXPORTS) \[+
+ELSE normal_cxx +]
+ $(NORMAL_TARGET_EXPORTS) \[+
+ENDIF raw_cxx +]
(cd $(TARGET_SUBDIR)/[+module+] && \
$(MAKE) $(TARGET_FLAGS_TO_PASS) install)
[+ ENDIF no_install +]
@[ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] || exit 0 ; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
- $(SET_LIB_PATH) \
+ $(SET_LIB_PATH) \[+
+IF raw_cxx +]
+ $(RAW_CXX_TARGET_EXPORTS) \[+
+ELSE normal_cxx +]
+ $(NORMAL_TARGET_EXPORTS) \[+
+ENDIF raw_cxx +]
echo "Doing [+make_target+] in $(TARGET_SUBDIR)/[+module+]" ; \
for flag in $(EXTRA_TARGET_FLAGS); do \
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@if gcc
maybe-configure-gcc: configure-gcc
configure-gcc:
+@endif gcc
+@if gcc-no-bootstrap
@test ! -f gcc/Makefile || exit 0; \
- [ -f stage_last ] && exit 0; \
[ -d gcc ] || mkdir gcc; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
- CC="$(CC)"; export CC; \
- CFLAGS="$(CFLAGS)"; export CFLAGS; \
- CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
- CXX="$(CXX)"; export CXX; \
- CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
- TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
- AR="$(AR)"; export AR; \
- AS="$(AS)"; export AS; \
- CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
- DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
- LD="$(LD)"; export LD; \
- LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \
- NM="$(NM)"; export NM; \
- RANLIB="$(RANLIB)"; export RANLIB; \
- WINDRES="$(WINDRES)"; export WINDRES; \
- OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
- OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
- GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
- GMPINC="$(HOST_GMPINC)"; export GMPINC; \
+ $(GCC_HOST_EXPORTS) \
echo Configuring in gcc; \
cd gcc || exit 1; \
case $(srcdir) in \
$(SHELL) $${libsrcdir}/configure \
$(HOST_CONFIGARGS) $${srcdiroption} \
|| exit 1
-@endif gcc
+@endif gcc-no-bootstrap
# Don't 'make all' in gcc if it's already been made by 'bootstrap'; that
# causes trouble. This wart will be fixed eventually by moving
@if gcc
maybe-all-gcc: all-gcc
all-gcc: configure-gcc
+@endif gcc
+@if gcc-no-bootstrap
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
- if [ -f stage_last ] ; then \
- true ; \
- elif [ -f gcc/stage_last ] ; then \
- $(SET_LIB_PATH) \
+ $(SET_LIB_PATH) \
+ $(GCC_HOST_EXPORTS) \
+ if [ -f gcc/stage_last ] ; then \
(cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) quickstrap); \
else \
- $(SET_LIB_PATH) \
(cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
fi
-@endif gcc
# Building GCC uses some tools for rebuilding "source" files
# like texinfo, bison/byacc, etc. So we must depend on those.
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
+ $(GCC_HOST_EXPORTS) \
echo "Bootstrapping the compiler"; \
cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@
@r=`${PWD_COMMAND}`; export r; \
compare=compare ;; \
esac; \
$(SET_LIB_PATH) \
+ $(GCC_HOST_EXPORTS) \
echo "$$msg"; \
cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
@r=`${PWD_COMMAND}`; export r; \
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
+ $(GCC_HOST_EXPORTS) \
echo "Bootstrapping the compiler"; \
cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build
@r=`${PWD_COMMAND}`; export r; \
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
+ $(GCC_HOST_EXPORTS) \
echo "Building feedback based compiler"; \
cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
+ $(GCC_HOST_EXPORTS) \
echo "Building the C and C++ compiler"; \
cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
@r=`${PWD_COMMAND}`; export r; \
$(SET_LIB_PATH) \
echo "Building runtime libraries"; \
$(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
- LANGUAGES="c c++" all
+ LANGUAGES="c c++" all
+@endif gcc-no-bootstrap
.PHONY: check-gcc maybe-check-gcc
maybe-check-gcc:
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
+ $(GCC_HOST_EXPORTS) \
(cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
else \
true; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
+ $(GCC_HOST_EXPORTS) \
(cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
else \
true; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
+ $(GCC_HOST_EXPORTS) \
(cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
else \
true; \
r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
$(SET_LIB_PATH) \
+ $(GCC_HOST_EXPORTS) \
(cd ./gcc && \
$(MAKE) $(GCC_FLAGS_TO_PASS) install); \
rm -rf gcc/include; \
for flag in $(EXTRA_GCC_FLAGS); do \
eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
done; \
+ $(GCC_HOST_EXPORTS) \
echo "Doing [+make_target+] in gcc" ; \
(cd gcc && \
$(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
[+ ENDFOR recursive_targets +]
+@if gcc-bootstrap
# ---------------------
# GCC bootstrap support
# ---------------------
# Real targets act phony if they depend on phony targets; this hack
# prevents gratuitous rebuilding of stage 1.
prebootstrap:
- $(MAKE) all-bootstrap
+ $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all-bootstrap
$(STAMP) prebootstrap
# Flags to pass to stage2 and later makes.
# * We build only C (and possibly Ada).
[+ FOR bootstrap-stage +]
-.PHONY: new-stage[+id+]-start new-stage[+id+]-end
+.PHONY: stage[+id+]-start stage[+id+]-end
-new-stage[+id+]-start:
- [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+stage[+id+]-start:
+ [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
echo stage[+id+] > stage_last ; \
[ -d stage[+id+]-gcc ] || mkdir stage[+id+]-gcc; \
set stage[+id+]-gcc gcc ; @CREATE_LINK_TO_DIR@ [+ IF prev +] ; \
set stage[+prev+]-gcc prev-gcc ; @CREATE_LINK_TO_DIR@ [+ ENDIF prev +]
-new-stage[+id+]-end:
+stage[+id+]-end:
rm -f stage_last ; \
set gcc stage[+id+]-gcc ; @UNDO_LINK_TO_DIR@ [+ IF prev +] ; \
set prev-gcc stage[+prev+]-gcc ; @UNDO_LINK_TO_DIR@ [+ ENDIF prev +]
# Bubble a bugfix through all the stages up to stage [+id+]. They
# are remade, but not reconfigured. The next stage (if any) will not
# be reconfigured as well.
-.PHONY: new-stage[+id+]-bubble
-new-stage[+id+]-bubble: [+ IF prev +]new-stage[+prev+]-bubble[+ ENDIF +]
+.PHONY: stage[+id+]-bubble
+stage[+id+]-bubble: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +]
@if [ -f all-stage[+id+]-gcc ] ; then \
echo Remaking stage [+id+] ; \
rm -f all-stage[+id+]-gcc ; \
- $(MAKE) all-stage[+id+]-gcc [+ IF next +] && \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
+ all-stage[+id+]-gcc [+ IF next +] && \
if [ -f configure-stage[+next+]-gcc ] ; then \
$(STAMP) configure-stage[+next+]-gcc ; \
fi [+ ENDIF next +]; \
else \
- $(MAKE) all-stage[+id+]-gcc ; \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all-stage[+id+]-gcc ; \
fi
configure-stage[+id+]-gcc: [+ IF prev +] all-stage[+prev+]-gcc [+
ELSE +] prebootstrap [+ ENDIF prev +]
- $(MAKE) new-stage[+id+]-start
+ $(MAKE) stage[+id+]-start
@if [ -f stage[+id+]-gcc/Makefile ] ; then \
$(STAMP) configure-stage[+id+]-gcc ; \
exit 0; \
true ; \
fi ; \
r=`${PWD_COMMAND}`; export r; \
- s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
- CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
- TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
- CFLAGS="$(CFLAGS)"; export CFLAGS; \
- CXX="$(CXX)"; export CXX; \
- CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
- AR="$(AR)"; export AR; \
- AS="$(AS)"; export AS; \
- DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
- LD="$(LD)"; export LD; \
- LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \
- NM="$(NM)"; export NM; \
- RANLIB="$(RANLIB)"; export RANLIB; \
- WINDRES="$(WINDRES)"; export WINDRES; \
- OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
- OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
- GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
- GMPINC="$(HOST_GMPINC)"; export GMPINC [+ IF prev +] ; \
- CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \
- CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC_FOR_BUILD [+ ELSE +] ; \
- CC="$(CC)"; export CC; \
- CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD [+ ENDIF prev +] ; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \
+ $(STAGE_HOST_EXPORTS) [+ ELSE prev +] \
+ $(GCC_HOST_EXPORTS) [+ ENDIF prev +] \
echo Configuring stage [+id+] in gcc ; \
cd gcc || exit 1; \
case $(srcdir) in \
$(STAMP) ../configure-stage[+id+]-gcc
all-stage[+id+]-gcc: configure-stage[+id+]-gcc
- $(MAKE) new-stage[+id+]-start
+ $(MAKE) stage[+id+]-start
@r=`${PWD_COMMAND}`; export r; \
- s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \
+ $(STAGE_HOST_EXPORTS) [+ ELSE prev +] \
+ $(GCC_HOST_EXPORTS) [+ ENDIF prev +] \
cd gcc && \
$(MAKE) $(GCC_FLAGS_TO_PASS) [+ IF prev +] \
- CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/" \
- CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/" \
+ CC="$${CC}" CC_FOR_BUILD="${CC_FOR_BUILD}" \
STAGE_PREFIX=$$r/stage[+prev+]-gcc/ [+ ENDIF prev +] \
[+extra_make_flags+] && $(STAMP) ../all-stage[+id+]-gcc
[+ IF compare-target +]
[+compare-target+]: all-stage[+id+]-gcc
- [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+ [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
rm -f .bad_compare ; \
[+ IF bootstrap-target +]
.PHONY: [+bootstrap-target+]
[+bootstrap-target+]:
- $(MAKE) new-stage[+id+]-bubble [+
+ $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) stage[+id+]-bubble [+
IF compare-target +] [+compare-target+] [+
ENDIF compare-target +] \
- new-stage[+id+]-start all new-stage[+id+]-end
+ stage[+id+]-start all stage[+id+]-end
[+ ENDIF bootstrap-target +]
-.PHONY: new-restage[+id+] distclean-stage[+id+]
+.PHONY: restage[+id+] distclean-stage[+id+]
distclean-stage[+id+]: [+ IF next +] distclean-stage[+next+] [+ ENDIF next +]
- [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+ [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
rm -rf configure-stage[+id+]-gcc all-stage[+id+]-gcc stage[+id+]-gcc [+
IF compare-target +][+compare-target+] [+ ENDIF compare-target +]
-new-restage[+id+]: [+ IF next +] distclean-stage[+next+] [+ ENDIF next +]
+restage[+id+]: [+ IF next +] distclean-stage[+next+] [+ ENDIF next +]
rm -rf all-stage[+id+]-gcc [+
IF compare-target +][+compare-target+] [+ ENDIF compare-target +]
- $(MAKE) [+
+ $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) [+
IF compare-target +][+compare-target+] [+
ELSE +] all-stage[+id+]-gcc [+ ENDIF compare-target +]
[+ ENDIF cleanstrap-target +]
[+ ENDFOR bootstrap-stage +]
+@endif gcc-bootstrap
# --------------------------------------
# Dependencies between different modules