+cleanstrap: do-distclean local-clean
+ echo stage3 > stage_final
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage3-bubble
+ @: $(MAKE); $(unstage)
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
+
+@endif gcc-bootstrap
+
+
+.PHONY: stageb3g2-start stageb3g2-end
+
+stageb3g2-start::
+ @: $(MAKE); $(stage); \
+ echo stageb3g2 > stage_current ; \
+ echo stageb3g2 > stage_last; \
+ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)
+@if bfd
+ @cd $(HOST_SUBDIR); [ -d stageb3g2-bfd ] || \
+ mkdir stageb3g2-bfd; \
+ mv stageb3g2-bfd bfd ; \
+ mv stageb2g0-bfd prev-bfd || test -f stageb2g0-lean
+@endif bfd
+@if opcodes
+ @cd $(HOST_SUBDIR); [ -d stageb3g2-opcodes ] || \
+ mkdir stageb3g2-opcodes; \
+ mv stageb3g2-opcodes opcodes ; \
+ mv stageb2g0-opcodes prev-opcodes || test -f stageb2g0-lean
+@endif opcodes
+@if binutils
+ @cd $(HOST_SUBDIR); [ -d stageb3g2-binutils ] || \
+ mkdir stageb3g2-binutils; \
+ mv stageb3g2-binutils binutils ; \
+ mv stageb2g0-binutils prev-binutils || test -f stageb2g0-lean
+@endif binutils
+@if gas
+ @cd $(HOST_SUBDIR); [ -d stageb3g2-gas ] || \
+ mkdir stageb3g2-gas; \
+ mv stageb3g2-gas gas ; \
+ mv stageb2g0-gas prev-gas || test -f stageb2g0-lean
+@endif gas
+@if gcc
+ @cd $(HOST_SUBDIR); [ -d stageb3g2-gcc ] || \
+ mkdir stageb3g2-gcc; \
+ mv stageb3g2-gcc gcc ; \
+ mv stageb2g0-gcc prev-gcc || test -f stageb2g0-lean
+@endif gcc
+@if gmp
+ @cd $(HOST_SUBDIR); [ -d stageb3g2-gmp ] || \
+ mkdir stageb3g2-gmp; \
+ mv stageb3g2-gmp gmp ; \
+ mv stageb2g0-gmp prev-gmp || test -f stageb2g0-lean
+@endif gmp
+@if mpfr
+ @cd $(HOST_SUBDIR); [ -d stageb3g2-mpfr ] || \
+ mkdir stageb3g2-mpfr; \
+ mv stageb3g2-mpfr mpfr ; \
+ mv stageb2g0-mpfr prev-mpfr || test -f stageb2g0-lean
+@endif mpfr
+@if intl
+ @cd $(HOST_SUBDIR); [ -d stageb3g2-intl ] || \
+ mkdir stageb3g2-intl; \
+ mv stageb3g2-intl intl ; \
+ mv stageb2g0-intl prev-intl || test -f stageb2g0-lean
+@endif intl
+@if ld
+ @cd $(HOST_SUBDIR); [ -d stageb3g2-ld ] || \
+ mkdir stageb3g2-ld; \
+ mv stageb3g2-ld ld ; \
+ mv stageb2g0-ld prev-ld || test -f stageb2g0-lean
+@endif ld
+@if libcpp
+ @cd $(HOST_SUBDIR); [ -d stageb3g2-libcpp ] || \
+ mkdir stageb3g2-libcpp; \
+ mv stageb3g2-libcpp libcpp ; \
+ mv stageb2g0-libcpp prev-libcpp || test -f stageb2g0-lean
+@endif libcpp
+@if libdecnumber
+ @cd $(HOST_SUBDIR); [ -d stageb3g2-libdecnumber ] || \
+ mkdir stageb3g2-libdecnumber; \
+ mv stageb3g2-libdecnumber libdecnumber ; \
+ mv stageb2g0-libdecnumber prev-libdecnumber || test -f stageb2g0-lean
+@endif libdecnumber
+@if libiberty
+ @cd $(HOST_SUBDIR); [ -d stageb3g2-libiberty ] || \
+ mkdir stageb3g2-libiberty; \
+ mv stageb3g2-libiberty libiberty ; \
+ mv stageb2g0-libiberty prev-libiberty || test -f stageb2g0-lean
+@endif libiberty
+@if zlib
+ @cd $(HOST_SUBDIR); [ -d stageb3g2-zlib ] || \
+ mkdir stageb3g2-zlib; \
+ mv stageb3g2-zlib zlib ; \
+ mv stageb2g0-zlib prev-zlib || test -f stageb2g0-lean
+@endif zlib
+ @[ -d stageb3g2-$(TARGET_SUBDIR) ] || \
+ mkdir stageb3g2-$(TARGET_SUBDIR); \
+ mv stageb3g2-$(TARGET_SUBDIR) $(TARGET_SUBDIR) ; \
+ mv stageb2g0-$(TARGET_SUBDIR) prev-$(TARGET_SUBDIR) || test -f stageb2g0-lean
+
+stageb3g2-end::
+@if bfd
+ @if test -d $(HOST_SUBDIR)/bfd ; then \
+ cd $(HOST_SUBDIR); mv bfd stageb3g2-bfd ; \
+ mv prev-bfd stageb2g0-bfd ; : ; \
+ fi
+@endif bfd
+@if opcodes
+ @if test -d $(HOST_SUBDIR)/opcodes ; then \
+ cd $(HOST_SUBDIR); mv opcodes stageb3g2-opcodes ; \
+ mv prev-opcodes stageb2g0-opcodes ; : ; \
+ fi
+@endif opcodes
+@if binutils
+ @if test -d $(HOST_SUBDIR)/binutils ; then \
+ cd $(HOST_SUBDIR); mv binutils stageb3g2-binutils ; \
+ mv prev-binutils stageb2g0-binutils ; : ; \
+ fi
+@endif binutils
+@if gas
+ @if test -d $(HOST_SUBDIR)/gas ; then \
+ cd $(HOST_SUBDIR); mv gas stageb3g2-gas ; \
+ mv prev-gas stageb2g0-gas ; : ; \
+ fi
+@endif gas
+@if gcc
+ @if test -d $(HOST_SUBDIR)/gcc ; then \
+ cd $(HOST_SUBDIR); mv gcc stageb3g2-gcc ; \
+ mv prev-gcc stageb2g0-gcc ; : ; \
+ fi
+@endif gcc
+@if gmp
+ @if test -d $(HOST_SUBDIR)/gmp ; then \
+ cd $(HOST_SUBDIR); mv gmp stageb3g2-gmp ; \
+ mv prev-gmp stageb2g0-gmp ; : ; \
+ fi
+@endif gmp
+@if mpfr
+ @if test -d $(HOST_SUBDIR)/mpfr ; then \
+ cd $(HOST_SUBDIR); mv mpfr stageb3g2-mpfr ; \
+ mv prev-mpfr stageb2g0-mpfr ; : ; \
+ fi
+@endif mpfr
+@if intl
+ @if test -d $(HOST_SUBDIR)/intl ; then \
+ cd $(HOST_SUBDIR); mv intl stageb3g2-intl ; \
+ mv prev-intl stageb2g0-intl ; : ; \
+ fi
+@endif intl
+@if ld
+ @if test -d $(HOST_SUBDIR)/ld ; then \
+ cd $(HOST_SUBDIR); mv ld stageb3g2-ld ; \
+ mv prev-ld stageb2g0-ld ; : ; \
+ fi
+@endif ld
+@if libcpp
+ @if test -d $(HOST_SUBDIR)/libcpp ; then \
+ cd $(HOST_SUBDIR); mv libcpp stageb3g2-libcpp ; \
+ mv prev-libcpp stageb2g0-libcpp ; : ; \
+ fi
+@endif libcpp
+@if libdecnumber
+ @if test -d $(HOST_SUBDIR)/libdecnumber ; then \
+ cd $(HOST_SUBDIR); mv libdecnumber stageb3g2-libdecnumber ; \
+ mv prev-libdecnumber stageb2g0-libdecnumber ; : ; \
+ fi
+@endif libdecnumber
+@if libiberty
+ @if test -d $(HOST_SUBDIR)/libiberty ; then \
+ cd $(HOST_SUBDIR); mv libiberty stageb3g2-libiberty ; \
+ mv prev-libiberty stageb2g0-libiberty ; : ; \
+ fi
+@endif libiberty
+@if zlib
+ @if test -d $(HOST_SUBDIR)/zlib ; then \
+ cd $(HOST_SUBDIR); mv zlib stageb3g2-zlib ; \
+ mv prev-zlib stageb2g0-zlib ; : ; \
+ fi
+@endif zlib
+ @if test -d $(TARGET_SUBDIR) ; then \
+ mv $(TARGET_SUBDIR) stageb3g2-$(TARGET_SUBDIR) ; \
+ mv prev-$(TARGET_SUBDIR) stageb2g0-$(TARGET_SUBDIR) ; : ; \
+ fi
+ rm -f stage_current
+
+# Bubble a bug fix through all the stages up to stage b3g2. They are
+# remade, but not reconfigured. The next stage (if any) will not be
+# reconfigured as well.
+.PHONY: stageb3g2-bubble
+stageb3g2-bubble:: stageb2g0-bubble
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ if test -f stageb3g2-lean || test -f stageb2g0-lean ; then \
+ echo Skipping rebuild of stageb3g2 ; \
+ else \
+ $(MAKE) stageb3g2-start; \
+ if $(LEAN); then \
+ rm -rf stage1-* ; \
+ $(STAMP) stage1-lean ; \
+ fi; \
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stageb3g2; \
+ fi
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) compare-debug
+
+.PHONY: all-stageb3g2 clean-stageb3g2
+do-clean: clean-stageb3g2
+
+# FIXME: Will not need to be conditional when toplevel bootstrap is the
+# only possibility, but now it conflicts with no-bootstrap rules
+@if gcc-bootstrap
+
+compare-debug:
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ if test -f stageb2g0-lean; then \
+ echo Cannot compare object files as stage b2g0 was deleted. ; \
+ exit 0 ; \
+ fi; \
+ : $(MAKE); $(stage); \
+ rm -f .bad_compare ; \
+ echo Comparing stages b2g0 and b3g2 ; \
+ cd stageb3g2-gcc; \
+ files=`find . -name "*$(objext)" -print` ; \
+ cd .. ; \
+ for file in $${files} ; do \
+ f1=$$r/stageb2g0-gcc/$$file; f2=$$r/stageb3g2-gcc/$$file; \
+ $(do-compare-debug) > /dev/null 2>&1; \
+ if test $$? -eq 1; then \
+ case $$file in \
+ ./cc*-checksum$(objext) | ./libgcc/* ) \
+ echo warning: $$file differs ;; \
+ *) \
+ echo $$file differs >> .bad_compare ;; \
+ esac ; \
+ fi ; \
+ done ; \
+ if [ -f .bad_compare ]; then \
+ echo "Bootstrap comparison failure!"; \
+ cat .bad_compare; \
+ exit 1; \
+ else \
+ echo Comparison successful.; \
+ fi ; \
+ $(STAMP) compare-debug
+ if $(LEAN); then \
+ rm -rf stageb2g0-*; \
+ $(STAMP) stageb2g0-lean; \
+ fi
+
+
+
+.PHONY: bootstrap-debug bootstrap-debug-lean
+bootstrap-debug:
+ echo stageb3g2 > stage_final
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) stageb3g2-bubble
+ @: $(MAKE); $(unstage)
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
+
+bootstrap-debug-lean:
+ echo stageb3g2 > stage_final
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) LEAN=: stageb3g2-bubble
+ @: $(MAKE); $(unstage)
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
+
+
+# Rules to wipe a stage and all the following ones, also used for cleanstrap
+distclean-stageb2g0:: distclean-stageb3g2
+.PHONY: distclean-stageb3g2
+distclean-stageb3g2::
+ @: $(MAKE); $(stage)
+ @test "`cat stage_last`" != stageb3g2 || rm -f stage_last
+ rm -rf stageb3g2-* compare-debug
+
+
+.PHONY: cleanstrap-debug
+cleanstrap-debug: do-distclean local-clean
+ echo stageb3g2 > stage_final
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(MAKE) $(RECURSE_FLAGS_TO_PASS) stageb3g2-bubble
+ @: $(MAKE); $(unstage)
+ @r=`${PWD_COMMAND}`; export r; \
+ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target