INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_DATA = @INSTALL_DATA@
+LN = @LN@
+LN_S = @LN_S@
# -------------------------------------------------
# Miscellaneous non-standard autoconf-set variables
# 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@
CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \
RAW_CXX_FOR_TARGET='$(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \
+RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS)
+
# Flags to pass down to most sub-makes, in which we're building with
# the host environment.
EXTRA_HOST_FLAGS = \
maybe-configure-target-rda \
maybe-configure-target-libada
-# 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 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; \
$(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; \
+ $(SET_LIB_PATH) \
$(GCC_HOST_EXPORTS) \
- if [ -f stage_last ] ; then \
- true ; \
- elif [ -f gcc/stage_last ] ; then \
- $(SET_LIB_PATH) \
+ 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.
s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
$(SET_LIB_PATH) \
echo "Building runtime libraries"; \
- $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) all
profiledbootstrap: all-bootstrap configure-gcc
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
$(SET_LIB_PATH) \
echo "Building runtime libraries and training compiler"; \
- $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) all
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
$(SET_LIB_PATH) \
echo "Building runtime libraries"; \
- $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
- LANGUAGES="c c++" all
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) LANGUAGES="c c++" all
+@endif gcc-no-bootstrap
.PHONY: check-gcc maybe-check-gcc
maybe-check-gcc:
+@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) $(RECURSE_FLAGS_TO_PASS) all-bootstrap
$(STAMP) prebootstrap
# Flags to pass to stage2 and later makes.
BOOT_CFLAGS= -g -O2
POSTSTAGE1_FLAGS_TO_PASS = \
+ CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
+ STAGE_PREFIX=$$r/stage-gcc/ \
CFLAGS="$(BOOT_CFLAGS)" \
ADAC="\$$(CC)"
# * We build only C (and possibly Ada).
-.PHONY: new-stage1-start new-stage1-end
+.PHONY: stage1-start stage1-end
-new-stage1-start:
- [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+stage1-start::
+ [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
echo stage1 > stage_last ; \
[ -d stage1-gcc ] || mkdir stage1-gcc; \
set stage1-gcc gcc ; @CREATE_LINK_TO_DIR@
-new-stage1-end:
+stage1-end::
rm -f stage_last ; \
set gcc stage1-gcc ; @UNDO_LINK_TO_DIR@
# Bubble a bugfix through all the stages up to stage 1. They
# are remade, but not reconfigured. The next stage (if any) will not
# be reconfigured as well.
-.PHONY: new-stage1-bubble
-new-stage1-bubble:
+.PHONY: stage1-bubble
+stage1-bubble::
@if [ -f all-stage1-gcc ] ; then \
echo Remaking stage 1 ; \
rm -f all-stage1-gcc ; \
- $(MAKE) all-stage1-gcc && \
- if [ -f configure-stage2-gcc ] ; then \
- $(STAMP) configure-stage2-gcc ; \
- fi ; \
- else \
- $(MAKE) all-stage1-gcc ; \
- fi
+ fi ; \
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage1-gcc
+
+
configure-stage1-gcc: prebootstrap
- $(MAKE) new-stage1-start
+ $(MAKE) stage1-start
@if [ -f stage1-gcc/Makefile ] ; then \
$(STAMP) configure-stage1-gcc ; \
exit 0; \
$(STAMP) ../configure-stage1-gcc
all-stage1-gcc: configure-stage1-gcc
- $(MAKE) new-stage1-start
+ $(MAKE) stage1-start
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(GCC_HOST_EXPORTS) \
-.PHONY: new-restage1 distclean-stage1
+.PHONY: restage1 touch-stage1 distclean-stage1
+
+# Rules to wipe a stage and all the following ones, used for cleanstrap
-distclean-stage1: distclean-stage2
- [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+distclean-stage1::
+ [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
rm -rf configure-stage1-gcc all-stage1-gcc stage1-gcc
-new-restage1: distclean-stage2
+# Rules to renew the timestamp on a stage and all the following ones
+
+touch-stage1::
+ @[ -f configure-stage1-gcc ] && \
+ echo '$(STAMP) configure-stage1-gcc' && \
+ $(STAMP) configure-stage1-gcc; \
+ [ -f all-stage1-gcc ] && \
+ echo '$(STAMP) all-stage1-gcc' && \
+ $(STAMP) all-stage1-gcc; \
+ :
+
+# After building a stage, touch the following ones
+
+restage1::
rm -rf all-stage1-gcc
- $(MAKE) all-stage1-gcc
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage1-gcc
-.PHONY: new-stage2-start new-stage2-end
+.PHONY: stage2-start stage2-end
-new-stage2-start:
- [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+stage2-start::
+ [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
echo stage2 > stage_last ; \
[ -d stage2-gcc ] || mkdir stage2-gcc; \
set stage2-gcc gcc ; @CREATE_LINK_TO_DIR@ ; \
set stage1-gcc prev-gcc ; @CREATE_LINK_TO_DIR@
-new-stage2-end:
+stage2-end::
rm -f stage_last ; \
set gcc stage2-gcc ; @UNDO_LINK_TO_DIR@ ; \
set prev-gcc stage1-gcc ; @UNDO_LINK_TO_DIR@
# Bubble a bugfix through all the stages up to stage 2. They
# are remade, but not reconfigured. The next stage (if any) will not
# be reconfigured as well.
-.PHONY: new-stage2-bubble
-new-stage2-bubble: new-stage1-bubble
+.PHONY: stage2-bubble
+stage2-bubble:: stage1-bubble
@if [ -f all-stage2-gcc ] ; then \
echo Remaking stage 2 ; \
rm -f all-stage2-gcc ; \
- $(MAKE) all-stage2-gcc && \
- if [ -f configure-stage3-gcc ] ; then \
- $(STAMP) configure-stage3-gcc ; \
- fi ; \
- else \
- $(MAKE) all-stage2-gcc ; \
+ fi ; \
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage2-gcc
+
+
+stage1-bubble::
+ @if [ -f configure-stage2-gcc ] ; then \
+ $(STAMP) configure-stage2-gcc ; \
fi
+
configure-stage2-gcc: all-stage1-gcc
- $(MAKE) new-stage2-start
+ $(MAKE) stage2-start
@if [ -f stage2-gcc/Makefile ] ; then \
$(STAMP) configure-stage2-gcc ; \
exit 0; \
$(STAMP) ../configure-stage2-gcc
all-stage2-gcc: configure-stage2-gcc
- $(MAKE) new-stage2-start
+ $(MAKE) stage2-start
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(STAGE_HOST_EXPORTS) \
cd gcc && \
$(MAKE) $(GCC_FLAGS_TO_PASS) \
- CC="$${CC}" CC_FOR_BUILD="${CC_FOR_BUILD}" \
- STAGE_PREFIX=$$r/stage1-gcc/ \
- $(POSTSTAGE1_FLAGS_TO_PASS) && $(STAMP) ../all-stage2-gcc
+ $(POSTSTAGE1_FLAGS_TO_PASS) \
+ && $(STAMP) ../all-stage2-gcc
+
+.PHONY: bootstrap2
+bootstrap2:
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage2-bubble \
+ stage2-start all stage2-end
-.PHONY: new-restage2 distclean-stage2
+.PHONY: restage2 touch-stage2 distclean-stage2
-distclean-stage2: distclean-stage3
- [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+# Rules to wipe a stage and all the following ones, used for cleanstrap
+distclean-stage1:: distclean-stage2
+distclean-stage2::
+ [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
rm -rf configure-stage2-gcc all-stage2-gcc stage2-gcc
-new-restage2: distclean-stage3
+# Rules to renew the timestamp on a stage and all the following ones
+touch-stage1:: touch-stage2
+touch-stage2::
+ @[ -f configure-stage2-gcc ] && \
+ echo '$(STAMP) configure-stage2-gcc' && \
+ $(STAMP) configure-stage2-gcc; \
+ [ -f all-stage2-gcc ] && \
+ echo '$(STAMP) all-stage2-gcc' && \
+ $(STAMP) all-stage2-gcc; \
+ :
+
+# After building a stage, touch the following ones
+restage1:: touch-stage2
+restage2::
rm -rf all-stage2-gcc
- $(MAKE) all-stage2-gcc
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage2-gcc
-.PHONY: new-stage3-start new-stage3-end
+.PHONY: stage3-start stage3-end
-new-stage3-start:
- [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+stage3-start::
+ [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
echo stage3 > stage_last ; \
[ -d stage3-gcc ] || mkdir stage3-gcc; \
set stage3-gcc gcc ; @CREATE_LINK_TO_DIR@ ; \
set stage2-gcc prev-gcc ; @CREATE_LINK_TO_DIR@
-new-stage3-end:
+stage3-end::
rm -f stage_last ; \
set gcc stage3-gcc ; @UNDO_LINK_TO_DIR@ ; \
set prev-gcc stage2-gcc ; @UNDO_LINK_TO_DIR@
# Bubble a bugfix through all the stages up to stage 3. They
# are remade, but not reconfigured. The next stage (if any) will not
# be reconfigured as well.
-.PHONY: new-stage3-bubble
-new-stage3-bubble: new-stage2-bubble
+.PHONY: stage3-bubble
+stage3-bubble:: stage2-bubble
@if [ -f all-stage3-gcc ] ; then \
echo Remaking stage 3 ; \
rm -f all-stage3-gcc ; \
- $(MAKE) all-stage3-gcc ; \
- else \
- $(MAKE) all-stage3-gcc ; \
+ fi ; \
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage3-gcc
+
+
+stage2-bubble::
+ @if [ -f configure-stage3-gcc ] ; then \
+ $(STAMP) configure-stage3-gcc ; \
fi
+
configure-stage3-gcc: all-stage2-gcc
- $(MAKE) new-stage3-start
+ $(MAKE) stage3-start
@if [ -f stage3-gcc/Makefile ] ; then \
$(STAMP) configure-stage3-gcc ; \
exit 0; \
$(STAMP) ../configure-stage3-gcc
all-stage3-gcc: configure-stage3-gcc
- $(MAKE) new-stage3-start
+ $(MAKE) stage3-start
@r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(STAGE_HOST_EXPORTS) \
cd gcc && \
$(MAKE) $(GCC_FLAGS_TO_PASS) \
- CC="$${CC}" CC_FOR_BUILD="${CC_FOR_BUILD}" \
- STAGE_PREFIX=$$r/stage2-gcc/ \
- $(POSTSTAGE1_FLAGS_TO_PASS) && $(STAMP) ../all-stage3-gcc
+ $(POSTSTAGE1_FLAGS_TO_PASS) \
+ && $(STAMP) ../all-stage3-gcc
compare: all-stage3-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 ; \
-.PHONY: new-bootstrap
-new-bootstrap:
- $(MAKE) new-stage3-bubble compare \
- new-stage3-start all new-stage3-end
+.PHONY: bootstrap
+bootstrap:
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage3-bubble compare \
+ stage3-start all stage3-end
-.PHONY: new-restage3 distclean-stage3
+.PHONY: restage3 touch-stage3 distclean-stage3
-distclean-stage3:
- [ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || :
+# Rules to wipe a stage and all the following ones, used for cleanstrap
+distclean-stage2:: distclean-stage3
+distclean-stage3::
+ [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
rm -rf configure-stage3-gcc all-stage3-gcc stage3-gcc compare
-new-restage3:
+# Rules to renew the timestamp on a stage and all the following ones
+touch-stage2:: touch-stage3
+touch-stage3::
+ @[ -f configure-stage3-gcc ] && \
+ echo '$(STAMP) configure-stage3-gcc' && \
+ $(STAMP) configure-stage3-gcc; \
+ [ -f all-stage3-gcc ] && \
+ echo '$(STAMP) all-stage3-gcc' && \
+ $(STAMP) all-stage3-gcc; \
+ :
+
+# After building a stage, touch the following ones
+restage2:: touch-stage3
+restage3::
rm -rf all-stage3-gcc compare
- $(MAKE) compare
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) compare
+
+
+.PHONY: cleanstrap
+cleanstrap: distclean-stage1 bootstrap
+
+
+
+.PHONY: stage4-start stage4-end
+
+stage4-start::
+ [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+ echo stage4 > stage_last ; \
+ [ -d stage4-gcc ] || mkdir stage4-gcc; \
+ set stage4-gcc gcc ; @CREATE_LINK_TO_DIR@ ; \
+ set stage3-gcc prev-gcc ; @CREATE_LINK_TO_DIR@
+
+stage4-end::
+ rm -f stage_last ; \
+ set gcc stage4-gcc ; @UNDO_LINK_TO_DIR@ ; \
+ set prev-gcc stage3-gcc ; @UNDO_LINK_TO_DIR@
+
+# Bubble a bugfix through all the stages up to stage 4. They
+# are remade, but not reconfigured. The next stage (if any) will not
+# be reconfigured as well.
+.PHONY: stage4-bubble
+stage4-bubble:: stage3-bubble
+ @if [ -f all-stage4-gcc ] ; then \
+ echo Remaking stage 4 ; \
+ rm -f all-stage4-gcc ; \
+ fi ; \
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage4-gcc
+
+
+stage3-bubble::
+ @if [ -f configure-stage4-gcc ] ; then \
+ $(STAMP) configure-stage4-gcc ; \
+ fi
+
+
+configure-stage4-gcc: all-stage3-gcc
+ $(MAKE) stage4-start
+ @if [ -f stage4-gcc/Makefile ] ; then \
+ $(STAMP) configure-stage4-gcc ; \
+ exit 0; \
+ else \
+ true ; \
+ fi ; \
+ r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(STAGE_HOST_EXPORTS) \
+ echo Configuring stage 4 in gcc ; \
+ cd gcc || exit 1; \
+ case $(srcdir) in \
+ \.) \
+ srcdiroption="--srcdir=."; \
+ libsrcdir=".";; \
+ /* | [A-Za-z]:[\\/]*) \
+ srcdiroption="--srcdir=$(srcdir)/gcc"; \
+ libsrcdir="$$s/gcc";; \
+ *) \
+ srcdiroption="--srcdir=../$(srcdir)/gcc"; \
+ libsrcdir="$$s/gcc";; \
+ esac; \
+ $(SHELL) $${libsrcdir}/configure \
+ $(HOST_CONFIGARGS) $${srcdiroption} \
+ @stage2_werror_flag@ && \
+ $(STAMP) ../configure-stage4-gcc
+
+all-stage4-gcc: configure-stage4-gcc
+ $(MAKE) stage4-start
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(STAGE_HOST_EXPORTS) \
+ cd gcc && \
+ $(MAKE) $(GCC_FLAGS_TO_PASS) \
+ $(POSTSTAGE1_FLAGS_TO_PASS) \
+ && $(STAMP) ../all-stage4-gcc
+
+
+compare3: all-stage4-gcc
+ [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ rm -f .bad_compare ; \
+ cd stage4-gcc; \
+ files=`find . -name "*$(objext)" -print` ; \
+ cd .. ; \
+ for file in $${files} ; do \
+ f1=$$r/stage3-gcc/$$file; f2=$$r/stage4-gcc/$$file; \
+ @do_compare@ > /dev/null 2>&1; \
+ test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \
+ done ; \
+ if [ -f .bad_compare ]; then \
+ echo "Bootstrap comparison failure!"; \
+ cat .bad_compare; \
+ exit 1; \
+ else \
+ true; \
+ fi ; \
+ $(STAMP) compare3
+
+
+
+.PHONY: bootstrap4
+bootstrap4:
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage4-bubble compare3 \
+ stage4-start all stage4-end
+
+
+.PHONY: restage4 touch-stage4 distclean-stage4
+
+# Rules to wipe a stage and all the following ones, used for cleanstrap
+distclean-stage3:: distclean-stage4
+distclean-stage4::
+ [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+ rm -rf configure-stage4-gcc all-stage4-gcc stage4-gcc compare3
+
+# Rules to renew the timestamp on a stage and all the following ones
+touch-stage3:: touch-stage4
+touch-stage4::
+ @[ -f configure-stage4-gcc ] && \
+ echo '$(STAMP) configure-stage4-gcc' && \
+ $(STAMP) configure-stage4-gcc; \
+ [ -f all-stage4-gcc ] && \
+ echo '$(STAMP) all-stage4-gcc' && \
+ $(STAMP) all-stage4-gcc; \
+ :
+
+# After building a stage, touch the following ones
+restage3:: touch-stage4
+restage4::
+ rm -rf all-stage4-gcc compare3
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) compare3
+
+
+
+
+.PHONY: stageprofile-start stageprofile-end
+
+stageprofile-start::
+ [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+ echo stageprofile > stage_last ; \
+ [ -d stageprofile-gcc ] || mkdir stageprofile-gcc; \
+ set stageprofile-gcc gcc ; @CREATE_LINK_TO_DIR@ ; \
+ set stage1-gcc prev-gcc ; @CREATE_LINK_TO_DIR@
+
+stageprofile-end::
+ rm -f stage_last ; \
+ set gcc stageprofile-gcc ; @UNDO_LINK_TO_DIR@ ; \
+ set prev-gcc stage1-gcc ; @UNDO_LINK_TO_DIR@
+
+# Bubble a bugfix through all the stages up to stage profile. They
+# are remade, but not reconfigured. The next stage (if any) will not
+# be reconfigured as well.
+.PHONY: stageprofile-bubble
+stageprofile-bubble:: stage1-bubble
+ @if [ -f all-stageprofile-gcc ] ; then \
+ echo Remaking stage profile ; \
+ rm -f all-stageprofile-gcc ; \
+ fi ; \
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stageprofile-gcc
-.PHONY: new-cleanstrap
-new-cleanstrap: distclean-stage1 new-bootstrap
+stage1-bubble::
+ @if [ -f configure-stageprofile-gcc ] ; then \
+ $(STAMP) configure-stageprofile-gcc ; \
+ fi
+
+configure-stageprofile-gcc: all-stage1-gcc
+ $(MAKE) stageprofile-start
+ @if [ -f stageprofile-gcc/Makefile ] ; then \
+ $(STAMP) configure-stageprofile-gcc ; \
+ exit 0; \
+ else \
+ true ; \
+ fi ; \
+ r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(STAGE_HOST_EXPORTS) \
+ echo Configuring stage profile in gcc ; \
+ cd gcc || exit 1; \
+ case $(srcdir) in \
+ \.) \
+ srcdiroption="--srcdir=."; \
+ libsrcdir=".";; \
+ /* | [A-Za-z]:[\\/]*) \
+ srcdiroption="--srcdir=$(srcdir)/gcc"; \
+ libsrcdir="$$s/gcc";; \
+ *) \
+ srcdiroption="--srcdir=../$(srcdir)/gcc"; \
+ libsrcdir="$$s/gcc";; \
+ esac; \
+ $(SHELL) $${libsrcdir}/configure \
+ $(HOST_CONFIGARGS) $${srcdiroption} \
+ @stage2_werror_flag@ && \
+ $(STAMP) ../configure-stageprofile-gcc
+all-stageprofile-gcc: configure-stageprofile-gcc
+ $(MAKE) stageprofile-start
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(STAGE_HOST_EXPORTS) \
+ cd gcc && \
+ $(MAKE) $(GCC_FLAGS_TO_PASS) \
+ $(POSTSTAGE1_FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" && $(STAMP) ../all-stageprofile-gcc
+
+
+
+
+
+.PHONY: restageprofile touch-stageprofile distclean-stageprofile
+
+# Rules to wipe a stage and all the following ones, used for cleanstrap
+distclean-stage1:: distclean-stageprofile
+distclean-stageprofile::
+ [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+ rm -rf configure-stageprofile-gcc all-stageprofile-gcc stageprofile-gcc
+
+# Rules to renew the timestamp on a stage and all the following ones
+touch-stage1:: touch-stageprofile
+touch-stageprofile::
+ @[ -f configure-stageprofile-gcc ] && \
+ echo '$(STAMP) configure-stageprofile-gcc' && \
+ $(STAMP) configure-stageprofile-gcc; \
+ [ -f all-stageprofile-gcc ] && \
+ echo '$(STAMP) all-stageprofile-gcc' && \
+ $(STAMP) all-stageprofile-gcc; \
+ :
+
+# After building a stage, touch the following ones
+restage1:: touch-stageprofile
+restageprofile::
+ rm -rf all-stageprofile-gcc
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stageprofile-gcc
+
+
+
+
+.PHONY: stagefeedback-start stagefeedback-end
+
+stagefeedback-start::
+ [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+ echo stagefeedback > stage_last ; \
+ [ -d stagefeedback-gcc ] || mkdir stagefeedback-gcc; \
+ set stagefeedback-gcc gcc ; @CREATE_LINK_TO_DIR@ ; \
+ set stage1-gcc prev-gcc ; @CREATE_LINK_TO_DIR@
+
+stagefeedback-end::
+ rm -f stage_last ; \
+ set gcc stagefeedback-gcc ; @UNDO_LINK_TO_DIR@ ; \
+ set prev-gcc stage1-gcc ; @UNDO_LINK_TO_DIR@
+
+# Bubble a bugfix through all the stages up to stage feedback. They
+# are remade, but not reconfigured. The next stage (if any) will not
+# be reconfigured as well.
+.PHONY: stagefeedback-bubble
+stagefeedback-bubble:: stage1-bubble
+ @if [ -f all-stagefeedback-gcc ] ; then \
+ echo Remaking stage feedback ; \
+ rm -f all-stagefeedback-gcc ; \
+ fi ; \
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stagefeedback-gcc
+
+
+stage1-bubble::
+ @if [ -f configure-stagefeedback-gcc ] ; then \
+ $(STAMP) configure-stagefeedback-gcc ; \
+ fi
+
+
+configure-stagefeedback-gcc: all-stage1-gcc
+ $(MAKE) stagefeedback-start
+ @if [ -f stagefeedback-gcc/Makefile ] ; then \
+ $(STAMP) configure-stagefeedback-gcc ; \
+ exit 0; \
+ else \
+ true ; \
+ fi ; \
+ r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(STAGE_HOST_EXPORTS) \
+ echo Configuring stage feedback in gcc ; \
+ cd gcc || exit 1; \
+ case $(srcdir) in \
+ \.) \
+ srcdiroption="--srcdir=."; \
+ libsrcdir=".";; \
+ /* | [A-Za-z]:[\\/]*) \
+ srcdiroption="--srcdir=$(srcdir)/gcc"; \
+ libsrcdir="$$s/gcc";; \
+ *) \
+ srcdiroption="--srcdir=../$(srcdir)/gcc"; \
+ libsrcdir="$$s/gcc";; \
+ esac; \
+ $(SHELL) $${libsrcdir}/configure \
+ $(HOST_CONFIGARGS) $${srcdiroption} \
+ @stage2_werror_flag@ && \
+ $(STAMP) ../configure-stagefeedback-gcc
+
+all-stagefeedback-gcc: configure-stagefeedback-gcc
+ $(MAKE) stagefeedback-start
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(STAGE_HOST_EXPORTS) \
+ cd gcc && \
+ $(MAKE) $(GCC_FLAGS_TO_PASS) \
+ $(POSTSTAGE1_FLAGS_TO_PASS) \
+ CFLAGS="$(BOOT_CFLAGS) -fprofile-use" && $(STAMP) ../all-stagefeedback-gcc
+
+
+
+
+
+.PHONY: restagefeedback touch-stagefeedback distclean-stagefeedback
+
+# Rules to wipe a stage and all the following ones, used for cleanstrap
+distclean-stage1:: distclean-stagefeedback
+distclean-stagefeedback::
+ [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+ rm -rf configure-stagefeedback-gcc all-stagefeedback-gcc stagefeedback-gcc
+
+# Rules to renew the timestamp on a stage and all the following ones
+touch-stage1:: touch-stagefeedback
+touch-stagefeedback::
+ @[ -f configure-stagefeedback-gcc ] && \
+ echo '$(STAMP) configure-stagefeedback-gcc' && \
+ $(STAMP) configure-stagefeedback-gcc; \
+ [ -f all-stagefeedback-gcc ] && \
+ echo '$(STAMP) all-stagefeedback-gcc' && \
+ $(STAMP) all-stagefeedback-gcc; \
+ :
+
+# After building a stage, touch the following ones
+restage1:: touch-stagefeedback
+restagefeedback::
+ rm -rf all-stagefeedback-gcc
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stagefeedback-gcc
+
+
+
+
+
+stagefeedback-start::
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ cd stageprofile-gcc && \
+ { find . -type d | sort | sed 's,.*,$(SHELL) '"$$s"'/mkinstalldirs "../gcc/&",' | $(SHELL); } && \
+ { find . -name '*.*da' | sed 's,.*,$(LN) -f "&" "../gcc/&",' | $(SHELL); }
+
+profiledbootstrap: all-bootstrap configure-gcc
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(SET_LIB_PATH) \
+ $(GCC_HOST_EXPORTS) \
+ echo "Bootstrapping the compiler"; \
+ $(MAKE) stageprofile-bubble distclean-stagefeedback stageprofile-start
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
+ $(SET_LIB_PATH) \
+ echo "Building runtime libraries and training compiler"; \
+ $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(SET_LIB_PATH) \
+ $(GCC_HOST_EXPORTS) \
+ echo "Building feedback based compiler"; \
+ $(MAKE) stagefeedback-bubble stagefeedback-end
+@endif gcc-bootstrap
# --------------------------------------
# Dependencies between different modules