help-make
[Top][All Lists]
Advanced

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

Re: foreach with error in loop continues


From: Paul Smith
Subject: Re: foreach with error in loop continues
Date: Tue, 11 Oct 2016 11:39:30 -0400

On Mon, 2016-10-10 at 20:45 -0700, Emmanuel Mayssat wrote:
> > Also you don't escape dollar signs with backslashes inside make,
> you
> > escape them by writing two dollar signs "$$".
> 
> It turns out I was trying to escape the $(P) and $$(P) did not expend
> to anything

Right, because $$(P) expands to the static string '$(P)' not a
reference to a variable, so that is what would be passed to the shell.

>  (but \$(P) did!).

It will expand to the static string '\x' where "x" is each value in the
loop.  However the shell will ignore that backslash since it doesn't
escape any interesting characters, so it's essentially a no-op in this
case (but it could cause problems in other situations if used
incorrectly).

It's helpful to look very carefully at the output command line that
make prints.  That's what it's sending to the shell, so if that doesn't
look right then you'll need to figure out why.



reply via email to

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