help-make
[Top][All Lists]
Advanced

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

Re: Problems with eval


From: Paul D. Smith
Subject: Re: Problems with eval
Date: Wed, 29 Sep 2004 16:01:50 -0400

%% Greg Kilfoyle <address@hidden> writes:

  gk> I rule that can be gleaned from this (that my colleague suggested)
  gk> for using eval with define is that any '$' which is not a function
  gk> argument (such as $(1)) must be preceded by an extra '$'. The
  gk> above code certainly demonstrates this.

This is not a rule for eval per se, it's a rule for using call with
eval.

If you eval'd a variable directly and didn't use call you wouldn't have
to do this escaping.


The problem is that the $(call ...) function will evaluate your function
contents _FIRST_, then pass the results of that evaluation to the $(eval
...) function.  So, any variables that you don't want evaluated in the
context of the $(call ...) but instead want evaluated in the context of
the $(eval ...), need to be escaped (once) to hide them from the $(call
...).

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          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]