aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJeffrey Griffin <[email protected]>2017-02-17 11:16:57 -0800
committerLoïc Hoguin <[email protected]>2017-04-25 15:13:48 +0200
commit750bdd359b0db9fc665d9a371b65ec7bb5d037c7 (patch)
tree34701e095c0231285db46b7e062ae9bbf8e372d8 /core
parent9ca56c45850709473f60bf5de71008a747d4e27b (diff)
downloaderlang.mk-750bdd359b0db9fc665d9a371b65ec7bb5d037c7.tar.gz
erlang.mk-750bdd359b0db9fc665d9a371b65ec7bb5d037c7.tar.bz2
erlang.mk-750bdd359b0db9fc665d9a371b65ec7bb5d037c7.zip
compile apps in the right order by looking at their LOCAL_DEPS
we also use LOCAL_DEPS at the top-level, if it exists, to determine which local apps to compile, in the interest of saving compile time for projects that have many apps and multiple release configurations
Diffstat (limited to 'core')
-rw-r--r--core/deps.mk12
1 files changed, 7 insertions, 5 deletions
diff --git a/core/deps.mk b/core/deps.mk
index 994d484..43632ed 100644
--- a/core/deps.mk
+++ b/core/deps.mk
@@ -26,6 +26,7 @@ dep_repo = $(patsubst git://github.com/%,https://github.com/%, \
$(if $(dep_$(1)),$(word 2,$(dep_$(1))),$(pkg_$(1)_repo)))
dep_commit = $(if $(dep_$(1)_commit),$(dep_$(1)_commit),$(if $(dep_$(1)),$(word 3,$(dep_$(1))),$(pkg_$(1)_commit)))
+LOCAL_DEPS_DIRS = $(foreach a,$(LOCAL_DEPS),$(if $(wildcard $(APPS_DIR)/$(a)),$(APPS_DIR)/$(a)))
ALL_APPS_DIRS = $(if $(wildcard $(APPS_DIR)/),$(filter-out $(APPS_DIR),$(shell find $(APPS_DIR) -maxdepth 1 -type d)))
ALL_DEPS_DIRS = $(addprefix $(DEPS_DIR)/,$(foreach dep,$(filter-out $(IGNORE_DEPS),$(BUILD_DEPS) $(DEPS)),$(call dep_name,$(dep))))
@@ -48,9 +49,6 @@ dep_verbose = $(dep_verbose_$(V))
# Core targets.
-ifdef IS_APP
-apps::
-else
apps:: $(ALL_APPS_DIRS) clean-tmp-deps.log
ifeq ($(IS_APP)$(IS_DEP),)
$(verbose) rm -f $(ERLANG_MK_TMP)/apps.log
@@ -59,10 +57,15 @@ endif
# 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.
+ifndef IS_APP
$(verbose) for dep in $(ALL_APPS_DIRS) ; do \
mkdir -p $$dep/ebin || exit $$?; \
done
- $(verbose) for dep in $(ALL_APPS_DIRS) ; do \
+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 \
if grep -qs ^$$dep$$ $(ERLANG_MK_TMP)/apps.log; then \
:; \
else \
@@ -70,7 +73,6 @@ endif
$(MAKE) -C $$dep IS_APP=1 || exit $$?; \
fi \
done
-endif
clean-tmp-deps.log:
ifeq ($(IS_APP)$(IS_DEP),)