%% Regarding a small problem...;
%% "Tehn Yit Chin" <[EMAIL PROTECTED]> writes:

  tyc> .PHONY:  debug all

  tyc> OBJECTS     := fred.txt
  tyc> CDE         := debug.txt

  tyc> debug : OBJECTS = $(OBJECTS) $(CDE)
  tyc> debug : all

  tyc> all : $(OBJECTS)
  tyc>      @echo $(OBJECTS) "executing target=all"

  tyc> fred.txt :
  tyc>      @echo $(OBJECTS) "executing target=fred.txt"

  tyc> debug.txt :
  tyc>      @echo $(OBJECTS) "executing target=debug.txt"

  tyc> fred.txt debug.txt executing target=fred.txt
  tyc> fred.txt debug.txt executing target=all

  tyc> My question is shouldn't the "debug" target cause it to include
  tyc> debug.txt as a dependency as well as fred.txt? The above small
  tyc> test does not seem to back this up.

See the GNU make manual: target-specific variables are only valid within
command scripts, and within the context of other target-specific
variables.  So, the value of $(OBJECT) when it's expanded in the
prerequisites list is not in those categories and so doesn't take into
account target-specific variable values.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          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


_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to