diff options
author | fjoe <fjoe@FreeBSD.org> | 2009-04-07 19:49:38 +0000 |
---|---|---|
committer | fjoe <fjoe@FreeBSD.org> | 2009-04-07 19:49:38 +0000 |
commit | aff2f6a35ad17ffbe8f70440692c7429673cfa57 (patch) | |
tree | 62328bf7f402678c38010811a1c3b152881cb521 /usr.bin/make/make.c | |
parent | c19a362092c477c7ba8435cb7f9756152848d978 (diff) | |
download | FreeBSD-src-aff2f6a35ad17ffbe8f70440692c7429673cfa57.zip FreeBSD-src-aff2f6a35ad17ffbe8f70440692c7429673cfa57.tar.gz |
Avoid infinite loops when remaking makefiles not only
for Makefile targets but also for targets they depend on.
Diffstat (limited to 'usr.bin/make/make.c')
-rw-r--r-- | usr.bin/make/make.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c index 835e855..a6ddc85 100644 --- a/usr.bin/make/make.c +++ b/usr.bin/make/make.c @@ -211,11 +211,15 @@ Make_OODate(GNode *gn) } else { DEBUGF(MAKE, (".EXEC node...")); } - oodate = TRUE; - } else if ((gn->mtime < gn->cmtime) || - ((gn->cmtime == 0) && - ((gn->mtime==0) || (gn->type & OP_DOUBLEDEP)))) { + if (remakingMakefiles) { + DEBUGF(MAKE, ("skipping (remaking makefiles)...")); + oodate = FALSE; + } else { + oodate = TRUE; + } + } else if (gn->mtime < gn->cmtime || + (gn->cmtime == 0 && (gn->mtime == 0 || (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 @@ -226,12 +230,24 @@ Make_OODate(GNode *gn) if (gn->mtime < gn->cmtime) { DEBUGF(MAKE, ("modified before source (%s)...", gn->cmtime_gn ? gn->cmtime_gn->path : "???")); + oodate = TRUE; } else if (gn->mtime == 0) { DEBUGF(MAKE, ("non-existent and no sources...")); + if (remakingMakefiles && Lst_IsEmpty(&gn->commands)) { + DEBUGF(MAKE, ("skipping (no commands and remaking makefiles)...")); + oodate = FALSE; + } else { + oodate = TRUE; + } } else { DEBUGF(MAKE, (":: operator and no sources...")); + if (remakingMakefiles) { + DEBUGF(MAKE, ("skipping (remaking makefiles)...")); + oodate = FALSE; + } else { + oodate = TRUE; + } } - oodate = TRUE; } else oodate = FALSE; |