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 | |
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')
-rw-r--r-- | plugins/erlydtl.mk | 3 | ||||
-rw-r--r-- | plugins/protobuffs.mk | 7 | ||||
-rw-r--r-- | plugins/relx.mk | 3 |
3 files changed, 6 insertions, 7 deletions
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) |