From dd3f29a5bc896ea389c2b49c73ef5fa8b04074f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 16 Jun 2015 08:07:03 +0200 Subject: Compile dependencies only once We keep track of which dependencies we compiled in the current session in the $(ERLANG_MK_TMP)/deps.log file. This will help save a little time when projects depend more than once on the same dependency. While going in the directory and running make was already quick, it's quicker if not, and the logs end up cleaner. --- core/deps.mk | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'core/deps.mk') diff --git a/core/deps.mk b/core/deps.mk index 9a5fa9a..181b2b7 100644 --- a/core/deps.mk +++ b/core/deps.mk @@ -40,13 +40,21 @@ ifneq ($(SKIP_DEPS),) deps:: else deps:: $(ALL_DEPS_DIRS) +ifneq ($(IS_DEP),1) + @rm -f $(ERLANG_MK_TMP)/deps.log +endif @for dep in $(ALL_DEPS_DIRS) ; do \ - if [ -f $$dep/GNUmakefile ] || [ -f $$dep/makefile ] || [ -f $$dep/Makefile ] ; then \ - $(MAKE) -C $$dep IS_DEP=1 || exit $$? ; \ + if grep -q ^$$dep$$$$ $(ERLANG_MK_TMP)/deps.log; then \ + echo -n; \ else \ - echo "ERROR: No Makefile to build dependency $$dep." ; \ - exit 1 ; \ - fi ; \ + 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 $$?; \ + else \ + echo "ERROR: No Makefile to build dependency $$dep."; \ + exit 1; \ + fi \ + fi \ done endif -- cgit v1.2.3