aboutsummaryrefslogtreecommitdiffstats
path: root/core/deps.mk
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <[email protected]>2017-05-10 19:09:46 +0200
committerLoïc Hoguin <[email protected]>2017-05-12 11:53:47 +0200
commitae5415d4a1000022c568932e7a6efa96e684b016 (patch)
treef26329540c7b5d1ebe68a1ff2395ff68d926d60c /core/deps.mk
parent8b619436a8307367a3c29684ee17ff4ba0c4ef9b (diff)
downloaderlang.mk-ae5415d4a1000022c568932e7a6efa96e684b016.tar.gz
erlang.mk-ae5415d4a1000022c568932e7a6efa96e684b016.tar.bz2
erlang.mk-ae5415d4a1000022c568932e7a6efa96e684b016.zip
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.
Diffstat (limited to 'core/deps.mk')
-rw-r--r--core/deps.mk24
1 files changed, 12 insertions, 12 deletions
diff --git a/core/deps.mk b/core/deps.mk
index d74a2ae..671ac45 100644
--- a/core/deps.mk
+++ b/core/deps.mk
@@ -58,19 +58,19 @@ endif
# as proper OTP applications when using -include_lib. This is a temporary
# fix, a proper fix would be to compile apps/* in the right order.
ifndef IS_APP
- $(verbose) for dep in $(ALL_APPS_DIRS) ; do \
- mkdir -p $$dep/ebin || exit $$?; \
+ $(verbose) set -e; for dep in $(ALL_APPS_DIRS) ; do \
+ mkdir -p $$dep/ebin; \
done
endif
# at the toplevel: if LOCAL_DEPS is defined with at least one local app, only
# compile that list of apps. otherwise, compile everything.
# within an app: compile all LOCAL_DEPS that are (uncompiled) local apps
- $(verbose) for dep in $(if $(LOCAL_DEPS_DIRS)$(IS_APP),$(LOCAL_DEPS_DIRS),$(ALL_APPS_DIRS)) ; do \
+ $(verbose) set -e; for dep in $(if $(LOCAL_DEPS_DIRS)$(IS_APP),$(LOCAL_DEPS_DIRS),$(ALL_APPS_DIRS)) ; do \
if grep -qs ^$$dep$$ $(ERLANG_MK_TMP)/apps.log; then \
:; \
else \
echo $$dep >> $(ERLANG_MK_TMP)/apps.log; \
- $(MAKE) -C $$dep IS_APP=1 || exit $$?; \
+ $(MAKE) -C $$dep IS_APP=1; \
fi \
done
@@ -84,15 +84,15 @@ deps::
else
deps:: $(ALL_DEPS_DIRS) apps clean-tmp-deps.log
$(verbose) mkdir -p $(ERLANG_MK_TMP)
- $(verbose) for dep in $(ALL_DEPS_DIRS) ; do \
+ $(verbose) set -e; for dep in $(ALL_DEPS_DIRS) ; do \
if grep -qs ^$$dep$$ $(ERLANG_MK_TMP)/deps.log; then \
:; \
else \
echo $$dep >> $(ERLANG_MK_TMP)/deps.log; \
if [ -f $$dep/GNUmakefile ] || [ -f $$dep/makefile ] || [ -f $$dep/Makefile ]; then \
- $(MAKE) -C $$dep IS_DEP=1 || exit $$?; \
+ $(MAKE) -C $$dep IS_DEP=1; \
else \
- echo "Error: No Makefile to build dependency $$dep."; \
+ echo "Error: No Makefile to build dependency $$dep." >&2; \
exit 2; \
fi \
fi \
@@ -525,7 +525,7 @@ $(DEPS_DIR)/$(call dep_name,$1):
$(eval DEP_NAME := $(call dep_name,$1))
$(eval DEP_STR := $(if $(filter-out $1,$(DEP_NAME)),$1,"$1 ($(DEP_NAME))"))
$(verbose) if test -d $(APPS_DIR)/$(DEP_NAME); then \
- echo "Error: Dependency" $(DEP_STR) "conflicts with application found in $(APPS_DIR)/$(DEP_NAME)."; \
+ echo "Error: Dependency" $(DEP_STR) "conflicts with application found in $(APPS_DIR)/$(DEP_NAME)." >&2; \
exit 17; \
fi
$(verbose) mkdir -p $(DEPS_DIR)
@@ -567,15 +567,15 @@ ifndef IS_APP
clean:: clean-apps
clean-apps:
- $(verbose) for dep in $(ALL_APPS_DIRS) ; do \
- $(MAKE) -C $$dep clean IS_APP=1 || exit $$?; \
+ $(verbose) set -e; for dep in $(ALL_APPS_DIRS) ; do \
+ $(MAKE) -C $$dep clean IS_APP=1; \
done
distclean:: distclean-apps
distclean-apps:
- $(verbose) for dep in $(ALL_APPS_DIRS) ; do \
- $(MAKE) -C $$dep distclean IS_APP=1 || exit $$?; \
+ $(verbose) set -e; for dep in $(ALL_APPS_DIRS) ; do \
+ $(MAKE) -C $$dep distclean IS_APP=1; \
done
endif