diff options
author | Loïc Hoguin <[email protected]> | 2018-12-03 19:22:12 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-12-03 19:22:12 +0100 |
commit | 983f82bdfcb3e78f04468fcfd02d6a6ee5869b13 (patch) | |
tree | c2dc607d4fac2e5d0e42e57dd5b88837e82543ff /core | |
parent | 225fb9046e8bf05c647cbcfdd2a074901700236a (diff) | |
download | erlang.mk-983f82bdfcb3e78f04468fcfd02d6a6ee5869b13.tar.gz erlang.mk-983f82bdfcb3e78f04468fcfd02d6a6ee5869b13.tar.bz2 erlang.mk-983f82bdfcb3e78f04468fcfd02d6a6ee5869b13.zip |
Don't rebuild dependencies by default
Unless it's a symbolic link, it's built directly, FULL=1 is set
or the file ebin/dep_built in the dependency is removed.
See the documentation changes for more details.
This provides immense build speed gains, for example on a
RabbitMQ project it went from 10s to 1s for the 2nd+ builds.
Diffstat (limited to 'core')
-rw-r--r-- | core/deps.mk | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/deps.mk b/core/deps.mk index b55e31c..ab509c3 100644 --- a/core/deps.mk +++ b/core/deps.mk @@ -75,6 +75,12 @@ dep_verbose_0 = @echo " DEP $1 ($(call dep_commit,$1))"; dep_verbose_2 = set -x; dep_verbose = $(dep_verbose_$(V)) +# Optimization: don't recompile deps unless truly necessary. + +ifndef IS_DEP +$(shell rm -f ebin/dep_built) +endif + # Core targets. apps:: $(ALL_APPS_DIRS) clean-tmp-deps.log @@ -117,8 +123,11 @@ deps:: $(ALL_DEPS_DIRS) apps clean-tmp-deps.log :; \ else \ echo $$dep >> $(ERLANG_MK_TMP)/deps.log; \ - if [ -f $$dep/GNUmakefile ] || [ -f $$dep/makefile ] || [ -f $$dep/Makefile ]; then \ + if [ -z "$(strip $(FULL))" ] && [ ! -L $$dep ] && [ -f $$dep/ebin/dep_built ]; then \ + :; \ + elif [ -f $$dep/GNUmakefile ] || [ -f $$dep/makefile ] || [ -f $$dep/Makefile ]; then \ $(MAKE) -C $$dep IS_DEP=1; \ + if [ ! -L $$dep ] && [ -d $$dep/ebin ]; then touch $$dep/ebin/dep_built; fi; \ else \ echo "Error: No Makefile to build dependency $$dep." >&2; \ exit 2; \ |