Skip to content

Commit b1a2251

Browse files
committed
small cleanup of previous commit with mucho comments.
1 parent f61713a commit b1a2251

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

mk/stage0.mk

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ $(HBIN0_H_$(CFG_BUILD_TRIPLE))/:
66
$(HLIB0_H_$(CFG_BUILD_TRIPLE))/:
77
mkdir -p $@
88

9-
$(HBIN0_H_$(CFG_BUILD_TRIPLE))/rustc$(X_$(CFG_BUILD_TRIPLE)): \
9+
SNAPSHOT_RUSTC_POST_CLEANUP=$(HBIN0_H_$(CFG_BUILD_TRIPLE))/rustc$(X_$(CFG_BUILD_TRIPLE))
10+
11+
$(SNAPSHOT_RUSTC_POST_CLEANUP): \
1012
$(S)src/snapshots.txt \
1113
$(S)src/etc/get-snapshot.py $(MKFILE_DEPS) \
1214
| $(HBIN0_H_$(CFG_BUILD_TRIPLE))/

mk/target.mk

+11-3
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,28 @@ WFLAGS_ST2 = -D warnings
2727
# $(2) is the target triple
2828
# $(3) is the host triple
2929

30+
# Every recipe in TARGET_STAGE_N outputs to $$(TLIB$(1)_T_$(2)_H_$(3),
31+
# a directory that can be cleaned out during the middle of a run of
32+
# the get-snapshot.py script. Therefore, every recipe needs to have
33+
# an order-only dependency either on $(SNAPSHOT_RUSTC_POST_CLEANUP) or
34+
# on $$(TSREQ$(1)_T_$(2)_H_$(3)), to ensure that no products will be
35+
# put into the target area until after the get-snapshot.py script has
36+
# had its chance to clean it out; otherwise the other products will be
37+
# inadvertantly included in the clean out.
3038

3139
define TARGET_STAGE_N
3240

3341
$$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a: \
3442
rt/$(2)/stage$(1)/arch/$$(HOST_$(2))/libmorestack.a \
3543
| $$(TLIB$(1)_T_$(2)_H_$(3))/ \
36-
$(HBIN0_H_$(CFG_BUILD_TRIPLE))/rustc$(X_$(CFG_BUILD_TRIPLE))
44+
$(SNAPSHOT_RUSTC_POST_CLEANUP)
3745
@$$(call E, cp: $$@)
3846
$$(Q)cp $$< $$@
3947

4048
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUNTIME_$(2)): \
4149
rt/$(2)/stage$(1)/$(CFG_RUNTIME_$(2)) \
4250
| $$(TLIB$(1)_T_$(2)_H_$(3))/ \
43-
$(HBIN0_H_$(CFG_BUILD_TRIPLE))/rustc$(X_$(CFG_BUILD_TRIPLE))
51+
$(SNAPSHOT_RUSTC_POST_CLEANUP)
4452
@$$(call E, cp: $$@)
4553
$$(Q)cp $$< $$@
4654

@@ -80,7 +88,7 @@ ifneq ($$(findstring $(2),$$(CFG_HOST_TRIPLES)),)
8088
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUSTLLVM_$(3)): \
8189
rustllvm/$(2)/$(CFG_RUSTLLVM_$(3)) \
8290
| $$(TLIB$(1)_T_$(2)_H_$(3))/ \
83-
$(HBIN0_H_$(CFG_BUILD_TRIPLE))/rustc$(X_$(CFG_BUILD_TRIPLE))
91+
$(SNAPSHOT_RUSTC_POST_CLEANUP)
8492
@$$(call E, cp: $$@)
8593
$$(Q)cp $$< $$@
8694

0 commit comments

Comments
 (0)