summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2012-04-21 04:35:33 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2012-04-21 04:35:33 +0000
commit237d39769253d1ac61d5938360366c39f2221a27 (patch)
tree876a4182a87bde01ea30016ed6bce07df78249f7 /usr.bin
parent033c62c08a82d5b5e1c6b2be7fc485ac88c4e2b1 (diff)
When a new parent is attached to an already examined child (prerequisite),
use the same logic to update the parent (factored out as SuffLinkParent()) as is used for updating the original parent. Fixes the "make -j2" problem reported by tedu@ at c2k11 ok espie@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/make/make.c11
-rw-r--r--usr.bin/make/suff.c38
2 files changed, 23 insertions, 26 deletions
diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c
index 91501697ede..1c509ddfcfc 100644
--- a/usr.bin/make/make.c
+++ b/usr.bin/make/make.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: make.c,v 1.62 2011/11/03 20:55:22 schwarze Exp $ */
+/* $OpenBSD: make.c,v 1.63 2012/04/21 04:35:32 guenther Exp $ */
/* $NetBSD: make.c,v 1.10 1996/11/06 17:59:15 christos Exp $ */
/*
@@ -259,14 +259,9 @@ Make_Update(GNode *cgn) /* the child node */
pgn->name, pgn->unmade);
if ( ! (cgn->type & (OP_EXEC|OP_USE))) {
- if (cgn->built_status == MADE) {
+ if (cgn->built_status == MADE)
pgn->childMade = true;
- if (is_strictly_before(pgn->cmtime,
- cgn->mtime))
- pgn->cmtime = cgn->mtime;
- } else {
- (void)Make_TimeStamp(pgn, cgn);
- }
+ (void)Make_TimeStamp(pgn, cgn);
}
if (pgn->unmade == 0) {
/*
diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c
index 4a9a480c0f5..a6437d70b9e 100644
--- a/usr.bin/make/suff.c
+++ b/usr.bin/make/suff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: suff.c,v 1.79 2010/07/19 19:46:44 espie Exp $ */
+/* $OpenBSD: suff.c,v 1.80 2012/04/21 04:35:32 guenther Exp $ */
/* $NetBSD: suff.c,v 1.13 1996/11/06 17:59:25 christos Exp $ */
/*
@@ -1061,6 +1061,19 @@ SuffFindCmds(
}
static void
+SuffLinkParent(GNode *cgn, GNode *pgn)
+{
+ Lst_AtEnd(&cgn->parents, pgn);
+ if (!has_been_built(cgn))
+ pgn->unmade++;
+ else if ( ! (cgn->type & (OP_EXEC|OP_USE))) {
+ if (cgn->built_status == MADE)
+ pgn->childMade = true;
+ (void)Make_TimeStamp(pgn, cgn);
+ }
+}
+
+static void
SuffExpandVarChildren(LstNode after, GNode *cgn, GNode *pgn)
{
GNode *gn; /* New source 8) */
@@ -1136,9 +1149,7 @@ SuffExpandVarChildren(LstNode after, GNode *cgn, GNode *pgn)
if (Lst_Member(&pgn->children, gn) == NULL) {
Lst_Append(&pgn->children, after, gn);
after = Lst_Adv(after);
- Lst_AtEnd(&gn->parents, pgn);
- if (!has_been_built(gn))
- pgn->unmade++;
+ SuffLinkParent(gn, pgn);
}
}
/* Free the result. */
@@ -1191,9 +1202,7 @@ SuffExpandWildChildren(LstNode after, GNode *cgn, GNode *pgn)
if (Lst_Member(&pgn->children, gn) == NULL) {
Lst_Append(&pgn->children, after, gn);
after = Lst_Adv(after);
- Lst_AtEnd(&gn->parents, pgn);
- if (!has_been_built(gn))
- pgn->unmade++;
+ SuffLinkParent(gn, pgn);
}
}
@@ -1279,9 +1288,7 @@ SuffApplyTransform(
if (Lst_AddNew(&tGn->children, sGn)) {
/* Not already linked, so form the proper links between the
* target and source. */
- Lst_AtEnd(&sGn->parents, tGn);
- if (!has_been_built(sGn))
- tGn->unmade++;
+ SuffLinkParent(sGn, tGn);
}
if ((sGn->type & OP_OPMASK) == OP_DOUBLEDEP) {
@@ -1295,9 +1302,7 @@ SuffApplyTransform(
if (Lst_AddNew(&tGn->children, gn)) {
/* Not already linked, so form the proper links
* between the target and source. */
- Lst_AtEnd(&gn->parents, tGn);
- if (!has_been_built(gn))
- tGn->unmade++;
+ SuffLinkParent(gn, tGn);
}
}
}
@@ -1389,11 +1394,8 @@ SuffFindArchiveDeps(
SuffFindDeps(mem, slst);
/* Create the link between the two nodes right off. */
- if (Lst_AddNew(&gn->children, mem)) {
- Lst_AtEnd(&mem->parents, gn);
- if (!has_been_built(mem))
- gn->unmade++;
- }
+ if (Lst_AddNew(&gn->children, mem))
+ SuffLinkParent(mem, gn);
/* Copy variables from member node to this one. */
Var(TARGET_INDEX, gn) = Var(TARGET_INDEX, mem);