This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: [RFA] trailing backslash in top-level Makefile


Hello Jerome,

* Jerome Guitton wrote on Tue, Jun 02, 2009 at 06:33:56PM CEST:
> 
> The top-level Makefile.in may generate a trailing backslash at the end
> of the target "all" (if gcc-bootstrap is false). Something like that:

>         @: $(MAKE); $(unstage)
>         @r=`${PWD_COMMAND}`; export r; \
>         s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
>           $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target \

> On most system, that's fine. However, this is rejected by some shells.
> For example, the system bash on some solaris systems:
> 
> ostende% bash --version 
> GNU bash, version 2.03.0(1)-release (sparc-sun-solaris)
> Copyright 1998 Free Software Foundation, Inc.
> > bash -c "ls \\"
> 
> bash: -c: line 2: syntax error: unexpected end of file

Thank you!  I couldn't find this bit of information when last looking
for it; will update the Autoconf manual section about make/shell
portability issues with this.

> The patch in attachment would fix the problem. It's a little bit ugly
> though. "echo" is used as a "nop". Would someone have a better idea to fix
> the problem?

The fix is wrong as it disables transporting a nonzero exit status from
the $(MAKE) command back to the toplevel make.

I suggest this still-untested patch (gimme a couple of hours).

Thanks,
Ralf

	* Makefile.tpl: Avoid a trailing backslash.
	* Makefile.in: Regenerate.

diff --git a/Makefile.tpl b/Makefile.tpl
index f49f3fc..db10e71 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -628,8 +628,9 @@ all:
 	  $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target \
 @if gcc-bootstrap
 	    ; \
-	fi
+	fi \
 @endif gcc-bootstrap
+	&& :
 
 .PHONY: all-build
 [+ FOR build_modules +]


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