@@ -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
3139define 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