From 711037246e3ddfae7d52ff44a0f5d8d1c50e20eb Mon Sep 17 00:00:00 2001 From: fjoe Date: Fri, 20 Apr 2007 06:33:25 +0000 Subject: Improve logging when -dm is specified: if the node is considered out-of-date print not only "modified before source" message but also the path of youngest source. --- usr.bin/make/GNode.h | 1 + usr.bin/make/make.c | 13 +++++-------- usr.bin/make/targ.c | 1 + 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/usr.bin/make/GNode.h b/usr.bin/make/GNode.h index 382da55..71d2afd 100644 --- a/usr.bin/make/GNode.h +++ b/usr.bin/make/GNode.h @@ -170,6 +170,7 @@ typedef struct GNode { int unmade; /* The number of unmade children */ int mtime; /* Its modification time */ int cmtime; /* Modification time of its youngest child */ + struct GNode *cmtime_gn;/* Youngest child */ /* * Links to parents for which this is an implied source, if any. (nodes diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c index 9a39a9e..4ac5bb6 100644 --- a/usr.bin/make/make.c +++ b/usr.bin/make/make.c @@ -118,6 +118,7 @@ Make_TimeStamp(GNode *pgn, GNode *cgn) if (cgn->mtime > pgn->cmtime) { pgn->cmtime = cgn->mtime; + pgn->cmtime_gn = cgn; } return (0); } @@ -223,7 +224,8 @@ Make_OODate(GNode *gn) * Make does it. */ if (gn->mtime < gn->cmtime) { - DEBUGF(MAKE, ("modified before source...")); + DEBUGF(MAKE, ("modified before source (%s)...", + gn->cmtime_gn ? gn->cmtime_gn->path : "???")); } else if (gn->mtime == 0) { DEBUGF(MAKE, ("non-existent and no sources...")); } else { @@ -421,14 +423,9 @@ Make_Update(GNode *cgn) pgn->unmade -= 1; if (!(cgn->type & (OP_EXEC | OP_USE))) { - if (cgn->made == MADE) { + if (cgn->made == MADE) pgn->childMade = TRUE; - if (pgn->cmtime < cgn->mtime) { - pgn->cmtime = cgn->mtime; - } - } else { - Make_TimeStamp(pgn, cgn); - } + Make_TimeStamp(pgn, cgn); } if (pgn->unmade == 0) { /* diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c index fab3189..eac121e 100644 --- a/usr.bin/make/targ.c +++ b/usr.bin/make/targ.c @@ -141,6 +141,7 @@ Targ_NewGN(const char *name) gn->childMade = FALSE; gn->order = 0; gn->mtime = gn->cmtime = 0; + gn->cmtime_gn = NULL; Lst_Init(&gn->iParents); Lst_Init(&gn->cohorts); Lst_Init(&gn->parents); -- cgit v1.1