[bug #59243] Overcomplicated example of automatic dependency configuration

2020-10-09 Thread Paul D. Smith
Follow-up Comment #2, bug #59243 (project make): Regarding rm: this is needed in case the .d file is not writable for some reason. As mentioned by Martin, the suggested replacement -MM doesn't work for all compilers. I do agree that this code is still too obscure. Really this entire section sho

[bug #59243] Overcomplicated example of automatic dependency configuration

2020-10-09 Thread Martin Dorey
Follow-up Comment #1, bug #59243 (project make): Given set -o pipefail isn't on by default even where supported, the OP neglects the benefit of set -e in preventing the existing dependency file from being truncated to empty if something goes wrong with the compiler step. Even the original example

RE: embedded newlines in shell function variable expansion

2020-10-09 Thread Byrnes, Robert
> Hm, interesting. I guess it's possible we are stripping out newlines before > invoking the shell. I don't remember that being the case but it could be. > > I'm not exactly sure what your objective is ... We use a make variable that can be set to a whitespace-separated list of pathnames. The

Re: embedded newlines in shell function variable expansion

2020-10-09 Thread Paul Smith
On Fri, 2020-10-09 at 18:00 +, Byrnes, Robert wrote: > [pid 144497] execve("/bin/sh", ["/bin/sh", "-c", "/bin/echo blartzblurfl ; > "], 0x7ffd98ee6bc0 /* 72 vars */) = 0 Hm, interesting. I guess it's possible we are stripping out newlines before invoking the shell. I don't remember that bei

RE: embedded newlines in shell function variable expansion

2020-10-09 Thread Byrnes, Robert
> My suspicion is that it's a difference between your /bin/echo command and > your shell's builtin echo command. > > In the first case (with the ";") because there's a special character in the > command GNU make will run a shell like this: > >/bin/sh -c 'echo ... ; ' > > and the shell's built

Re: embedded newlines in shell function variable expansion

2020-10-09 Thread Paul Smith
On Fri, 2020-10-09 at 15:03 +, Byrnes, Robert wrote: > Why is the embedded whitespace removed in the first (FOO) case? It > seems related to the semicolon shell metacharacter ... My suspicion is that it's a difference between your /bin/echo command and your shell's builtin echo command. In t

[bug #59243] Overcomplicated example of automatic dependency configuration

2020-10-09 Thread anonymous
URL: Summary: Overcomplicated example of automatic dependency configuration Project: make Submitted by: None Submitted on: Fri 09 Oct 2020 03:49:50 PM UTC Severity: 3 - Normal

embedded newlines in shell function variable expansion

2020-10-09 Thread Byrnes, Robert
If I use this Makefile ... bash$ cat Makefile FOO := $(shell echo $(ENTRIES) ; ) BAR := $(shell echo $(ENTRIES) ) all: @echo FOO = $(FOO) @echo BAR = $(BAR) .PHONY: all ... and set ENTRIES with embedded newlines, then this happens: --

[PATCH 2/2] * doc/make.text: Document the let function

2020-10-09 Thread Jouke Witteveen
--- I think this covers the let function, but comments/suggestions are welcome in case I missed something. Regards, - Jouke doc/make.texi | 87 --- 1 file changed, 75 insertions(+), 12 deletions(-) diff --git a/doc/make.texi b/doc/make.texi index

[PATCH 1/2] * src/function.c: Introduce the 'let' built-in function

2020-10-09 Thread Jouke Witteveen
--- This was sent before at the end of last year. Meanwhile, the copyright of my contributions is assigned to the FSF, so I picked this up again and added some documentation (next patch). The previous discussion was titled "[RFC] Scoped variables, supercharged". src/function.c | 51 +