[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 16:36:33 -0500

>>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?

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

This patch seems to create the expected behavior.  I haven't found any
situations where it does the wrong thing.  Anyone have comments on this?
Can anyone think of a situation where a prerequisite does not exist, and
is NOT considered updated/changed relative to the target that depends on

When the prerequisite exists there can be more complexity, of course.
But if it doesn't exist?

--- remake.c    7 Dec 2005 11:33:38 -0000       1.119
+++ remake.c    3 Jan 2006 21:26:02 -0000
@@ -530,7 +530,10 @@
       if (!running)
-       d->changed = file_mtime (d->file) != mtime;
+        /* The prereq is considered changed if the timestamp has changed while
+           it was built, OR it doesn't exist.  */
+       d->changed = ((file_mtime (d->file) != mtime)
+                      || (mtime == NONEXISTENT_MTIME));
       lastd = d;
       d = d->next;

 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]