Skip to content

Commit fca6670

Browse files
committed
Replace nop hack, explain substitution reasoning
1 parent b1e9ed3 commit fca6670

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

mk/prepare.mk

+14-11
Original file line numberDiff line numberDiff line change
@@ -30,32 +30,33 @@ DEFAULT_PREPARE_MAN_CMD = install -m644
3030
# Create a directory
3131
# $(1) is the directory
3232
#
33-
# Gee, what's up with that $(nop)? See comment below.
33+
# XXX: These defines are called to generate make steps.
34+
# Adding blank lines means two steps from different defines will not end up on
35+
# the same line.
3436
define PREPARE_DIR
35-
$(nop)
37+
3638
@$(call E, prepare: $(1))
3739
$(Q)$(PREPARE_DIR_CMD) $(1)
40+
3841
endef
3942

4043
# Copy an executable
4144
# $(1) is the filename/libname-glob
4245
#
43-
# Gee, what's up with that $(nop)? See comment below.
46+
# See above for an explanation on the surrounding blank lines
4447
define PREPARE_BIN
45-
$(nop)
48+
4649
@$(call E, prepare: $(PREPARE_DEST_BIN_DIR)/$(1))
4750
$(Q)$(PREPARE_BIN_CMD) $(PREPARE_SOURCE_BIN_DIR)/$(1) $(PREPARE_DEST_BIN_DIR)/$(1)
51+
4852
endef
4953

5054
# Copy a dylib or rlib
5155
# $(1) is the filename/libname-glob
5256
#
53-
# XXX: Don't remove the $(nop) command below!
54-
# Yeah, that's right, it's voodoo. Something in the way this macro is being expanded
55-
# causes it to parse incorrectly. Throwing in that empty command seems to fix the
56-
# problem. I'm sorry, just don't remove the $(nop), alright?
57+
# See above for an explanation on the surrounding blank lines
5758
define PREPARE_LIB
58-
$(nop)
59+
5960
@$(call E, prepare: $(PREPARE_WORKING_DEST_LIB_DIR)/$(1))
6061
$(Q)LIB_NAME="$(notdir $(lastword $(wildcard $(PREPARE_WORKING_SOURCE_LIB_DIR)/$(1))))"; \
6162
MATCHES="$(filter-out %$(notdir $(lastword $(wildcard $(PREPARE_WORKING_SOURCE_LIB_DIR)/$(1)))), \
@@ -67,16 +68,18 @@ define PREPARE_LIB
6768
echo $$MATCHES ; \
6869
fi
6970
$(Q)$(PREPARE_LIB_CMD) `ls -drt1 $(PREPARE_WORKING_SOURCE_LIB_DIR)/$(1)` $(PREPARE_WORKING_DEST_LIB_DIR)/
71+
7072
endef
7173

7274
# Copy a man page
7375
# $(1) - source dir
7476
#
75-
# Gee, what's up with that $(nop)? See comment above.
77+
# See above for an explanation on the surrounding blank lines
7678
define PREPARE_MAN
77-
$(nop)
79+
7880
@$(call E, prepare: $(PREPARE_DEST_MAN_DIR)/$(1))
7981
$(Q)$(PREPARE_MAN_CMD) $(PREPARE_SOURCE_MAN_DIR)/$(1) $(PREPARE_DEST_MAN_DIR)/$(1)
82+
8083
endef
8184

8285
PREPARE_TOOLS = $(filter-out compiletest rustbook error-index-generator, $(TOOLS))

0 commit comments

Comments
 (0)