[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Post 3.81 $? handling

From: Paul D. Smith
Subject: Re: Post 3.81 $? handling
Date: Mon, 1 May 2006 09:13:00 -0400

%% John Graham-Cumming <address@hidden> 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 <address@hidden>          Find some GNU make tips at:            
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

reply via email to

[Prev in Thread] Current Thread [Next in Thread]