This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [toplevel PATCH] add some new-bootstrap targets, and keep directory structure correct


Hi, this patch is the result of trying to do some work with new-bootstrap. I found that it was a bit inconvenient when builds failed, because then you had directories with unexpected names around and often I did not remember which directories was for which stage. I also sorely missed restage1 and friends.

I missed that "compare" is also a stampfile. This fixes it.


Paolo
2004-04-23  Paolo Bonzini  <bonzini@gnu.org>

	* Makefile.tpl (all-stage1-gcc, all-stage2-gcc, all-stage3-gcc):
	Always relocate gcc and prev-gcc to the original names, even
	if the build fails.
	(new-cleanstrap, new-restage1, new-restage2, new-restage3):
	New targets.

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/Makefile.in,v
retrieving revision 1.209
diff -u -r1.209 Makefile.in
--- Makefile.in	16 Apr 2004 07:13:39 -0000	1.209
+++ Makefile.in	23 Apr 2004 08:48:04 -0000
@@ -24112,11 +24112,11 @@
 	mv stage1-gcc gcc ; \
 	cd gcc && \
 	$(MAKE) $(GCC_FLAGS_TO_PASS) \
-		CFLAGS="$(STAGE1_CFLAGS)" \
-		|| exit 1 ; \
+		CFLAGS="$(STAGE1_CFLAGS)" && $(STAMP) ../all-stage1-gcc ; \
+	result=$$? ; \
 	cd .. ; \
 	mv gcc stage1-gcc ; \
-	$(STAMP) all-stage1-gcc
+	exit $$result
 
 # TODO: Deal with STAGE_PREFIX (which is only for ada, incidentally)
 # Possibly pass --enable-werror-always (depending on --enable-werror);
@@ -24188,11 +24188,12 @@
 		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/" \
 		STAGE_PREFIX=$$r/prev-gcc/ \
-		$(POSTSTAGE1_FLAGS_TO_PASS) || exit 1 ; \
+		$(POSTSTAGE1_FLAGS_TO_PASS) && $(STAMP) ../all-stage2-gcc ; \
+	result=$$? ; \
 	cd .. ; \
 	mv prev-gcc stage1-gcc ; \
 	mv gcc stage2-gcc ; \
-	$(STAMP) all-stage2-gcc
+	exit $$result
 
 configure-stage3-gcc: all-stage2-gcc
 	echo configure-stage3-gcc > stage_last ; \
@@ -24255,11 +24256,12 @@
 		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/" \
 		STAGE_PREFIX=$$r/prev-gcc/ \
-		$(POSTSTAGE1_FLAGS_TO_PASS) || exit 1 ; \
+		$(POSTSTAGE1_FLAGS_TO_PASS) && $(STAMP) ../all-stage3-gcc \
+	result=$$? ; \
 	cd .. ; \
 	mv prev-gcc stage2-gcc ; \
 	mv gcc stage3-gcc ; \
-	$(STAMP) all-stage3-gcc
+	exit $$result
 
 # We only want to compare .o files, so set this!
 objext = .o
@@ -24293,6 +24295,31 @@
 	mv stage3-gcc gcc ; \
 	$(MAKE) all ; \
 	mv gcc stage3-gcc
+
+new-cleanstrap:
+	rm -rf configure-stage1-gcc all-stage1-gcc stage1-gcc \
+	  configure-stage2-gcc all-stage2-gcc stage2-gcc \
+	  configure-stage3-gcc all-stage3-gcc stage3-gcc \
+	  compare
+	$(MAKE) new-bootstrap
+
+new-restage1:
+	rm -rf configure-stage1-gcc all-stage1-gcc stage1-gcc/Makefile \
+	  configure-stage2-gcc all-stage2-gcc stage2-gcc \
+	  configure-stage3-gcc all-stage3-gcc stage3-gcc \
+	  compare
+	$(MAKE) all-stage1-gcc
+
+new-restage2: all-stage1-gcc
+	rm -rf configure-stage2-gcc all-stage2-gcc stage2-gcc/Makefile \
+	  configure-stage3-gcc all-stage3-gcc stage3-gcc \
+	  compare
+	$(MAKE) all-stage2-gcc
+
+new-restage3: all-stage2-gcc
+	rm -rf configure-stage3-gcc all-stage3-gcc stage3-gcc/Makefile \
+	  compare
+	$(MAKE) compare
 
 # --------------------------------------
 # Dependencies between different modules
Index: Makefile.tpl
===================================================================
RCS file: /cvs/gcc/gcc/Makefile.tpl,v
retrieving revision 1.91
diff -u -r1.91 Makefile.tpl
--- Makefile.tpl	16 Apr 2004 07:13:40 -0000	1.91
+++ Makefile.tpl	23 Apr 2004 08:48:12 -0000
@@ -1377,11 +1377,11 @@
 	mv stage1-gcc gcc ; \
 	cd gcc && \
 	$(MAKE) $(GCC_FLAGS_TO_PASS) \
-		CFLAGS="$(STAGE1_CFLAGS)" \
-		|| exit 1 ; \
+		CFLAGS="$(STAGE1_CFLAGS)" && $(STAMP) ../all-stage1-gcc ; \
+	result=$$? ; \
 	cd .. ; \
 	mv gcc stage1-gcc ; \
-	$(STAMP) all-stage1-gcc
+	exit $$result
 
 # TODO: Deal with STAGE_PREFIX (which is only for ada, incidentally)
 # Possibly pass --enable-werror-always (depending on --enable-werror);
@@ -1453,11 +1453,12 @@
 		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/" \
 		STAGE_PREFIX=$$r/prev-gcc/ \
-		$(POSTSTAGE1_FLAGS_TO_PASS) || exit 1 ; \
+		$(POSTSTAGE1_FLAGS_TO_PASS) && $(STAMP) ../all-stage2-gcc ; \
+	result=$$? ; \
 	cd .. ; \
 	mv prev-gcc stage1-gcc ; \
 	mv gcc stage2-gcc ; \
-	$(STAMP) all-stage2-gcc
+	exit $$result
 
 configure-stage3-gcc: all-stage2-gcc
 	echo configure-stage3-gcc > stage_last ; \
@@ -1520,11 +1521,12 @@
 		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/" \
 		STAGE_PREFIX=$$r/prev-gcc/ \
-		$(POSTSTAGE1_FLAGS_TO_PASS) || exit 1 ; \
+		$(POSTSTAGE1_FLAGS_TO_PASS) && $(STAMP) ../all-stage3-gcc \
+	result=$$? ; \
 	cd .. ; \
 	mv prev-gcc stage2-gcc ; \
 	mv gcc stage3-gcc ; \
-	$(STAMP) all-stage3-gcc
+	exit $$result
 
 # We only want to compare .o files, so set this!
 objext = .o
@@ -1558,6 +1560,31 @@
 	mv stage3-gcc gcc ; \
 	$(MAKE) all ; \
 	mv gcc stage3-gcc
+
+new-cleanstrap:
+	rm -rf configure-stage1-gcc all-stage1-gcc stage1-gcc \
+	  configure-stage2-gcc all-stage2-gcc stage2-gcc \
+	  configure-stage3-gcc all-stage3-gcc stage3-gcc \
+	  compare
+	$(MAKE) new-bootstrap
+
+new-restage1:
+	rm -rf configure-stage1-gcc all-stage1-gcc stage1-gcc/Makefile \
+	  configure-stage2-gcc all-stage2-gcc stage2-gcc \
+	  configure-stage3-gcc all-stage3-gcc stage3-gcc \
+	  compare
+	$(MAKE) all-stage1-gcc
+
+new-restage2: all-stage1-gcc
+	rm -rf configure-stage2-gcc all-stage2-gcc stage2-gcc/Makefile \
+	  configure-stage3-gcc all-stage3-gcc stage3-gcc \
+	  compare
+	$(MAKE) all-stage2-gcc
+
+new-restage3: all-stage2-gcc
+	rm -rf configure-stage3-gcc all-stage3-gcc stage3-gcc/Makefile \
+	  compare
+	$(MAKE) compare
 
 # --------------------------------------
 # Dependencies between different modules

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]