Просмотр исходного кода

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.
Loïc Hoguin 10 лет назад
Родитель
Сommit
dd3f29a5bc
1 измененных файлов с 13 добавлено и 5 удалено
  1. 13 5
      core/deps.mk

+ 13 - 5
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