help-make
[Top][All Lists]
Advanced

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

Re: about immediate and deferred variable assignment in GNU make


From: Paul D. Smith
Subject: Re: about immediate and deferred variable assignment in GNU make
Date: Wed, 26 Apr 2006 11:26:17 -0400

%% Lin George <address@hidden> writes:
   
  >> $(info B is $(B))
   
  lg>   What do you mean "info B is $(B)"?

info is a GNU make function (introduced in GNU make 3.81).
You can look it up in the GNU make manual.

  >> A recursive variable (expansion is deferred) will have to be
  >> expanded every time the variable is referenced. Any variables in
  >> the value expand to their CURRENT values, not what they were when
  >> the simple variable was assigned.

  lg> I am just curious why you call a variable "recursive variable" and
  lg> "simple variable".

If you look up the section on "The Two Flavors of Variables" in the GNU
make manual you'll see the definition of these phrases.  These are the
proper terms for the two types of variables.

  lg> I think in your context, "recursive variable" means the variables
  lg> which is assigned value many times and "simple variable" means
  lg> variable which is assigned value only once.

  lg> Also, "referenced" mean assign a value to a variable. :-)

No.  You're using "assignment" in an incorrect way.

Assignment means setting a variable to a value; these are both assigment:

    FOO = foo
    BAR := bar

After this assignment, FOO is a recursive variable and BAR is a simple
variable.

A reference is when a variable appears somewhere to be expanded; these
are references to variables FOO and BAR respectively:

    $(FOO)
    ${BAR}

-- 
-------------------------------------------------------------------------------
 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]