Index: contrib/bmake/job.c =================================================================== --- contrib/bmake/job.c +++ contrib/bmake/job.c @@ -1066,7 +1066,8 @@ } if (WEXITSTATUS(status) != 0) { if (job->node != lastNode) { - MESSAGE(stdout, job->node); + if (DEBUG(JOB)) + MESSAGE(stdout, job->node); lastNode = job->node; } #ifdef USE_META @@ -1074,10 +1075,12 @@ meta_job_error(job, job->node, job->flags, WEXITSTATUS(status)); } #endif - (void)printf("*** [%s] Error code %d%s\n", + if (DEBUG(JOB)) { + (void)printf("*** [%s] Error code %d%s\n", job->node->name, - WEXITSTATUS(status), - (job->flags & JOB_IGNERR) ? " (ignored)" : ""); + WEXITSTATUS(status), + (job->flags & JOB_IGNERR) ? " (ignored)" : ""); + } if (job->flags & JOB_IGNERR) { WAIT_STATUS(status) = 0; } else { @@ -3068,7 +3071,10 @@ /* And put the stopper back */ while (write(tokenWaitJob.outPipe, &tok, 1) == -1 && errno == EAGAIN) continue; - Fatal("A failure has been detected in another branch of the parallel make"); + if (DEBUG(JOB)) + Fatal("A failure has been detected in another branch of the parallel make"); + else + Fatal(NULL); } if (count == 1 && jobTokensRunning == 0) Index: contrib/bmake/main.c =================================================================== --- contrib/bmake/main.c +++ contrib/bmake/main.c @@ -127,6 +127,7 @@ #include #include #include +#include #include #include #include @@ -1805,14 +1806,16 @@ { va_list ap; - va_start(ap, fmt); if (jobsRunning) Job_Wait(); (void)fflush(stdout); - (void)vfprintf(stderr, fmt, ap); - va_end(ap); - (void)fprintf(stderr, "\n"); + if (fmt != NULL) { + va_start(ap, fmt); + (void)vfprintf(stderr, fmt, ap); + va_end(ap); + (void)fprintf(stderr, "\n"); + } (void)fflush(stderr); PrintOnError(NULL, NULL); @@ -1889,7 +1892,10 @@ Finish(int errors) /* number of errors encountered in Make_Make */ { - Fatal("%d error%s", errors, errors == 1 ? "" : "s"); + if (DEBUG(JOB)) + Fatal("%d error%s", errors, errors == 1 ? "" : "s"); + else + Fatal(NULL); } /* @@ -2047,11 +2053,17 @@ static GNode *en = NULL; char tmp[64]; char *cp; + bool printed = false; - if (s) + if (s) { printf("%s", s); - - printf("\n%s: stopped in %s\n", progname, curdir); + printed = true; + } + + if (DEBUG(CWD)) { + printf("\n%s: stopped in %s\n", progname, curdir); + printed = true; + } if (en) return; /* we've been here! */ @@ -2067,11 +2079,14 @@ sizeof(tmp) - 1); cp = Var_Subst(NULL, tmp, VAR_GLOBAL, VARF_WANTRES); if (cp) { - if (*cp) + if (*cp) { printf("%s", cp); + printed = true; + } free(cp); } - fflush(stdout); + if (printed) + fflush(stdout); /* * Finally, see if there is a .ERROR target, and run it if so.