From a11c6fb7f9ee084fe87bdcba32529358d9fab64e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 10 Dec 2018 13:52:59 +0100 Subject: Optimization: reduce the number of shell commands on noops --- core/erlc.mk | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'core/erlc.mk') diff --git a/core/erlc.mk b/core/erlc.mk index 872d3f5..9195ece 100644 --- a/core/erlc.mk +++ b/core/erlc.mk @@ -53,15 +53,9 @@ ifneq ($(wildcard src/),) # Targets. -ifeq ($(wildcard ebin/test),) -app:: deps +app:: $(if $(wildcard ebin/test),clean) deps $(verbose) $(MAKE) --no-print-directory $(PROJECT).d $(verbose) $(MAKE) --no-print-directory app-build -else -app:: clean deps - $(verbose) $(MAKE) --no-print-directory $(PROJECT).d - $(verbose) $(MAKE) --no-print-directory app-build -endif ifeq ($(wildcard src/$(PROJECT_MOD).erl),) define app_file @@ -277,8 +271,7 @@ endif ifneq ($(words $(ERL_FILES) $(CORE_FILES) $(ASN1_FILES) $(MIB_FILES) $(XRL_FILES) $(YRL_FILES)),0) # Rebuild everything when the Makefile changes. -$(ERLANG_MK_TMP)/last-makefile-change: $(MAKEFILE_LIST) - $(verbose) mkdir -p $(ERLANG_MK_TMP) +$(ERLANG_MK_TMP)/last-makefile-change: $(MAKEFILE_LIST) | $(ERLANG_MK_TMP) $(verbose) if test -f $@; then \ touch $(ERL_FILES) $(CORE_FILES) $(ASN1_FILES) $(MIB_FILES) $(XRL_FILES) $(YRL_FILES); \ touch -c $(PROJECT).d; \ @@ -289,6 +282,9 @@ $(ERL_FILES) $(CORE_FILES) $(ASN1_FILES) $(MIB_FILES) $(XRL_FILES) $(YRL_FILES): ebin/$(PROJECT).app:: $(ERLANG_MK_TMP)/last-makefile-change endif +$(PROJECT).d:: + $(verbose) : + include $(wildcard $(PROJECT).d) ebin/$(PROJECT).app:: ebin/ -- cgit v1.2.3