Skip to content

Commit a245f96

Browse files
committed
---
yaml --- r: 108925 b: refs/heads/dist-snap c: 111137b h: refs/heads/master i: 108923: 426b5f2 v: v3
1 parent ce3a085 commit a245f96

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: c8bc65f19ffdf31d0a322c3d6a57472689337889
9+
refs/heads/dist-snap: 111137b5f5d6ed1a633edd319244e69457609f25
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/mk/prepare.mk

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ prepare-host-tools: \
106106
$(foreach host,$(CFG_HOST),\
107107
prepare-host-tool-$(tool)-$(stage)-$(host))))
108108

109-
prepare-host-dirs:
109+
prepare-host-dirs: prepare-maybe-clean
110110
$(call PREPARE_DIR,$(PREPARE_DEST_BIN_DIR))
111111
$(call PREPARE_DIR,$(PREPARE_DEST_LIB_DIR))
112112
$(call PREPARE_DIR,$(PREPARE_DEST_MAN_DIR))
@@ -115,7 +115,8 @@ prepare-host-dirs:
115115
# $(2) is stage
116116
# $(3) is host
117117
define DEF_PREPARE_HOST_TOOL
118-
prepare-host-tool-$(1)-$(2)-$(3): $$(foreach dep,$$(TOOL_DEPS_$(1)),prepare-host-lib-$$(dep)-$(2)-$(3)) \
118+
prepare-host-tool-$(1)-$(2)-$(3): prepare-maybe-clean \
119+
$$(foreach dep,$$(TOOL_DEPS_$(1)),prepare-host-lib-$$(dep)-$(2)-$(3)) \
119120
$$(HBIN$(2)_H_$(3))/$(1)$$(X_$(3)) \
120121
prepare-host-dirs
121122
$$(if $$(findstring $(2), $$(PREPARE_STAGE)),\
@@ -140,7 +141,8 @@ $(foreach tool,$(PREPARE_TOOLS),\
140141
define DEF_PREPARE_HOST_LIB
141142
prepare-host-lib-$(1)-$(2)-$(3): PREPARE_WORKING_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_LIB_DIR)
142143
prepare-host-lib-$(1)-$(2)-$(3): PREPARE_WORKING_DEST_LIB_DIR=$$(PREPARE_DEST_LIB_DIR)
143-
prepare-host-lib-$(1)-$(2)-$(3): $$(foreach dep,$$(RUST_DEPS_$(1)),prepare-host-lib-$$(dep)-$(2)-$(3))\
144+
prepare-host-lib-$(1)-$(2)-$(3): prepare-maybe-clean \
145+
$$(foreach dep,$$(RUST_DEPS_$(1)),prepare-host-lib-$$(dep)-$(2)-$(3))\
144146
$$(HLIB$(2)_H_$(3))/stamp.$(1) \
145147
prepare-host-dirs
146148
$$(if $$(findstring $(2), $$(PREPARE_STAGE)),\
@@ -166,7 +168,7 @@ define DEF_PREPARE_TARGET_N
166168
# Rebind PREPARE_*_LIB_DIR to point to rustlib, then install the libs for the targets
167169
prepare-target-$(2)-host-$(3)-$(1): PREPARE_WORKING_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_LIB_DIR)/$$(CFG_RUSTLIBDIR)/$(2)/lib
168170
prepare-target-$(2)-host-$(3)-$(1): PREPARE_WORKING_DEST_LIB_DIR=$$(PREPARE_DEST_LIB_DIR)/$$(CFG_RUSTLIBDIR)/$(2)/lib
169-
prepare-target-$(2)-host-$(3)-$(1): \
171+
prepare-target-$(2)-host-$(3)-$(1): prepare-maybe-clean \
170172
$$(foreach crate,$$(TARGET_CRATES), \
171173
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \
172174
$$(if $$(findstring $(2),$$(CFG_HOST)), \
@@ -194,3 +196,9 @@ $(foreach host,$(CFG_HOST),\
194196
$(foreach target,$(CFG_TARGET), \
195197
$(foreach stage,$(PREPARE_STAGES),\
196198
$(eval $(call DEF_PREPARE_TARGET_N,$(stage),$(target),$(host))))))
199+
200+
prepare-maybe-clean:
201+
$(if $(findstring true,$(PREPARE_CLEAN)),\
202+
@$(call E, cleaning destination $@),)
203+
$(if $(findstring true,$(PREPARE_CLEAN)),\
204+
$(Q)rm -r $(PREPARE_DEST_DIR),)

0 commit comments

Comments
 (0)