@@ -27,18 +27,28 @@ WFLAGS_ST2 = -D warnings
27
27
# $(2) is the target triple
28
28
# $(3) is the host triple
29
29
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.
30
38
31
39
define TARGET_STAGE_N
32
40
33
41
$$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) /libmorestack.a: \
34
42
rt/$(2 ) /stage$(1 ) /arch/$$(HOST_$(2 ) ) /libmorestack.a \
35
- | $$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) /
43
+ | $$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) / \
44
+ $(SNAPSHOT_RUSTC_POST_CLEANUP )
36
45
@$$(call E, cp: $$@ )
37
46
$$(Q ) cp $$< $$@
38
47
39
48
$$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) /$(CFG_RUNTIME_$(2 ) ) : \
40
49
rt/$(2 ) /stage$(1 ) /$(CFG_RUNTIME_$(2 ) ) \
41
- | $$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) /
50
+ | $$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) / \
51
+ $(SNAPSHOT_RUSTC_POST_CLEANUP )
42
52
@$$(call E, cp: $$@ )
43
53
$$(Q ) cp $$< $$@
44
54
@@ -77,7 +87,8 @@ ifneq ($$(findstring $(2),$$(CFG_HOST_TRIPLES)),)
77
87
78
88
$$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) /$(CFG_RUSTLLVM_$(3 ) ) : \
79
89
rustllvm/$(2 ) /$(CFG_RUSTLLVM_$(3 ) ) \
80
- | $$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) /
90
+ | $$(TLIB$(1 ) _T_$(2 ) _H_$(3 ) ) / \
91
+ $(SNAPSHOT_RUSTC_POST_CLEANUP )
81
92
@$$(call E, cp: $$@ )
82
93
$$(Q ) cp $$< $$@
83
94
0 commit comments