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]

[PATCH] Fix `make clean' in the toplevel


The problem reported by Kazu and Sandra is that `make clean' does try to remove only modules that have makefiles, but fails in doing that.

When doing clean-stageN-gcc, it looks for both stageN-gcc/Makefile and gcc/Makefile. And when doing clean-stage4-gcc in particular, even though there is no stage4-gcc unfortunately it does finds gcc/Makefile (which is actually a stage3 GCC).

This patch fixes this by looking at stageN-gcc/Makefile if stageN is not active, and at gcc/Makefile if stageN is active.

Ok for mainline?

Paolo
2006-07-26  Paolo Bonzini  <bonzini@gnu.org>

	* Makefile.tpl (clean-stage[+id+]-[+prefix+][+module+]): Test the
	presence of only one of stageN-MODULE/Makefile or MODULE/Makefile.
	* Makefile.in: Regenerate.

Index: Makefile.tpl
===================================================================
--- Makefile.tpl	(revision 115716)
+++ Makefile.tpl	(working copy)
@@ -853,9 +853,12 @@ all-stage[+id+]-[+prefix+][+module+]: co
 maybe-clean-stage[+id+]-[+prefix+][+module+]: clean-stage[+id+]-[+prefix+][+module+]
 clean-stage[+id+]: clean-stage[+id+]-[+prefix+][+module+]
 clean-stage[+id+]-[+prefix+][+module+]:
-	@[ -f [+subdir+]/[+module+]/Makefile ] || [ -f [+subdir+]/stage[+id+]-[+module+]/Makefile ] \
-	  || exit 0 ; \
-	[ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start; \
+	@if [ $(current_stage) = stage[+id+] ]; then \
+	  [ -f [+subdir+]/[+module+]/Makefile ] || exit 0; \
+	else \
+	  [ -f [+subdir+]/stage[+id+]-[+module+]/Makefile ] || exit 0; \
+	  $(MAKE) stage[+id+]-start; \
+	fi; \
 	cd [+subdir+]/[+module+] && \
 	$(MAKE) [+args+] [+ IF prev +] \
 		[+poststage1_args+] [+ ENDIF prev +] \

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