diff options
author | Ron Yorston <rmy@pobox.com> | 2023-12-22 07:48:54 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2023-12-22 08:50:04 +0000 |
commit | 628e1ab2b3af4e9a0d4f8331e20c970db5eba150 (patch) | |
tree | 34fb564165a5051fa199057c0d0854f557332afe /miscutils | |
parent | 8d85a4a5be88931978fad594b94e762313d37afc (diff) | |
download | busybox-w32-628e1ab2b3af4e9a0d4f8331e20c970db5eba150.tar.gz busybox-w32-628e1ab2b3af4e9a0d4f8331e20c970db5eba150.tar.bz2 busybox-w32-628e1ab2b3af4e9a0d4f8331e20c970db5eba150.zip |
make: proper handling of build failure with '-k'
When a build command fails and the '-k' option (continue on error)
is in effect, no further commands should be executed for the
current target.
Also, the resulting diagnostic should be reported to stderr. As
should the final 'not built due to errors' diagnostic.
Adds 80 bytes.
(pdpmake GitHub issue 35)
Diffstat (limited to 'miscutils')
-rw-r--r-- | miscutils/make.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/miscutils/make.c b/miscutils/make.c index 785e25f7d..841daa93e 100644 --- a/miscutils/make.c +++ b/miscutils/make.c | |||
@@ -2221,9 +2221,14 @@ docmds(struct name *np, struct cmd *cp) | |||
2221 | } else if (status != 0 && !signore) { | 2221 | } else if (status != 0 && !signore) { |
2222 | if (!posix && WIFSIGNALED(status)) | 2222 | if (!posix && WIFSIGNALED(status)) |
2223 | remove_target(); | 2223 | remove_target(); |
2224 | if (errcont || doinclude) { | 2224 | if (errcont) { |
2225 | warning("failed to build '%s'", np->n_name); | 2225 | diagnostic("failed to build '%s'", np->n_name); |
2226 | estat |= MAKE_FAILURE; | 2226 | estat |= MAKE_FAILURE; |
2227 | free(command); | ||
2228 | free(cmd); | ||
2229 | break; | ||
2230 | } else if (doinclude) { | ||
2231 | warning("failed to build '%s'", np->n_name); | ||
2227 | } else { | 2232 | } else { |
2228 | const char *err_type = NULL; | 2233 | const char *err_type = NULL; |
2229 | int err_value; | 2234 | int err_value; |
@@ -2488,7 +2493,7 @@ make(struct name *np, int level) | |||
2488 | else if (!doinclude && level == 0 && !(estat & MAKE_DIDSOMETHING)) | 2493 | else if (!doinclude && level == 0 && !(estat & MAKE_DIDSOMETHING)) |
2489 | warning("nothing to be done for %s", np->n_name); | 2494 | warning("nothing to be done for %s", np->n_name); |
2490 | } else if (!doinclude) { | 2495 | } else if (!doinclude) { |
2491 | warning("'%s' not built due to errors", np->n_name); | 2496 | diagnostic("'%s' not built due to errors", np->n_name); |
2492 | } | 2497 | } |
2493 | free(oodate); | 2498 | free(oodate); |
2494 | } | 2499 | } |