diff options
author | Loïc Hoguin <[email protected]> | 2018-12-10 13:52:59 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-12-10 13:52:59 +0100 |
commit | a11c6fb7f9ee084fe87bdcba32529358d9fab64e (patch) | |
tree | 80c309fc48978fe3293a01e49dd7a7bda958ee0f /plugins/protobuffs.mk | |
parent | 7799804277e6fd38d308ebd581d194c38cd3fbb4 (diff) | |
download | erlang.mk-a11c6fb7f9ee084fe87bdcba32529358d9fab64e.tar.gz erlang.mk-a11c6fb7f9ee084fe87bdcba32529358d9fab64e.tar.bz2 erlang.mk-a11c6fb7f9ee084fe87bdcba32529358d9fab64e.zip |
Optimization: reduce the number of shell commands on noops
Diffstat (limited to 'plugins/protobuffs.mk')
-rw-r--r-- | plugins/protobuffs.mk | 7 |
1 files changed, 4 insertions, 3 deletions
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 |