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: [PATCH] fix make clean on already pretty clean builddir


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.

-- 
Daniel Jacobowitz
CodeSourcery


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