Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] trailing backslash in top-level Makefile
@ 2009-06-02 16:34 Jerome Guitton
  2009-06-02 18:00 ` Ralf Wildenhues
  0 siblings, 1 reply; 7+ messages in thread
From: Jerome Guitton @ 2009-06-02 16:34 UTC (permalink / raw)
  To: gdb-patches, gcc-patches, binutils

[-- Attachment #1: Type: text/plain, Size: 986 bytes --]


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:

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

.PHONY: all-build
[...]


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

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?


2009-06-02  Jerome Guitton  <guitton@adacore.com>

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


[-- Attachment #2: toplevel.diff --]
[-- Type: text/x-diff, Size: 1200 bytes --]

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/Makefile.in,v
retrieving revision 1.302
diff -u -r1.302 Makefile.in
--- Makefile.in	2 Jun 2009 08:23:45 -0000	1.302
+++ Makefile.in	2 Jun 2009 15:18:31 -0000
@@ -859,11 +859,11 @@
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target; \
 	else \
 @endif gcc-bootstrap
-	  $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target \
+	  $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target ; \
 @if gcc-bootstrap
-	    ; \
 	fi
 @endif gcc-bootstrap
+	echo
 
 .PHONY: all-build
 
Index: Makefile.tpl
===================================================================
RCS file: /cvs/src/src/Makefile.tpl,v
retrieving revision 1.206
diff -u -r1.206 Makefile.tpl
--- Makefile.tpl	2 Jun 2009 08:23:45 -0000	1.206
+++ Makefile.tpl	2 Jun 2009 15:18:38 -0000
@@ -625,11 +625,11 @@
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target; \
 	else \
 @endif gcc-bootstrap
-	  $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target \
+	  $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target ; \
 @if gcc-bootstrap
-	    ; \
 	fi
 @endif gcc-bootstrap
+	echo
 
 .PHONY: all-build
 [+ FOR build_modules +]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-06-03  8:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-02 16:34 [RFA] trailing backslash in top-level Makefile Jerome Guitton
2009-06-02 18:00 ` Ralf Wildenhues
2009-06-02 22:04   ` Ralf Wildenhues
2009-06-02 22:08     ` DJ Delorie
2009-06-03  6:16       ` Ralf Wildenhues
2009-06-02 23:16   ` Alexandre Oliva
2009-06-03  8:44   ` Jerome Guitton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox