help-gnu-utils
[Top][All Lists]
Advanced

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

Re: Assigning variables in a rule


From: Paul D. Smith
Subject: Re: Assigning variables in a rule
Date: 23 Mar 2006 10:22:12 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

%% lamthierry@gmail.com writes:

  l> The variable name doesn't seem to be initialised after calling
  l> eval.

It _does_ work, again assuming you have a "new enough" version of make.
You still haven't provided any information on what version you're
using.  You need GNU make 3.80 or better to use this feature.

As I said, though, I suspect that what you are trying to do doesn't make
sense; in this case $(eval ...) won't help you.  But since you didn't
tell us what you want to do, it's the best we can offer.

If you want more help you'll need to put more effort into asking for it,
and provide us with some details.


FYI, this example proves that the $(eval ...) method works:

  $ cat Makefile
  FOO = foo
  one: two ; @echo $(FOO)
  two: ; $(eval FOO = bar)

  $ make
  bar

  l> Is there an alternate way of doing this assignment within a rule?

No.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psmith@gnu.org>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


reply via email to

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