]> git.lizzy.rs Git - rust.git/blob - mk/stage0.mk
normalize field types in copy implementations
[rust.git] / mk / stage0.mk
1 # Extract the snapshot host compiler
2
3 $(HBIN0_H_$(CFG_BUILD))/:
4         mkdir -p $@
5
6 # On windows these two are the same, so cause a redifinition warning
7 ifneq ($(HBIN0_H_$(CFG_BUILD)),$(HLIB0_H_$(CFG_BUILD)))
8 $(HLIB0_H_$(CFG_BUILD))/:
9         mkdir -p $@
10 endif
11
12 $(SNAPSHOT_RUSTC_POST_CLEANUP): \
13                 $(S)src/stage0.txt \
14                 $(S)src/etc/local_stage0.sh \
15                 $(S)src/etc/get-stage0.py $(MKFILE_DEPS) \
16                 | $(HBIN0_H_$(CFG_BUILD))/
17         @$(call E, fetch: $@)
18 ifdef CFG_ENABLE_LOCAL_RUST
19         $(Q)$(S)src/etc/local_stage0.sh $(CFG_BUILD) $(CFG_LOCAL_RUST_ROOT) rustlib
20 else
21         $(Q)$(CFG_PYTHON) $(S)src/etc/get-stage0.py $(CFG_BUILD)
22 endif
23         $(Q)if [ -e "$@" ]; then touch "$@"; else echo "ERROR: snapshot $@ not found"; exit 1; fi
24
25 # For other targets, let the host build the target:
26
27 define BOOTSTRAP_STAGE0
28   # $(1) target to bootstrap
29   # $(2) stage to bootstrap from
30   # $(3) target to bootstrap from
31
32 $(HBIN0_H_$(1))/:
33         mkdir -p $@
34
35 $(HLIB0_H_$(1))/:
36         mkdir -p $@
37
38 $$(HBIN0_H_$(1))/rustc$$(X_$(1)): \
39                 $$(TBIN$(2)_T_$(1)_H_$(3))/rustc$$(X_$(1)) \
40                 | $(HBIN0_H_$(1))/
41         @$$(call E, cp: $$@)
42         $$(Q)cp $$< $$@
43
44 endef
45
46 # Use stage1 to build other architectures: then you don't have to wait
47 # for stage2, but you get the latest updates to the compiler source.
48 $(foreach t,$(NON_BUILD_HOST), \
49  $(eval $(call BOOTSTRAP_STAGE0,$(t),1,$(CFG_BUILD))))