From 983f82bdfcb3e78f04468fcfd02d6a6ee5869b13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 3 Dec 2018 19:22:12 +0100 Subject: 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. --- core/deps.mk | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'core/deps.mk') 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; \ -- cgit v1.2.3