This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] trailing backslash in top-level Makefile
- From: Ralf Wildenhues <Ralf dot Wildenhues at gmx dot de>
- To: Jerome Guitton <guitton at adacore dot com>
- Cc: gdb-patches at sourceware dot org, gcc-patches at gcc dot gnu dot org, binutils at sourceware dot org
- Date: Tue, 2 Jun 2009 20:00:21 +0200
- Subject: Re: [RFA] trailing backslash in top-level Makefile
- References: <20090602163356.GB20678@adacore.com>
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 +]