Skip to content

Commit e83e299

Browse files
committed
---
yaml --- r: 106704 b: refs/heads/try c: 111137b h: refs/heads/master v: v3
1 parent bccbbbf commit e83e299

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
@@ -2,7 +2,7 @@
22
refs/heads/master: b8ef9fd9c9f642ce7b8aed82782a1ed745d08d64
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b8601a3d8b91ad3b653d143307611f2f5c75617e
5-
refs/heads/try: c8bc65f19ffdf31d0a322c3d6a57472689337889
5+
refs/heads/try: 111137b5f5d6ed1a633edd319244e69457609f25
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/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)