[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gmake - how to generate variable assignments?
From: |
Ernest |
Subject: |
Re: gmake - how to generate variable assignments? |
Date: |
Mon, 20 Dec 2004 11:13:53 -0600 |
User-agent: |
Xnews/5.04.25 |
bill-godfrey@sunny-daventry.invalid (Bill Godfrey) wrote in
news:20041217192052.050$9Z@newsreader.com:
> Not sure what you mean by that. I think all make variables are global,
> so your emphasis puzzles me.
Well, there are target-specific variables too, which exist only for a given
target. I just wanted to make sure people didn't suggest that.
> No idea if this is any use to you, but you can do...
>
> $($(SOMEVARIABLE)_VAR)
Sure, but what I need to do is generate assignment statements on the fly.
Maybe I wasn't too clear in my original post, let me try this another way.
The user specifies a list of words in a variable, e.g.,
FILES = foo1 foo2 foo3 ... etc. ...
And my makefiles (which I provide to the user) must be able to take that
list (FILES is an agreed-upon variable name) and transform it into
variables of this form for them:
foo1_VAR = whatever
foo2_VAR = whatever
etc.
So you see, I cannot, at the time I write my makefiles, know what the names
of the variables are. I can calculate the names easily, but I don't know
if GNU provides a way for me to *generate* global variable assignment
statements. The "define" and "eval()" mechanisms only appear to work for a
target's command list, which will not work for me (AFAIK).
Cheers and thanks,
Ernest