%% John Graham-Cumming <[EMAIL PROTECTED]> writes:

  jg> Paul D. Smith wrote:
  >> $ cat makefile
  >> 
  >> foo: bar ; @echo "\$$? = $?"
  >> bar: ;
  >> 
  >> $ touch foo
  >> 
  >> $ make
  >> $? = 

  jg> OK.  I see that works, now why?  I'm assuming that the difference
  jg> between bar: and bar: ; is that GNU Make thinks that it's updated
  jg> bar in the latter case, but in the former it does not.

  jg> What I'm not sure about is why $? contains bar if I do bar: How
  jg> does that come about?  Is that because bar: is a 'FORCE' target
  jg> and hence GNU Make is pretending it's up to date and hence it gets
  jg> put into $?

I'm not quite sure what you're asking.

bar should appear in $? in both situations (with or without the ";")
because in both situations, make has decided to rebuild "foo" because
"bar" is "newer".

So, the bug is that "bar" is not present in "$?" when it should be;
basically, $? is only set to prerequisites that are newer than the
target _AND_ that actually exist.  In this case, the prerequisite is
considered newer, but doesn't exist.

-- 
-------------------------------------------------------------------------------
 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://lists.gnu.org/mailman/listinfo/help-make

Reply via email to