%% Darren Hiebert <[EMAIL PROTECTED]> writes:

  dh> This is a report for make-3.78.1
  dh> The following use of a target specific variable loses its value. If
  dh> you issue the command "make r1", VALUE is set to rule1 and rule1 is
  dh> executed through the value of VALUE. If you issue the command "make
  dh> r2", VALUE is set to rule2, but rule1 is still executed even though
  dh> the value of VALUE is rule2.

  dh> # Begin Makefile
  dh> VALUE = rule1
  dh> r2: VALUE = rule2

  dh> rule1 rule2:
  dh>   @ echo "$@ executed"

  dh> show_value:
  dh>   @ echo "VALUE = $(VALUE)"

  dh> r1 r2: show_value $(VALUE)
  dh> # End Makefile

This is not a bug.

Just like automatic variables ($@, $<, etc.) target-specific variable
values are available _only_ when expanding the command script for a
given target, _not_ when expanding the target or prerequisite lists.

See the GNU make manual section describing target-specific variables
``Target-Specific Variable Values''; specifically the second paragraph.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.

Reply via email to