[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: = or := for asignment?
From: |
Paul Smith |
Subject: |
RE: = or := for asignment? |
Date: |
Wed, 07 Mar 2012 08:48:43 -0500 |
On Wed, 2012-03-07 at 05:15 -0800, Mark Galeck (CW) wrote:
> "Immediate" means, the value is assigned as soon as make sees the
> assignment. That is :=
>
> "Deferred" means, the assignment is noted but the value is not
> assigned until it is necessary to do so later. That is =
These statements are slightly misleading. A value is _assigned_ to a
variable when make reads the assignment line, regardless of whether you
use = or :=.
The difference (as described in the manual) is when the value is
_expanded_. In a deferred assignment (=) the value is not expanded
until sometime later, when the variable is used in an immediate context.
In an immediate assignment (:=) the value is expanded before it is
assigned (and then not expanded again when the variable is used).
See if the manual's description is helpful.
Cheers!
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.mad-scientist.net
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist