%% "Viswanathan, Raj" <[EMAIL PROTECTED]> writes:
vr> I would like figuring out how to set a variable within command
vr> part of a target/dependency like this
vr> FOO=a
vr> target : dependency
vr> $(FOO) = b
vr> is this possible?
No. All parts of a command script are passed to a subshell and parsed
by the shell; there is no way for the subshell to affect changes in the
parent make process.
vr> if not how can I overcome this?
That depends entirely on why you want to do it. The only sure-fire,
completely generic way of doing this is to invoke a submake with the
variable set, like this:
FOO = a
target: prerequisite
$(MAKE) FOO=b
Depending on what you _really_ want to do, there are other, probably
better possibilities.
--
-------------------------------------------------------------------------------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.ultranet.com/~pauld/gmake/
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist