aboutsummaryrefslogtreecommitdiffstats
path: root/core/deps.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-06-16 08:07:03 +0200
committerLoïc Hoguin <[email protected]>2015-06-16 08:07:03 +0200
commitdd3f29a5bc896ea389c2b49c73ef5fa8b04074f6 (patch)
tree75047035d2cc2469f46bd8be62661491409c0268 /core/deps.mk
parent75fc887237628ea7a1c18219cb6e6736ae588ba4 (diff)
downloaderlang.mk-dd3f29a5bc896ea389c2b49c73ef5fa8b04074f6.tar.gz
erlang.mk-dd3f29a5bc896ea389c2b49c73ef5fa8b04074f6.tar.bz2
erlang.mk-dd3f29a5bc896ea389c2b49c73ef5fa8b04074f6.zip
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.
Diffstat (limited to 'core/deps.mk')
-rw-r--r--core/deps.mk18
1 files changed, 13 insertions, 5 deletions
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