aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJeffrey Griffin <[email protected]>2017-03-04 22:35:18 -0800
committerLoïc Hoguin <[email protected]>2017-04-25 14:49:13 +0200
commit9ca56c45850709473f60bf5de71008a747d4e27b (patch)
tree7779dd5fd23fb3b6ac83f1a6ce000add9b9bdfca /core
parentf4e69407d886546e154d57c668cb246abb38abf6 (diff)
downloaderlang.mk-9ca56c45850709473f60bf5de71008a747d4e27b.tar.gz
erlang.mk-9ca56c45850709473f60bf5de71008a747d4e27b.tar.bz2
erlang.mk-9ca56c45850709473f60bf5de71008a747d4e27b.zip
fix removing deps.log at toplevel when in a multi-app layout
`rm deps.log` was not being executed, because of 1) the ifeq around it, checking for an empty ALL_DEPS_DIRS, which i believe was a logical error; and 2) deps depended on apps, which means apps were compiled before its recipe was executed, and the `rm deps.log` would be executed after it had been written to by recursive make of the apps. the important reason to remove deps.log is so that dependencies get remade when they change. otherwise you'll get mysterious errors about missing dependencies if they need to be rebuilt, or worse, have wrong stale beam files bundled in your release. tests core-deps-apps and core-deps-apps-only now manually clean the cowlib dep and rebuild at the top-level to make sure cowlib gets rebuilt. both tests indeed fail without this fix. this attempts to fix #1 by removing the ifeq, and #2 by having deps and apps depend on deps.log, with deps.log 'built' (but actually removed) by a double-colon rule with no prerequisites (which means its recipe always be run).
Diffstat (limited to 'core')
-rw-r--r--core/deps.mk18
1 files changed, 8 insertions, 10 deletions
diff --git a/core/deps.mk b/core/deps.mk
index 72b75b0..994d484 100644
--- a/core/deps.mk
+++ b/core/deps.mk
@@ -1,7 +1,7 @@
# Copyright (c) 2013-2016, Loïc Hoguin <[email protected]>
# This file is part of erlang.mk and subject to the terms of the ISC License.
-.PHONY: distclean-deps
+.PHONY: distclean-deps clean-tmp-deps.log
# Configuration.
@@ -51,7 +51,7 @@ dep_verbose = $(dep_verbose_$(V))
ifdef IS_APP
apps::
else
-apps:: $(ALL_APPS_DIRS)
+apps:: $(ALL_APPS_DIRS) clean-tmp-deps.log
ifeq ($(IS_APP)$(IS_DEP),)
$(verbose) rm -f $(ERLANG_MK_TMP)/apps.log
endif
@@ -72,16 +72,15 @@ endif
done
endif
-ifneq ($(SKIP_DEPS),)
-deps::
-else
-ifeq ($(ALL_DEPS_DIRS),)
-deps:: apps
-else
-deps:: $(ALL_DEPS_DIRS) apps
+clean-tmp-deps.log:
ifeq ($(IS_APP)$(IS_DEP),)
$(verbose) rm -f $(ERLANG_MK_TMP)/deps.log
endif
+
+ifneq ($(SKIP_DEPS),)
+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 \
if grep -qs ^$$dep$$ $(ERLANG_MK_TMP)/deps.log; then \
@@ -97,7 +96,6 @@ endif
fi \
done
endif
-endif
# Deps related targets.