[Top][All Lists]

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

Re: empty $? (bug 8154?)

From: Paul D. Smith
Subject: Re: empty $? (bug 8154?)
Date: Tue, 3 Jan 2006 14:51:09 -0500

%% "Jan Beulich" <address@hidden> writes:

  jb> That's why I referred to the first response to bug #8154, which
  jb> doesn't have to do with building archives.

  >> Just to be clear, I tried this makefile:
  >> $ cat Makefile
  >> foo: FORCE ; @echo '$$? = $?'
  >> FORCE:
  >> $ make
  >> $? = FORCE
  >> every time, so I don't understand your comment that FORCE should be
  >> visible in $?, as if it weren't visible there... it IS visible there?

  jb> The difference to the mentioned example is the missing 'touch foo'
  jb> prior to running make. Depending on whether foo exists, $? will or
  jb> will not be empty; its commands, however, will always be run (as
  jb> expected).  My point is that if a target's commands get run,
  jb> should it be obvious that then $? cannot be empty?

You mean, if the target's commands get run AND the target already exists
then $? should not be empty; if the target doesn't exist its commands
will be invoked even if no prerequisites are updated and $? is empty.

Yes, that seems reasonable.

The issue appears to be that the "changed" flag on a prerequisite is not
set if the prerequisite does not exist, but the target is marked to be
rebuilt anyway.  The value of $? is populated only with prerequisites
where the "changed" flag is set.

The question is, is it more appropriate to ensure the "changed" flag is
set for non-existent prerequisites, or to make a more detailed check as
to whether the prerequisite is nonexistent when populating $?.  The
former seems more correct offhand but I wonder what other effects it
might have.

 Paul D. Smith <address@hidden>          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

reply via email to

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