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/protobuffs.mk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'plugins/protobuffs.mk') 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 -- cgit v1.2.3