This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] fix make clean on already pretty clean builddir
- From: Daniel Jacobowitz <drow at false dot org>
- To: Mike Stump <mrs at apple dot com>
- Cc: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 16 Nov 2006 19:13:22 -0500
- Subject: Re: [PATCH] fix make clean on already pretty clean builddir
- References: <455C98C1.firstname.lastname@example.org> <32356A35-8342-42F4-8942-8D056C9065CB@apple.com>
On Thu, Nov 16, 2006 at 02:02:14PM -0800, Mike Stump wrote:
> > clean-target: clean-target-libgcc
> > clean-target-libgcc:
> >- test ! -d gcc || (cd gcc && $(MAKE) $@)
> >+ if test -f gcc/Makefile; then cd gcc && $(MAKE) $@; else :; fi
> No, you cannot remove the ()s, instead, please:
> if test -f gcc/Makefile; then (cd gcc && $(MAKE) $@) else :; fi
> as strange as that looks. You can tell this is bad by doing a pwd
> after the command. If the directory is changed, it failed. When I
> do that, it fails, as I'm using a shell (bash) that doesn't run the
> if in a subshell. Original sysv I think did run the command in a
> subshell. With my version, the cwd remains unchanged.
This is a Makefile, not a shell script. There's a new shell
for every command not joined by backslashes. Paolo's change is fine.