aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--miscutils/make.c11
-rwxr-xr-xtestsuite/make.tests14
2 files changed, 22 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 }
diff --git a/testsuite/make.tests b/testsuite/make.tests
index 3c2aa5cf5..745a840f3 100755
--- a/testsuite/make.tests
+++ b/testsuite/make.tests
@@ -102,6 +102,20 @@ a = a
102target:;@echo a = $(a) 102target:;@echo a = $(a)
103' 103'
104 104
105# When a build command fails and the '-k' option has been provided
106# (continue execution on error) no further commands should be executed
107# for the current target.
108testing "make failure of build command with -k" \
109 "make -k -f - 2>/dev/null" "OK\n" "" '
110all: bar baz
111bar:
112 @echo OK
113 @false
114 @echo Not reached
115baz:
116 @:
117'
118
105# A macro created using ::= remembers it's of type immediate-expansion. 119# A macro created using ::= remembers it's of type immediate-expansion.
106# Immediate expansion also occurs when += is used to append to such a macro. 120# Immediate expansion also occurs when += is used to append to such a macro.
107testing "make appending to immediate-expansion macro" \ 121testing "make appending to immediate-expansion macro" \