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
_______________________________________________
Help-make mailing list
Help-make@...
https://lists.gnu.org/mailman/listinfo/help-make