pkgsrc-Users archive

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

Re: Surprising make behavior (was: Re: strange trouble building qgis)



Martin Husemann <martin%duskware.de@localhost> wrote:
> The context is: there is a file name containing a $, and it is listed
> on the RHS of a dependency line:
> 
> target: $$file
>         (recipe)
> 
> and I would strongly expect that $$file to yield a string "$file" not
> be expanded arbitrarily often. Why does it happen to be

I would expect it is because the value $file needs to be used to set
variables like .ALLSRC etc, which exposes it to Var_Parse which
interpret that as equivalent to ${f}ile.

> 
> target: $$$$file
>         (recipe)
> 
> that works here, and not, say, $$$$$file ?

an odd number of $'s isn't going to work.

Assuming I'm correct above, the $$$$file would get seen as $$file
by Var_Parse (or whatever) and result in the correct value of $file in
vars like .ALLSRC

> I understand that the handling in general is tricky and of course we often
> need to create variables as result of expansions.

Yes, that will be the problem.

Perhaps a special variable name other than  $ (ie $$)
to represent a literal $ - something that Var_* can know to just leave
alone, would help while not making the parsing insanely complicated.

Note even $$$$file does not result in useful .ALLSRC

the-thing: $$$$file
        @echo 'We have ${.ALLSRC}'

outputs

We have ile


Home | Main Index | Thread Index | Old Index