On Wed, 2008-10-22 at 09:39 -0500, Peng Yu wrote:
> BTW, what is the general rule of thumb to use := rather =? When I
> should use = rather :=?

These are described fairly well in the GNU make manual.

:= is evaluated once, when the makefile is read.  = is re-evaluated
every time the variable is used.

:= is always more efficient (assuming you use the variable more than
once) and this is especially important for things like $(shell ...)
which are very expensive (comparatively); using = means that shell is
re-invoked EVERY TIME the variable is expanded in your makefile.

The downside of := is that any changes made after the line is read in
don't have any effect.  So, in your case, if you use := it will only
contain the directories that existed when the makefile was read in, and
not any directories that may be created during the operation of the
makefile.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.us
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to