From 065c9ab59b41bb17efe979b1e06d1639950e082d Mon Sep 17 00:00:00 2001 From: Aidan Hobson Sayers Date: Sat, 13 Jun 2015 16:48:19 +0100 Subject: [PATCH 1/3] No need to double-silence --- mk/prepare.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/prepare.mk b/mk/prepare.mk index 2e8e309a7bb..e5f97543084 100644 --- a/mk/prepare.mk +++ b/mk/prepare.mk @@ -30,7 +30,7 @@ DEFAULT_PREPARE_MAN_CMD = install -m644 # Create a directory # $(1) is the directory define PREPARE_DIR - @$(Q)$(call E, prepare: $(1)) + @$(call E, prepare: $(1)) $(Q)$(PREPARE_DIR_CMD) $(1) endef From b1e9ed3c19b650671f52aa8b9c2ef60ea66a503b Mon Sep 17 00:00:00 2001 From: Aidan Hobson Sayers Date: Sat, 13 Jun 2015 16:49:25 +0100 Subject: [PATCH 2/3] nop hack required for PREPARE_DIR (PREPARE_MAN for safety) Fixes #26274 --- mk/prepare.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mk/prepare.mk b/mk/prepare.mk index e5f97543084..d196b71c3c8 100644 --- a/mk/prepare.mk +++ b/mk/prepare.mk @@ -29,7 +29,10 @@ DEFAULT_PREPARE_MAN_CMD = install -m644 # Create a directory # $(1) is the directory +# +# Gee, what's up with that $(nop)? See comment below. define PREPARE_DIR + $(nop) @$(call E, prepare: $(1)) $(Q)$(PREPARE_DIR_CMD) $(1) endef @@ -68,7 +71,10 @@ endef # Copy a man page # $(1) - source dir +# +# Gee, what's up with that $(nop)? See comment above. define PREPARE_MAN + $(nop) @$(call E, prepare: $(PREPARE_DEST_MAN_DIR)/$(1)) $(Q)$(PREPARE_MAN_CMD) $(PREPARE_SOURCE_MAN_DIR)/$(1) $(PREPARE_DEST_MAN_DIR)/$(1) endef From fca66702a44038b14d8f9bd282ad56c04e9fdcf6 Mon Sep 17 00:00:00 2001 From: Aidan Hobson Sayers Date: Sat, 13 Jun 2015 17:07:23 +0100 Subject: [PATCH 3/3] Replace nop hack, explain substitution reasoning --- mk/prepare.mk | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/mk/prepare.mk b/mk/prepare.mk index d196b71c3c8..fe619cc7cae 100644 --- a/mk/prepare.mk +++ b/mk/prepare.mk @@ -30,32 +30,33 @@ DEFAULT_PREPARE_MAN_CMD = install -m644 # Create a directory # $(1) is the directory # -# Gee, what's up with that $(nop)? See comment below. +# XXX: These defines are called to generate make steps. +# Adding blank lines means two steps from different defines will not end up on +# the same line. define PREPARE_DIR - $(nop) + @$(call E, prepare: $(1)) $(Q)$(PREPARE_DIR_CMD) $(1) + endef # Copy an executable # $(1) is the filename/libname-glob # -# Gee, what's up with that $(nop)? See comment below. +# See above for an explanation on the surrounding blank lines define PREPARE_BIN - $(nop) + @$(call E, prepare: $(PREPARE_DEST_BIN_DIR)/$(1)) $(Q)$(PREPARE_BIN_CMD) $(PREPARE_SOURCE_BIN_DIR)/$(1) $(PREPARE_DEST_BIN_DIR)/$(1) + endef # Copy a dylib or rlib # $(1) is the filename/libname-glob # -# XXX: Don't remove the $(nop) command below! -# Yeah, that's right, it's voodoo. Something in the way this macro is being expanded -# causes it to parse incorrectly. Throwing in that empty command seems to fix the -# problem. I'm sorry, just don't remove the $(nop), alright? +# See above for an explanation on the surrounding blank lines define PREPARE_LIB - $(nop) + @$(call E, prepare: $(PREPARE_WORKING_DEST_LIB_DIR)/$(1)) $(Q)LIB_NAME="$(notdir $(lastword $(wildcard $(PREPARE_WORKING_SOURCE_LIB_DIR)/$(1))))"; \ MATCHES="$(filter-out %$(notdir $(lastword $(wildcard $(PREPARE_WORKING_SOURCE_LIB_DIR)/$(1)))), \ @@ -67,16 +68,18 @@ define PREPARE_LIB echo $$MATCHES ; \ fi $(Q)$(PREPARE_LIB_CMD) `ls -drt1 $(PREPARE_WORKING_SOURCE_LIB_DIR)/$(1)` $(PREPARE_WORKING_DEST_LIB_DIR)/ + endef # Copy a man page # $(1) - source dir # -# Gee, what's up with that $(nop)? See comment above. +# See above for an explanation on the surrounding blank lines define PREPARE_MAN - $(nop) + @$(call E, prepare: $(PREPARE_DEST_MAN_DIR)/$(1)) $(Q)$(PREPARE_MAN_CMD) $(PREPARE_SOURCE_MAN_DIR)/$(1) $(PREPARE_DEST_MAN_DIR)/$(1) + endef PREPARE_TOOLS = $(filter-out compiletest rustbook error-index-generator, $(TOOLS))