diff options
-rw-r--r-- | usr.bin/make/compat.c | 10 | ||||
-rw-r--r-- | usr.bin/make/engine.c | 13 | ||||
-rw-r--r-- | usr.bin/make/gnode.h | 4 | ||||
-rw-r--r-- | usr.bin/make/targ.c | 3 |
4 files changed, 17 insertions, 13 deletions
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c index 86585e73fb9..91e20e53262 100644 --- a/usr.bin/make/compat.c +++ b/usr.bin/make/compat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compat.c,v 1.80 2013/05/22 12:14:08 espie Exp $ */ +/* $OpenBSD: compat.c,v 1.81 2013/05/25 11:54:14 espie Exp $ */ /* $NetBSD: compat.c,v 1.14 1996/11/06 17:59:01 christos Exp $ */ /* @@ -217,15 +217,15 @@ CompatMake(void *gnp, /* The node to make */ */ if (noExecute || is_out_of_date(Dir_MTime(gn))) clock_gettime(CLOCK_REALTIME, &gn->mtime); - if (is_strictly_before(gn->mtime, gn->youngest->mtime)) - gn->mtime = gn->youngest->mtime; + if (is_strictly_before(gn->mtime, gn->cmtime)) + gn->mtime = gn->cmtime; if (sib != gn) { if (noExecute || is_out_of_date(Dir_MTime(sib))) clock_gettime(CLOCK_REALTIME, &sib->mtime); if (is_strictly_before(sib->mtime, - sib->youngest->mtime)) - sib->mtime = sib->youngest->mtime; + sib->cmtime)) + sib->mtime = sib->cmtime; } if (DEBUG(MAKE)) printf("update time: %s\n", diff --git a/usr.bin/make/engine.c b/usr.bin/make/engine.c index f5ae21da8fa..f40fd03c6fd 100644 --- a/usr.bin/make/engine.c +++ b/usr.bin/make/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.43 2013/05/22 12:14:08 espie Exp $ */ +/* $OpenBSD: engine.c,v 1.44 2013/05/25 11:54:14 espie Exp $ */ /* * Copyright (c) 2012 Marc Espie. * @@ -286,8 +286,9 @@ Job_Touch(GNode *gn) void Make_TimeStamp(GNode *parent, GNode *child) { - if (is_strictly_before(parent->youngest->mtime, child->mtime)) { - parent->youngest = child; + if (is_strictly_before(parent->cmtime, child->mtime)) { + parent->youngest = child; + parent->cmtime = child->mtime; } } @@ -490,8 +491,8 @@ Make_OODate(GNode *gn) printf(".EXEC node..."); } oodate = true; - } else if (is_strictly_before(gn->mtime, gn->youngest->mtime) || - (is_out_of_date(gn->youngest->mtime) && + } else if (is_strictly_before(gn->mtime, gn->cmtime) || + (is_out_of_date(gn->cmtime) && (is_out_of_date(gn->mtime) || (gn->type & OP_DOUBLEDEP)))) { /* * A node whose modification time is less than that of its @@ -500,7 +501,7 @@ Make_OODate(GNode *gn) * or was the object of a :: operator is out-of-date. */ if (DEBUG(MAKE)) { - if (is_strictly_before(gn->mtime, gn->youngest->mtime)) + if (is_strictly_before(gn->mtime, gn->cmtime)) printf("modified before source(%s)...", gn->youngest->name); else if (is_out_of_date(gn->mtime)) diff --git a/usr.bin/make/gnode.h b/usr.bin/make/gnode.h index 2a280abd136..77dc98c6bc8 100644 --- a/usr.bin/make/gnode.h +++ b/usr.bin/make/gnode.h @@ -1,6 +1,6 @@ #ifndef GNODE_H #define GNODE_H -/* $OpenBSD: gnode.h,v 1.26 2013/05/22 12:14:08 espie Exp $ */ +/* $OpenBSD: gnode.h,v 1.27 2013/05/25 11:54:14 espie Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -144,6 +144,8 @@ struct GNode_ { int unmade; /* The number of unmade children */ struct timespec mtime; /* Its modification time */ + struct timespec cmtime; /* The modification time of its youngest + * child */ GNode *youngest; /* Its youngest child */ GNode *impliedsrc; diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c index 8c797866148..8d87d940477 100644 --- a/usr.bin/make/targ.c +++ b/usr.bin/make/targ.c @@ -1,4 +1,4 @@ -/* $OpenBSD: targ.c,v 1.72 2013/05/22 12:14:08 espie Exp $ */ +/* $OpenBSD: targ.c,v 1.73 2013/05/25 11:54:14 espie Exp $ */ /* $NetBSD: targ.c,v 1.11 1997/02/20 16:51:50 christos Exp $ */ /* @@ -158,6 +158,7 @@ Targ_NewGNi(const char *name, const char *ename) gn->childMade = false; gn->order = 0; ts_set_out_of_date(gn->mtime); + ts_set_out_of_date(gn->cmtime); gn->youngest = gn; Lst_Init(&gn->cohorts); Lst_Init(&gn->parents); |