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 --- plugins/erlydtl.mk | 3 +-- plugins/protobuffs.mk | 7 ++++--- plugins/relx.mk | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'plugins') diff --git a/plugins/erlydtl.mk b/plugins/erlydtl.mk index 3a8b705..466b634 100644 --- a/plugins/erlydtl.mk +++ b/plugins/erlydtl.mk @@ -27,8 +27,7 @@ BEAM_FILES += $(addsuffix .beam,$(addprefix ebin/,$(DTL_MODULES))) ifneq ($(words $(DTL_FILES)),0) # Rebuild templates when the Makefile changes. -$(ERLANG_MK_TMP)/last-makefile-change-erlydtl: $(MAKEFILE_LIST) - $(verbose) mkdir -p $(ERLANG_MK_TMP) +$(ERLANG_MK_TMP)/last-makefile-change-erlydtl: $(MAKEFILE_LIST) | $(ERLANG_MK_TMP) $(verbose) if test -f $@; then \ touch $(DTL_FILES); \ fi diff --git a/plugins/protobuffs.mk b/plugins/protobuffs.mk index 2719c01..b4f9ce6 100644 --- a/plugins/protobuffs.mk +++ b/plugins/protobuffs.mk @@ -12,14 +12,13 @@ ifneq ($(wildcard src/),) PROTO_FILES := $(filter %.proto,$(ALL_SRC_FILES)) ERL_FILES += $(addprefix src/,$(patsubst %.proto,%_pb.erl,$(notdir $(PROTO_FILES)))) -ifeq ($(words $(PROTO_FILES)),0) +ifeq ($(PROTO_FILES),) $(ERLANG_MK_TMP)/last-makefile-change-protobuffs: $(verbose) : else # Rebuild proto files when the Makefile changes. # We exclude $(PROJECT).d to avoid a circular dependency. -$(ERLANG_MK_TMP)/last-makefile-change-protobuffs: $(filter-out $(PROJECT).d,$(MAKEFILE_LIST)) - $(verbose) mkdir -p $(ERLANG_MK_TMP) +$(ERLANG_MK_TMP)/last-makefile-change-protobuffs: $(filter-out $(PROJECT).d,$(MAKEFILE_LIST)) | $(ERLANG_MK_TMP) $(verbose) if test -f $@; then \ touch $(PROTO_FILES); \ fi @@ -50,7 +49,9 @@ define compile_proto.erl endef endif +ifneq ($(PROTO_FILES),) $(PROJECT).d:: $(PROTO_FILES) $(verbose) mkdir -p ebin/ include/ $(if $(strip $?),$(proto_verbose) $(call erlang,$(call compile_proto.erl,$?))) endif +endif diff --git a/plugins/relx.mk b/plugins/relx.mk index de08184..4e29031 100644 --- a/plugins/relx.mk +++ b/plugins/relx.mk @@ -38,8 +38,7 @@ distclean:: distclean-relx-rel # Plugin-specific targets. -$(RELX): - $(verbose) mkdir -p $(ERLANG_MK_TMP) +$(RELX): | $(ERLANG_MK_TMP) $(gen_verbose) $(call core_http_get,$(RELX),$(RELX_URL)) $(verbose) chmod +x $(RELX) -- cgit v1.2.3