From caee317e3e73c836e07524f5b3efaf4c1f3f97cd Mon Sep 17 00:00:00 2001 From: "Ivan A. Melnikov" Date: Tue, 3 Sep 2019 14:17:04 +0400 Subject: [PATCH] Ensure non-zero exit code on make failure Before this change, we could have 0 exit code from the main make process even when some targets failed to build on some architectures: $ make ARCH=mipsel [...] vm/tavolga-regular-mate-ex.recovery.tar ** ARCH: mipsel 10:15:06 cleaning up 10:15:06 initializing BUILDDIR: build/ 10:15:06 preparing distro config: build/distcfg.mk make[1]: *** No rule to make target 'use/systemd-coredump', needed by 'profile/.extra'. Stop. [nightly-mipsel@loongson5 mkimage-profiles]$ echo $? 0 Use `make -k' to get the old behaviour. --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index d8687712..97c39a1a 100644 --- a/Makefile +++ b/Makefile @@ -66,6 +66,8 @@ SHELL = /bin/bash if [ -n "$$REPORT" ]; then \ $(MAKE) -f reports.mk ARCH=$$ARCH; \ fi; \ + else \ + exit 1; \ fi; \ done; \ if [ "$$n" -lt "$(NUM_TARGETS)" ]; then say; fi