help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SECONDEXPANSION and $(shell) bug in make 3.82.90


From: Martin d'Anjou
Subject: Re: SECONDEXPANSION and $(shell) bug in make 3.82.90
Date: Thu, 12 Apr 2012 21:38:21 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111220 Thunderbird/9.0

On 12-04-12 05:26 PM, Paul Smith wrote:
On Thu, 2012-04-12 at 16:01 -0400, Martin d'Anjou wrote:
Here is the makefile:
.SECONDEXPANSION:
all: $$(shell find . \( -name "*.swp" \))
         echo $<
Did this used to work?  I'd be surprised if did; if so it was probably a
bug in the old version of make.
Yes, it works in 3.81, and I use it quite a bit actually, to create conditional pre-requisites.


You need to be sure that make knows where the variable ends, so that
requires quoting the end paren at least from make, AND you need to quote
the parens to the shell as well.

Does it work if you just switch to the alternative delimiters:

   all: $${shell find . \( name "*.swp" \)}

No luck. It still fails the same way with the curly-braces.



What about if you put the command in a variable?

   find := find . \( name "*.swp" \)
   all: $$(shell $$(find))

Bingo! This solution works... for this small example... however, when I go back to my full-scale makefile, I run into a memory leak. I will do a separate post.

Thanks,
Martin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]