This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix `make clean' in the toplevel
- From: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Sandra Loosemore <sandra at codesourcery dot com>, Kazu Hirata <kazu at codesourcery dot com>, Mike Stump <mrs at apple dot com>
- Date: Wed, 26 Jul 2006 12:10:18 +0200
- Subject: [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 +] \