From ae5415d4a1000022c568932e7a6efa96e684b016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Wed, 10 May 2017 19:09:46 +0200 Subject: Make sure the build fails if a docs/rel/test/shell dep fails Before this change, the build would continue, even if a dependency failed to build. This could lead to obscure errors in the middle of a testsuite for instance. With this change, the build fails immediately, exactly like when a regular dependency fails to build. While here, replace most uses of `|| exit $$?` with `set -e`. This simplifies error handling if we need to add more commands to each blocks. Also, echo error messages to stderr. --- core/deps-tools.mk | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'core/deps-tools.mk') diff --git a/core/deps-tools.mk b/core/deps-tools.mk index d0b5203..de1cc2b 100644 --- a/core/deps-tools.mk +++ b/core/deps-tools.mk @@ -65,22 +65,20 @@ ifeq ($(IS_APP)$(IS_DEP),) $(verbose) rm -f $(ERLANG_MK_RECURSIVE_TMP_LIST) endif ifndef IS_APP - $(verbose) for dep in $(ALL_APPS_DIRS) ; do \ + $(verbose) set -e; for dep in $(ALL_APPS_DIRS) ; do \ $(MAKE) -C $$dep $@ \ IS_APP=1 \ - ERLANG_MK_RECURSIVE_TMP_LIST=$(ERLANG_MK_RECURSIVE_TMP_LIST) \ - || exit $$?; \ + ERLANG_MK_RECURSIVE_TMP_LIST=$(ERLANG_MK_RECURSIVE_TMP_LIST); \ done endif - $(verbose) for dep in $^ ; do \ + $(verbose) set -e; for dep in $^ ; do \ if ! grep -qs ^$$dep$$ $(ERLANG_MK_RECURSIVE_TMP_LIST); then \ echo $$dep >> $(ERLANG_MK_RECURSIVE_TMP_LIST); \ if grep -qs -E "^[[:blank:]]*include[[:blank:]]+(erlang\.mk|.*/erlang\.mk)$$" \ $$dep/GNUmakefile $$dep/makefile $$dep/Makefile; then \ $(MAKE) -C $$dep fetch-deps \ IS_DEP=1 \ - ERLANG_MK_RECURSIVE_TMP_LIST=$(ERLANG_MK_RECURSIVE_TMP_LIST) \ - || exit $$?; \ + ERLANG_MK_RECURSIVE_TMP_LIST=$(ERLANG_MK_RECURSIVE_TMP_LIST); \ fi \ fi \ done -- cgit v1.2.3