From d237f529bf7988364e307c23d320bc2d0ee00b5c Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Sun, 21 May 2006 14:55:22 +0300 Subject: [PATCH] If make -k was used and a sub-Make fails, build the rest before propagating. --- Makefile.lib | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile.lib b/Makefile.lib index af488125b..c62ff1d5a 100644 --- a/Makefile.lib +++ b/Makefile.lib @@ -210,10 +210,19 @@ RULES_REC = $(addsuffix -recursive,$(RULES)) .PHONY: $(RULES) $(RULES_LOCAL) $(RULES_REC) $(addsuffix -default,$(RULES)) -# The -recursive rules decend all subdirs. +# The -recursive rules descend all subdirs. +# If make -k was used and a sub-Make fails, then keep building the +# remaining subdirectories, but return an error at the end. $(RULES_REC): +ifneq (,$(findstring k,$(MAKEFLAGS))) + @suberr=0; \ + $(foreach subdir,$(sort $(SUBDIRS)), \ + $(call ncmd,recmake,$(subdir),$(subst -recursive,,$@)) || suberr=1;) \ + exit $$suberr +else @$(foreach subdir,$(sort $(SUBDIRS)), \ $(call ncmd,recmake,$(subdir),$(subst -recursive,,$@)) || exit 1;) +endif # Dummy -local rules $(RULES_LOCAL):