Commit f516a7da by Paolo Bonzini Committed by Paolo Bonzini

Makefile.tpl (all.normal): Rename to all.

2004-06-01  Paolo Bonzini  <bonzini@gnu.org>

	* Makefile.tpl (all.normal): Rename to all.
	(all): Replace with a rule to pick the default
	target from configure.
	(all-gcc, configure-gcc): Use conditionals to
	do nothing when toplevel bootstrap is going on.
	(GCC directory bootstrap) [gcc-bootstrap]: Disable.
	(Toplevel bootstrap) [gcc-no-bootstrap]: Disable.
	* configure.in: Support --enable-bootstrap.

	* Makefile.def: Remove new- prefix from toplevel
	bootstrap targets.
	* Makefile.tpl: Likewise.

	* Makefile.def: Add bootstrap_stage 4.  Add bootstrap2
	target.

	* Makefile.tpl (Toplevel bootstrap): Pass $(BASE_FLAGS_TO_PASS)
	$(RECURSE_FLAGS) to recursive invocation of make.

	* Makefile.in: Regenerate.
	* configure: Regenerate.

From-SVN: r82534
parent 0b068ee9
2004-06-01 Paolo Bonzini <bonzini@gnu.org>
* Makefile.tpl (all.normal): Rename to all.
(all): Replace with a rule to pick the default
target from configure.
(all-gcc, configure-gcc): Use conditionals to
do nothing when toplevel bootstrap is going on.
(GCC directory bootstrap) [gcc-bootstrap]: Disable.
(Toplevel bootstrap) [gcc-no-bootstrap]: Disable.
* configure.in: Support --enable-bootstrap.
* Makefile.def: Remove new- prefix from toplevel
bootstrap targets.
* Makefile.tpl: Likewise.
* Makefile.def: Add bootstrap_stage 4. Add bootstrap2
target.
* Makefile.tpl (Toplevel bootstrap): Pass $(BASE_FLAGS_TO_PASS)
$(RECURSE_FLAGS) to recursive invocation of make.
* Makefile.in: Regenerate.
* configure: Regenerate.
2004-05-30 Andreas Jaeger <aj@suse.de> 2004-05-30 Andreas Jaeger <aj@suse.de>
Jim Wilson <wilson@specifixinc.com> Jim Wilson <wilson@specifixinc.com>
......
...@@ -222,12 +222,19 @@ bootstrap_stage = { ...@@ -222,12 +222,19 @@ bootstrap_stage = {
extra_make_flags='CFLAGS="$(STAGE1_CFLAGS)"' ; }; extra_make_flags='CFLAGS="$(STAGE1_CFLAGS)"' ; };
bootstrap_stage = { bootstrap_stage = {
id=2 ; prev=1 ; next=3 ; id=2 ; prev=1 ; next=3 ;
bootstrap_target=new-bootstrap2 ;
extra_configure_flags="@stage2_werror_flag@" ; extra_configure_flags="@stage2_werror_flag@" ;
extra_make_flags="$(POSTSTAGE1_FLAGS_TO_PASS)" ; }; extra_make_flags="$(POSTSTAGE1_FLAGS_TO_PASS)" ; };
bootstrap_stage = { bootstrap_stage = {
id=3 ; prev=2 ; id=3 ; prev=2 ; next=4 ;
compare_target=compare ; compare_target=compare ;
bootstrap_target=new-bootstrap ; bootstrap_target=bootstrap ;
cleanstrap_target=new-cleanstrap ; cleanstrap_target=cleanstrap ;
extra_configure_flags="@stage2_werror_flag@" ;
extra_make_flags="$(POSTSTAGE1_FLAGS_TO_PASS)" ; };
bootstrap_stage = {
id=4 ; prev=3 ;
compare_target=compare3 ;
bootstrap_target=bootstrap4 ;
extra_configure_flags="@stage2_werror_flag@" ; extra_configure_flags="@stage2_werror_flag@" ;
extra_make_flags="$(POSTSTAGE1_FLAGS_TO_PASS)" ; }; extra_make_flags="$(POSTSTAGE1_FLAGS_TO_PASS)" ; };
...@@ -470,8 +470,7 @@ PICFLAG_FOR_TARGET = ...@@ -470,8 +470,7 @@ PICFLAG_FOR_TARGET =
# The first rule in the file had better be this one. Don't put any above it. # 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. # This lives here to allow makefile fragments to contain dependencies.
all: all.normal @default_target@:
.PHONY: all
#### host and target specific makefile fragments come in here. #### host and target specific makefile fragments come in here.
@target_makefile_frag@ @target_makefile_frag@
...@@ -576,9 +575,9 @@ configure-target: [+ ...@@ -576,9 +575,9 @@ configure-target: [+
maybe-configure-target-[+module+][+ maybe-configure-target-[+module+][+
ENDFOR target_modules +] ENDFOR target_modules +]
# The target built for a native build. # The target built for a native non-bootstrap build.
.PHONY: all.normal .PHONY: all
all.normal: @all_build_modules@ all-host all-target all: @all_build_modules@ all-host all-target
.PHONY: all-host .PHONY: all-host
all-host: maybe-all-gcc [+ all-host: maybe-all-gcc [+
...@@ -1171,8 +1170,9 @@ maybe-configure-gcc: ...@@ -1171,8 +1170,9 @@ maybe-configure-gcc:
@if gcc @if gcc
maybe-configure-gcc: configure-gcc maybe-configure-gcc: configure-gcc
configure-gcc: configure-gcc:
@endif gcc
@if gcc-no-bootstrap
@test ! -f gcc/Makefile || exit 0; \ @test ! -f gcc/Makefile || exit 0; \
[ -f stage_last ] && exit 0; \
[ -d gcc ] || mkdir gcc; \ [ -d gcc ] || mkdir gcc; \
r=`${PWD_COMMAND}`; export r; \ r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
...@@ -1193,7 +1193,7 @@ configure-gcc: ...@@ -1193,7 +1193,7 @@ configure-gcc:
$(SHELL) $${libsrcdir}/configure \ $(SHELL) $${libsrcdir}/configure \
$(HOST_CONFIGARGS) $${srcdiroption} \ $(HOST_CONFIGARGS) $${srcdiroption} \
|| exit 1 || exit 1
@endif gcc @endif gcc-no-bootstrap
# Don't 'make all' in gcc if it's already been made by 'bootstrap'; that # 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 # causes trouble. This wart will be fixed eventually by moving
...@@ -1203,19 +1203,17 @@ maybe-all-gcc: ...@@ -1203,19 +1203,17 @@ maybe-all-gcc:
@if gcc @if gcc
maybe-all-gcc: all-gcc maybe-all-gcc: all-gcc
all-gcc: configure-gcc all-gcc: configure-gcc
@endif gcc
@if gcc-no-bootstrap
r=`${PWD_COMMAND}`; export r; \ r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
$(SET_LIB_PATH) \
$(GCC_HOST_EXPORTS) \ $(GCC_HOST_EXPORTS) \
if [ -f stage_last ] ; then \ if [ -f gcc/stage_last ] ; then \
true ; \
elif [ -f gcc/stage_last ] ; then \
$(SET_LIB_PATH) \
(cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) quickstrap); \ (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) quickstrap); \
else \ else \
$(SET_LIB_PATH) \
(cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) all); \ (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
fi fi
@endif gcc
# Building GCC uses some tools for rebuilding "source" files # Building GCC uses some tools for rebuilding "source" files
# like texinfo, bison/byacc, etc. So we must depend on those. # like texinfo, bison/byacc, etc. So we must depend on those.
...@@ -1294,7 +1292,8 @@ cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld ...@@ -1294,7 +1292,8 @@ cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
$(SET_LIB_PATH) \ $(SET_LIB_PATH) \
echo "Building runtime libraries"; \ echo "Building runtime libraries"; \
$(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \ $(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 .PHONY: check-gcc maybe-check-gcc
maybe-check-gcc: maybe-check-gcc:
...@@ -1395,6 +1394,7 @@ maybe-[+make_target+]-gcc: [+make_target+]-gcc ...@@ -1395,6 +1394,7 @@ maybe-[+make_target+]-gcc: [+make_target+]-gcc
[+ ENDFOR recursive_targets +] [+ ENDFOR recursive_targets +]
@if gcc-bootstrap
# --------------------- # ---------------------
# GCC bootstrap support # GCC bootstrap support
# --------------------- # ---------------------
...@@ -1440,7 +1440,7 @@ objext = .o ...@@ -1440,7 +1440,7 @@ objext = .o
# Real targets act phony if they depend on phony targets; this hack # Real targets act phony if they depend on phony targets; this hack
# prevents gratuitous rebuilding of stage 1. # prevents gratuitous rebuilding of stage 1.
prebootstrap: prebootstrap:
$(MAKE) all-bootstrap $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all-bootstrap
$(STAMP) prebootstrap $(STAMP) prebootstrap
# Flags to pass to stage2 and later makes. # Flags to pass to stage2 and later makes.
...@@ -1459,16 +1459,16 @@ POSTSTAGE1_FLAGS_TO_PASS = \ ...@@ -1459,16 +1459,16 @@ POSTSTAGE1_FLAGS_TO_PASS = \
# * We build only C (and possibly Ada). # * We build only C (and possibly Ada).
[+ FOR bootstrap-stage +] [+ FOR bootstrap-stage +]
.PHONY: new-stage[+id+]-start new-stage[+id+]-end .PHONY: stage[+id+]-start stage[+id+]-end
new-stage[+id+]-start: stage[+id+]-start:
[ -f stage_last ] && $(MAKE) new-`cat stage_last`-end || : [ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
echo stage[+id+] > stage_last ; \ echo stage[+id+] > stage_last ; \
[ -d stage[+id+]-gcc ] || mkdir stage[+id+]-gcc; \ [ -d stage[+id+]-gcc ] || mkdir stage[+id+]-gcc; \
set stage[+id+]-gcc gcc ; @CREATE_LINK_TO_DIR@ [+ IF prev +] ; \ set stage[+id+]-gcc gcc ; @CREATE_LINK_TO_DIR@ [+ IF prev +] ; \
set stage[+prev+]-gcc prev-gcc ; @CREATE_LINK_TO_DIR@ [+ ENDIF prev +] set stage[+prev+]-gcc prev-gcc ; @CREATE_LINK_TO_DIR@ [+ ENDIF prev +]
new-stage[+id+]-end: stage[+id+]-end:
rm -f stage_last ; \ rm -f stage_last ; \
set gcc stage[+id+]-gcc ; @UNDO_LINK_TO_DIR@ [+ IF prev +] ; \ set gcc stage[+id+]-gcc ; @UNDO_LINK_TO_DIR@ [+ IF prev +] ; \
set prev-gcc stage[+prev+]-gcc ; @UNDO_LINK_TO_DIR@ [+ ENDIF prev +] set prev-gcc stage[+prev+]-gcc ; @UNDO_LINK_TO_DIR@ [+ ENDIF prev +]
...@@ -1476,22 +1476,23 @@ new-stage[+id+]-end: ...@@ -1476,22 +1476,23 @@ new-stage[+id+]-end:
# Bubble a bugfix through all the stages up to stage [+id+]. They # Bubble a bugfix through all the stages up to stage [+id+]. They
# are remade, but not reconfigured. The next stage (if any) will not # are remade, but not reconfigured. The next stage (if any) will not
# be reconfigured as well. # be reconfigured as well.
.PHONY: new-stage[+id+]-bubble .PHONY: stage[+id+]-bubble
new-stage[+id+]-bubble: [+ IF prev +]new-stage[+prev+]-bubble[+ ENDIF +] stage[+id+]-bubble: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +]
@if [ -f all-stage[+id+]-gcc ] ; then \ @if [ -f all-stage[+id+]-gcc ] ; then \
echo Remaking stage [+id+] ; \ echo Remaking stage [+id+] ; \
rm -f all-stage[+id+]-gcc ; \ 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 \ if [ -f configure-stage[+next+]-gcc ] ; then \
$(STAMP) configure-stage[+next+]-gcc ; \ $(STAMP) configure-stage[+next+]-gcc ; \
fi [+ ENDIF next +]; \ fi [+ ENDIF next +]; \
else \ else \
$(MAKE) all-stage[+id+]-gcc ; \ $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all-stage[+id+]-gcc ; \
fi fi
configure-stage[+id+]-gcc: [+ IF prev +] all-stage[+prev+]-gcc [+ configure-stage[+id+]-gcc: [+ IF prev +] all-stage[+prev+]-gcc [+
ELSE +] prebootstrap [+ ENDIF prev +] ELSE +] prebootstrap [+ ENDIF prev +]
$(MAKE) new-stage[+id+]-start $(MAKE) stage[+id+]-start
@if [ -f stage[+id+]-gcc/Makefile ] ; then \ @if [ -f stage[+id+]-gcc/Makefile ] ; then \
$(STAMP) configure-stage[+id+]-gcc ; \ $(STAMP) configure-stage[+id+]-gcc ; \
exit 0; \ exit 0; \
...@@ -1521,7 +1522,7 @@ configure-stage[+id+]-gcc: [+ IF prev +] all-stage[+prev+]-gcc [+ ...@@ -1521,7 +1522,7 @@ configure-stage[+id+]-gcc: [+ IF prev +] all-stage[+prev+]-gcc [+
$(STAMP) ../configure-stage[+id+]-gcc $(STAMP) ../configure-stage[+id+]-gcc
all-stage[+id+]-gcc: 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; \ @r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \
$(STAGE_HOST_EXPORTS) [+ ELSE prev +] \ $(STAGE_HOST_EXPORTS) [+ ELSE prev +] \
...@@ -1534,7 +1535,7 @@ all-stage[+id+]-gcc: configure-stage[+id+]-gcc ...@@ -1534,7 +1535,7 @@ all-stage[+id+]-gcc: configure-stage[+id+]-gcc
[+ IF compare-target +] [+ IF compare-target +]
[+compare-target+]: all-stage[+id+]-gcc [+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; \ @r=`${PWD_COMMAND}`; export r; \
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
rm -f .bad_compare ; \ rm -f .bad_compare ; \
...@@ -1559,23 +1560,23 @@ all-stage[+id+]-gcc: configure-stage[+id+]-gcc ...@@ -1559,23 +1560,23 @@ all-stage[+id+]-gcc: configure-stage[+id+]-gcc
[+ IF bootstrap-target +] [+ IF bootstrap-target +]
.PHONY: [+bootstrap-target+] .PHONY: [+bootstrap-target+]
[+bootstrap-target+]: [+bootstrap-target+]:
$(MAKE) new-stage[+id+]-bubble [+ $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) stage[+id+]-bubble [+
IF compare-target +] [+compare-target+] [+ IF compare-target +] [+compare-target+] [+
ENDIF compare-target +] \ ENDIF compare-target +] \
new-stage[+id+]-start all new-stage[+id+]-end stage[+id+]-start all stage[+id+]-end
[+ ENDIF bootstrap-target +] [+ 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 +] 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 [+ rm -rf configure-stage[+id+]-gcc all-stage[+id+]-gcc stage[+id+]-gcc [+
IF compare-target +][+compare-target+] [+ ENDIF compare-target +] 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 [+ rm -rf all-stage[+id+]-gcc [+
IF compare-target +][+compare-target+] [+ ENDIF compare-target +] IF compare-target +][+compare-target+] [+ ENDIF compare-target +]
$(MAKE) [+ $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) [+
IF compare-target +][+compare-target+] [+ IF compare-target +][+compare-target+] [+
ELSE +] all-stage[+id+]-gcc [+ ENDIF compare-target +] ELSE +] all-stage[+id+]-gcc [+ ENDIF compare-target +]
...@@ -1585,6 +1586,7 @@ new-restage[+id+]: [+ IF next +] distclean-stage[+next+] [+ ENDIF next +] ...@@ -1585,6 +1586,7 @@ new-restage[+id+]: [+ IF next +] distclean-stage[+next+] [+ ENDIF next +]
[+ ENDIF cleanstrap-target +] [+ ENDIF cleanstrap-target +]
[+ ENDFOR bootstrap-stage +] [+ ENDFOR bootstrap-stage +]
@endif gcc-bootstrap
# -------------------------------------- # --------------------------------------
# Dependencies between different modules # Dependencies between different modules
......
...@@ -1760,6 +1760,36 @@ for module in ${target_configdirs} ; do ...@@ -1760,6 +1760,36 @@ for module in ${target_configdirs} ; do
/^@if target-$module\$/d /^@if target-$module\$/d
/^@endif target-$module\$/d" /^@endif target-$module\$/d"
done done
AC_ARG_ENABLE([bootstrap],
[ --enable-bootstrap Enable bootstrapping [no]],,
enable_bootstrap=no)
if test -d ${srcdir}/gcc; then
case "$host:$target:$enable_bootstrap" in
$build:$build:yes | *:no) ;;
*:yes) AC_MSG_ERROR([cannot bootstrap a cross-compiler]) ;;
*) AC_MSG_ERROR([invalid option for --enable-bootstrap]) ;;
esac
else
if test $enable_bootstrap = yes; then
AC_MSG_ERROR([cannot bootstrap without a compiler])
fi
fi
case "$enable_bootstrap" in
yes)
default_target=new-bootstrap
extrasub="$extrasub
/^@if gcc-bootstrap\$/d
/^@endif gcc-bootstrap\$/d" ;;
no)
default_target=all
extrasub="$extrasub
/^@if gcc-no-bootstrap\$/d
/^@endif gcc-no-bootstrap\$/d" ;;
esac
AC_SUBST(default_target)
extrasub="$extrasub extrasub="$extrasub
/^@if /,/^@endif /d" /^@if /,/^@endif /d"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment