From 5401192f38ff407a749fccfdb8f2f9aab012efea Mon Sep 17 00:00:00 2001 From: Krister Svanlund Date: Mon, 11 Jul 2016 16:45:26 +0200 Subject: Build apps/* only once MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replicating the behavior for deps/*. With refactoring from Loïc. --- core/deps.mk | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'core/deps.mk') diff --git a/core/deps.mk b/core/deps.mk index 2527c03..ac8eaaa 100644 --- a/core/deps.mk +++ b/core/deps.mk @@ -48,19 +48,35 @@ dep_verbose = $(dep_verbose_$(V)) # Core targets. -ifneq ($(SKIP_DEPS),) -deps:: +ifdef IS_APP +apps:: else -deps:: $(ALL_DEPS_DIRS) -ifndef IS_APP +apps:: $(ALL_APPS_DIRS) +ifeq ($(IS_APP)$(IS_DEP),) + $(verbose) rm -f $(ERLANG_MK_TMP)/apps.log +endif + $(verbose) mkdir -p $(ERLANG_MK_TMP) +# Create ebin directory for all apps to make sure Erlang recognizes them +# 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. $(verbose) for dep in $(ALL_APPS_DIRS) ; do \ - mkdir -p $$dep/ebin; \ + mkdir -p $$dep/ebin || exit $$?; \ done $(verbose) for dep in $(ALL_APPS_DIRS) ; do \ - $(MAKE) -C $$dep IS_APP=1 || exit $$?; \ + 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 $$?; \ + fi \ done endif -ifneq ($(IS_DEP),1) + +ifneq ($(SKIP_DEPS),) +deps:: +else +deps:: $(ALL_DEPS_DIRS) apps +ifeq ($(IS_APP)$(IS_DEP),) $(verbose) rm -f $(ERLANG_MK_TMP)/deps.log endif $(verbose) mkdir -p $(ERLANG_MK_TMP) -- cgit v1.2.3