Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make Don't create targets if dependant files marked ...



details:   https://anonhg.NetBSD.org/src/rev/bcfbb3c58ea2
branches:  trunk
changeset: 555339:bcfbb3c58ea2
user:      dsl <dsl%NetBSD.org@localhost>
date:      Fri Nov 14 22:32:44 2003 +0000

description:
Don't create targets if dependant files marked .OPTIONAL are missing.

diffstat:

 usr.bin/make/make.c |  23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)

diffs (68 lines):

diff -r 387d8200e4cf -r bcfbb3c58ea2 usr.bin/make/make.c
--- a/usr.bin/make/make.c       Fri Nov 14 21:22:08 2003 +0000
+++ b/usr.bin/make/make.c       Fri Nov 14 22:32:44 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.c,v 1.51 2003/08/07 11:14:54 agc Exp $    */
+/*     $NetBSD: make.c,v 1.52 2003/11/14 22:32:44 dsl Exp $    */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifdef MAKE_BOOTSTRAP
-static char rcsid[] = "$NetBSD: make.c,v 1.51 2003/08/07 11:14:54 agc Exp $";
+static char rcsid[] = "$NetBSD: make.c,v 1.52 2003/11/14 22:32:44 dsl Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)make.c     8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: make.c,v 1.51 2003/08/07 11:14:54 agc Exp $");
+__RCSID("$NetBSD: make.c,v 1.52 2003/11/14 22:32:44 dsl Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -264,7 +264,7 @@
        if (DEBUG(MAKE)) {
            printf("source %smade...", gn->flags & CHILDMADE ? "" : "not ");
        }
-       oodate = (gn->flags & CHILDMADE) ? 1 : 0;
+       oodate = (gn->flags & CHILDMADE) ? TRUE : FALSE;
     } else if (gn->type & (OP_FORCE|OP_EXEC|OP_PHONY)) {
        /*
         * A node which is the object of the force (!) operator or which has
@@ -280,16 +280,17 @@
            }
        }
        oodate = TRUE;
-    } else if ((gn->mtime < gn->cmtime) ||
-              ((gn->cmtime == 0) &&
-               ((gn->mtime==0) || (gn->type & OP_DOUBLEDEP))))
+    } else if (gn->mtime < gn->cmtime ||
+              (gn->cmtime == 0 &&
+               ((gn->mtime == 0 && !(gn->type & OP_OPTIONAL))
+                 || gn->type & OP_DOUBLEDEP)))
     {
        /*
         * A node whose modification time is less than that of its
         * youngest child or that has no children (cmtime == 0) and
-        * either doesn't exist (mtime == 0) or was the object of a
-        * :: operator is out-of-date. Why? Because that's the way Make does
-        * it.
+        * either doesn't exist (mtime == 0) and it isn't optional
+        * or was the object of a * :: operator is out-of-date.
+        * Why? Because that's the way Make does it.
         */
        if (DEBUG(MAKE)) {
            if (gn->mtime < gn->cmtime) {
@@ -313,7 +314,7 @@
            if (gn->flags & FORCE)
                printf("non existing child...");
        }
-       oodate = (gn->flags & FORCE) ? 1 : 0;
+       oodate = (gn->flags & FORCE) ? TRUE : FALSE;
     }
 
     /*



Home | Main Index | Thread Index | Old Index