diff options
author | Loïc Hoguin <[email protected]> | 2015-06-16 08:07:03 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2015-06-16 08:07:03 +0200 |
commit | dd3f29a5bc896ea389c2b49c73ef5fa8b04074f6 (patch) | |
tree | 75047035d2cc2469f46bd8be62661491409c0268 | |
parent | 75fc887237628ea7a1c18219cb6e6736ae588ba4 (diff) | |
download | erlang.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.
-rw-r--r-- | core/deps.mk | 18 |
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 |