From 58540e90a5269604cb11857c0f579a915a85de58 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Thu, 1 Oct 2015 13:24:50 -0700 Subject: Cause "make buildall -j" to yell about failures. When building with -j, it's easy to miss errors. If you don't have your shell configured to warn you about nonzero exit, you may not even notice that "make buildall -j" failed. To make it more obvious, we'll do one level of recursion for that target. That will ensure that the last line of output is always a pass/fail message. BUG=none BRANCH=none TEST=make buildall -j (with and without errors) Before this CL, a successful "make buildall -j" ends with this: MV ec.bin OBJCOPY ec.hex LD RW/ec.RW.elf NM RO/ec.RO.smap OBJCOPY RO/ec.RO.flat NM RW/ec.RW.smap OBJCOPY RW/ec.RW.flat CAT ec.obj OBJCOPY ec.bin COPY_RW ec.bin MV ec.bin buildall completed successfully! (cr) ((fa7baa6...)) ~/trunk/src/platform/ec $ while a failing one looks like this: MV ec.bin OBJCOPY ec.hex LD RW/ec.RW.elf NM RO/ec.RO.smap OBJCOPY RO/ec.RO.flat NM RW/ec.RW.smap OBJCOPY RW/ec.RW.flat CAT ec.obj OBJCOPY ec.bin COPY_RW ec.bin MV ec.bin (cr) ((fa7baa6...)) ~/trunk/src/platform/ec $ Did you see the difference? I suspect some people miss it. With this CL, a failing "make buildall -j" looks like this: NM RW/ec.RW.smap OBJCOPY RW/ec.RW.flat CAT ec.obj OBJCOPY ec.bin NM RW/chip/mec1322/lfw/ec_lfw-lfw.smap OBJCOPY RW/chip/mec1322/lfw/ec_lfw-lfw.flat COPY_RW ec.bin MV ec.bin COPY_RW ec.bin MV ec.bin OBJCOPY ec.bin COPY_RW ec.bin MV ec.bin make[1]: Leaving directory '/mnt/host/source/src/platform/ec' Makefile.rules:93: recipe for target 'buildall' failed make: *** [buildall] Error 2 (cr) (stopit) ~/trunk/src/platform/ec $ Change-Id: Id9b47d2869f61e8e3e44b3c618399ca9223f0a71 Signed-off-by: Bill Richardson Reviewed-on: https://chromium-review.googlesource.com/303811 Reviewed-by: Aseda Aboagye --- Makefile.rules | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile.rules b/Makefile.rules index cdd75caa33..32ba66a8ba 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -81,8 +81,17 @@ cmd_etags = etags -o $@ $(shell cat $<) cmd_ctags = ctags -o $@ $(shell cat $<) targ_if_prog = $(if $(shell which $(1) 2>/dev/null),$(2),) +# When building with -j, it's easy to miss errors. If you don't have your shell +# configured to warn you about nonzero exit, you may not even notice that "make +# buildall -j" failed. To make it more obvious, we'll do one level of recursion +# here. +.PHONY: try_buildall +try_buildall: $(foreach b, $(boards), proj-$(b)) + .PHONY: buildall -buildall: $(foreach b, $(boards), proj-$(b)) runtests +buildall: + $(MAKE) try_buildall + $(MAKE) runtests @touch .tests-passed @echo "$@ completed successfully!" -- cgit v1.2.1