| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: job.c,v 1.468 2024/04/20 10:18:55 rillig Exp $ */ | | 1 | /* $NetBSD: job.c,v 1.469 2024/04/26 17:11:22 rillig Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. | | 4 | * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to Berkeley by | | 7 | * This code is derived from software contributed to Berkeley by |
8 | * Adam de Boor. | | 8 | * Adam de Boor. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -131,27 +131,27 @@ | | | @@ -131,27 +131,27 @@ |
131 | #ifndef USE_SELECT | | 131 | #ifndef USE_SELECT |
132 | #include <poll.h> | | 132 | #include <poll.h> |
133 | #endif | | 133 | #endif |
134 | #include <signal.h> | | 134 | #include <signal.h> |
135 | #include <utime.h> | | 135 | #include <utime.h> |
136 | | | 136 | |
137 | #include "make.h" | | 137 | #include "make.h" |
138 | #include "dir.h" | | 138 | #include "dir.h" |
139 | #include "job.h" | | 139 | #include "job.h" |
140 | #include "pathnames.h" | | 140 | #include "pathnames.h" |
141 | #include "trace.h" | | 141 | #include "trace.h" |
142 | | | 142 | |
143 | /* "@(#)job.c 8.2 (Berkeley) 3/19/94" */ | | 143 | /* "@(#)job.c 8.2 (Berkeley) 3/19/94" */ |
144 | MAKE_RCSID("$NetBSD: job.c,v 1.468 2024/04/20 10:18:55 rillig Exp $"); | | 144 | MAKE_RCSID("$NetBSD: job.c,v 1.469 2024/04/26 17:11:22 rillig Exp $"); |
145 | | | 145 | |
146 | /* | | 146 | /* |
147 | * A shell defines how the commands are run. All commands for a target are | | 147 | * A shell defines how the commands are run. All commands for a target are |
148 | * written into a single file, which is then given to the shell to execute | | 148 | * written into a single file, which is then given to the shell to execute |
149 | * the commands from it. The commands are written to the file using a few | | 149 | * the commands from it. The commands are written to the file using a few |
150 | * templates for echo control and error control. | | 150 | * templates for echo control and error control. |
151 | * | | 151 | * |
152 | * The name of the shell is the basename for the predefined shells, such as | | 152 | * The name of the shell is the basename for the predefined shells, such as |
153 | * "sh", "csh", "bash". For custom shells, it is the full pathname, and its | | 153 | * "sh", "csh", "bash". For custom shells, it is the full pathname, and its |
154 | * basename is used to select the type of shell; the longest match wins. | | 154 | * basename is used to select the type of shell; the longest match wins. |
155 | * So /usr/pkg/bin/bash has type sh, /usr/local/bin/tcsh has type csh. | | 155 | * So /usr/pkg/bin/bash has type sh, /usr/local/bin/tcsh has type csh. |
156 | * | | 156 | * |
157 | * The echoing of command lines is controlled using hasEchoCtl, echoOff, | | 157 | * The echoing of command lines is controlled using hasEchoCtl, echoOff, |
| @@ -1052,26 +1052,27 @@ JobClosePipes(Job *job) | | | @@ -1052,26 +1052,27 @@ JobClosePipes(Job *job) |
1052 | job->inPipe = -1; | | 1052 | job->inPipe = -1; |
1053 | } | | 1053 | } |
1054 | | | 1054 | |
1055 | static void | | 1055 | static void |
1056 | DebugFailedJob(const Job *job) | | 1056 | DebugFailedJob(const Job *job) |
1057 | { | | 1057 | { |
1058 | const StringListNode *ln; | | 1058 | const StringListNode *ln; |
1059 | | | 1059 | |
1060 | if (!DEBUG(ERROR)) | | 1060 | if (!DEBUG(ERROR)) |
1061 | return; | | 1061 | return; |
1062 | | | 1062 | |
1063 | debug_printf("\n"); | | 1063 | debug_printf("\n"); |
1064 | debug_printf("*** Failed target: %s\n", job->node->name); | | 1064 | debug_printf("*** Failed target: %s\n", job->node->name); |
| | | 1065 | debug_printf("*** In directory: %s\n", curdir); |
1065 | debug_printf("*** Failed commands:\n"); | | 1066 | debug_printf("*** Failed commands:\n"); |
1066 | for (ln = job->node->commands.first; ln != NULL; ln = ln->next) { | | 1067 | for (ln = job->node->commands.first; ln != NULL; ln = ln->next) { |
1067 | const char *cmd = ln->datum; | | 1068 | const char *cmd = ln->datum; |
1068 | debug_printf("\t%s\n", cmd); | | 1069 | debug_printf("\t%s\n", cmd); |
1069 | | | 1070 | |
1070 | if (strchr(cmd, '$') != NULL) { | | 1071 | if (strchr(cmd, '$') != NULL) { |
1071 | char *xcmd = Var_Subst(cmd, job->node, VARE_WANTRES); | | 1072 | char *xcmd = Var_Subst(cmd, job->node, VARE_WANTRES); |
1072 | debug_printf("\t=> %s\n", xcmd); | | 1073 | debug_printf("\t=> %s\n", xcmd); |
1073 | free(xcmd); | | 1074 | free(xcmd); |
1074 | } | | 1075 | } |
1075 | } | | 1076 | } |
1076 | } | | 1077 | } |
1077 | | | 1078 | |