On Sat, 2008-03-15 at 10:36 +0530, chandan wrote: > In the above makefile $(LIST) appears in the prerequiste list of both > "all" and ".PHONY" which happen to be expanded in an immediate > context. The output shows that $(LIST) (within commands section) is > expanded in the second phase i.e target-update phase (even though > $(LIST) appears later in an immediate context).
Each reference to a variable is expanded separately, depending on its context. When a reference to the LIST variable, $(LIST), appears in an immediate context it's expanded immediately. When a reference to the LIST variable appears in a deferred context, it's not expanded at that time. When a variable is expanded the value of the variable itself is not changed. Instead, the expanded value is substituted into the text, then make parses it. The only way the value of a variable is ever changed is by assignment. -- ----------------------------------------------------------------------------- Paul D. Smith <[EMAIL PROTECTED]> 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
