aboutsummaryrefslogtreecommitdiffstats
path: root/core/deps.mk
diff options
context:
space:
mode:
authorKrister Svanlund <[email protected]>2016-07-11 16:45:26 +0200
committerLoïc Hoguin <[email protected]>2016-07-14 16:06:38 +0200
commit5401192f38ff407a749fccfdb8f2f9aab012efea (patch)
tree68b278f202850204951d657e78b5b976fe60440c /core/deps.mk
parentb48618d362d24248035e87a0bc1a3a22ad5a3dd9 (diff)
downloaderlang.mk-5401192f38ff407a749fccfdb8f2f9aab012efea.tar.gz
erlang.mk-5401192f38ff407a749fccfdb8f2f9aab012efea.tar.bz2
erlang.mk-5401192f38ff407a749fccfdb8f2f9aab012efea.zip
Build apps/* only once
Replicating the behavior for deps/*. With refactoring from Loïc.
Diffstat (limited to 'core/deps.mk')
-rw-r--r--core/deps.mk30
1 files changed, 23 insertions, 7 deletions
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)