Index: contrib/bmake/compat.c =================================================================== --- contrib/bmake/compat.c +++ contrib/bmake/compat.c @@ -417,6 +417,8 @@ } } else { status = WTERMSIG(reason); /* signaled */ + if (DEBUG(ERROR)) + DebugFailedTarget(cmd, gn); printf("*** Signal %d", status); } Index: contrib/bmake/job.c =================================================================== --- contrib/bmake/job.c +++ contrib/bmake/job.c @@ -1084,6 +1084,21 @@ job->inPipe = -1; } +static void +DebugFailedJob(Job *job) +{ + const ListNode *l; + + if (!DEBUG(ERROR)) + return; + + debug_printf("\n*** Failed target: %s\n*** Failed commands:\n", + job->node->name); + for (l = job->node->commands.first; l != NULL; l = l->next) { + debug_printf("\t%s\n", (const char *)l->datum); + } +} + static void JobFinishDoneExitedError(Job *job, WAIT_T *inout_status) { @@ -1095,6 +1110,7 @@ } #endif if (!shouldDieQuietly(job->node, -1)) { + DebugFailedJob(job); (void)printf("*** [%s] Error code %d%s\n", job->node->name, WEXITSTATUS(*inout_status), job->ignerr ? " (ignored)" : ""); @@ -1127,6 +1143,7 @@ JobFinishDoneSignaled(Job *job, WAIT_T status) { SwitchOutputTo(job->node); + DebugFailedJob(job); (void)printf("*** [%s] Signal %d\n", job->node->name, WTERMSIG(status)); if (deleteOnError) JobDeleteTarget(job->node);