Paul D. Smith wrote:
%% Travis Spencer <[EMAIL PROTECTED]> writes:
>> *pass the relevant variables to my program* <-- how can i do this?
ts> What about using make's `-p' option? It will output the variables and
ts> their values in a format that is very easy to parse (e.g.,
ts> http://travisspencer.com/stash2/tests/python/capmake2.py).
I thought of this, too, but note it won't fully evaluate the values
before it prints them. For example if you have in your makefile:
FOO = $(BAR)
then the output of -p will print "$(BAR)" as the value; it won't expand
the reference to BAR.
Obviously if you use := instead, then it WILL be expanded in the -p
output.
The other idea is to write a special rule that just prints the values of
variables. You could use $(.VARIABLES) if you have a new-enough version
of GNU make (beware of blowing out your environment :-/). Then you
would run "make print-my-vars" or whatever to get the output.
Thanks for the ideas.
I tested the -p option and it did as you mentions not expand the values.
After some testing is think the following could work:
My own makefile with a target and then just pass the values to my program.
I dont know if this optimal but it seems to work.
make -f Makefile.myown -f Makefile mytarget
// Fredrik
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make