help-make
[Top][All Lists]
Advanced

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

Re: How to preserve $-containing terms in an expanded variable (with cal


From: John Graham-Cumming
Subject: Re: How to preserve $-containing terms in an expanded variable (with call)?
Date: Tue, 14 Mar 2006 10:18:33 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040208 Thunderbird/0.5 Mnenhy/0.6.0.104

Dimitry Golubovsky wrote:
Namely, the $(call myvar,foo) must expand into:

awk '$0 != foo { ... }'

where $0 is in the awk sense (i. e. whole line read from the input).

I tried to define myvar like this:

myvar = awk '$$0 != $(0) { .... }'

this does not work: $$0 expands to /bin/sh i. e. shell's $0, not awk's

Firstly, if you define

    myvar = awk '$$0 != $0 { ... }'

and then look at the value of $(call myvar,foo) it IS what you want, namely:

    awk '$0 != foo { ... }'

(You can verify this with $(warning $(call myvar,foo)))

Secondly, I tried doing $(shell $(call myvar,foo)) and I saw that the shell was being asked to execute awk '$0 != foo { ... }'.

So what's the issue that you are seeing, exactly? I think it would be helpful to post a full example, e.g. show the definition of your variable, and exactly how you are using it.

John.
--
John Graham-Cumming
address@hidden

Home: http://www.jgc.org/
Blog: http://www.jgc.org/blog/

POPFile: http://getpopfile.org/
GNU Make Standard Library: http://gmsl.sf.net/
GNU Make Debugger: http://gmd.sf.net/
Fast, Parallel Builds: http://www.electric-cloud.com/

Sign up for my Spam and Anti-spam Newsletter
at http://www.jgc.org/




reply via email to

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