diff options
author | obrien <obrien@FreeBSD.org> | 2008-12-29 10:26:02 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2008-12-29 10:26:02 +0000 |
commit | 489c6b7af54b6bdfecf46c055927d2452f709060 (patch) | |
tree | c6e64510fb221bf014c31a9eca386fd987b8428f /usr.bin/make/job.c | |
parent | 5d8be9f4c70013a263eed7a02eff028099f7bbad (diff) | |
download | FreeBSD-src-489c6b7af54b6bdfecf46c055927d2452f709060.zip FreeBSD-src-489c6b7af54b6bdfecf46c055927d2452f709060.tar.gz |
1. Add the ability to tweak the token output before targets in job mode.
E.g., .MAKE.JOB.PREFIX=${.newline}---[${.MAKE.PID}]
would produce
---[1234] target ---
2. Added ${.newline} as a simple means of being able to include '\n' in the
assignment of .MAKE.JOB.PREFIX
Obtained from: NetBSD
Diffstat (limited to 'usr.bin/make/job.c')
-rw-r--r-- | usr.bin/make/job.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index 7cc575e..5bd5456 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -321,10 +321,11 @@ static GNode *lastNode; /* The node for which output was most recently static const char *targFmt; /* Format string to use to head output from a * job when it's not the most-recent job heard * from */ +static char *targPrefix = NULL; /* What we print at the start of targFmt */ -#define TARG_FMT "--- %s ---\n" /* Default format */ +#define TARG_FMT "%s %s ---\n" /* Default format */ #define MESSAGE(fp, gn) \ - fprintf(fp, targFmt, gn->name); + fprintf(fp, targFmt, targPrefix, gn->name); /* * When JobStart attempts to run a job but isn't allowed to @@ -2283,6 +2284,18 @@ Job_Make(GNode *gn) JobStart(gn, 0, NULL); } +void +Job_SetPrefix(void) +{ + + if (targPrefix) { + free(targPrefix); + } else if (!Var_Exists(MAKE_JOB_PREFIX, VAR_GLOBAL)) { + Var_SetGlobal(MAKE_JOB_PREFIX, "---"); + } + targPrefix = Var_Subst("${" MAKE_JOB_PREFIX "}", VAR_GLOBAL, 0)->buf; +} + /** * Job_Init * Initialize the process module, given a maximum number of jobs. @@ -2350,7 +2363,7 @@ Job_Init(int maxproc) lastNode = NULL; - if ((maxJobs == 1 && fifoFd < 0) || beVerbose == 0) { + if (maxJobs == 1 && fifoFd < 0) { /* * If only one job can run at a time, there's no need for a * banner, no is there? |