]> git.proxmox.com Git - rustc.git/blob - mk/stage0.mk
Imported Upstream version 0.6
[rustc.git] / mk / stage0.mk
1 # Extract the snapshot host compiler
2
3
4
5 $(HBIN0_H_$(CFG_BUILD_TRIPLE))/rustc$(X_$(CFG_BUILD_TRIPLE)): \
6 $(S)src/snapshots.txt \
7 $(S)src/etc/get-snapshot.py $(MKFILE_DEPS)
8 @$(call E, fetch: $@)
9 # Note: the variable "SNAPSHOT_FILE" is generally not set, and so
10 # we generally only pass one argument to this script.
11 ifdef CFG_ENABLE_LOCAL_RUST
12 $(Q)$(S)src/etc/local_stage0.sh $(CFG_BUILD_TRIPLE) $(CFG_LOCAL_RUST_ROOT)
13 else
14 $(Q)$(CFG_PYTHON) $(S)src/etc/get-snapshot.py $(CFG_BUILD_TRIPLE) $(SNAPSHOT_FILE)
15 ifdef CFG_ENABLE_PAX_FLAGS
16 @$(call E, apply PaX flags: $@)
17 @"$(CFG_PAXCTL)" -cm "$@"
18 endif
19 endif
20 $(Q)touch $@
21
22 # Host libs will be extracted by the above rule
23
24 $(HLIB0_H_$(CFG_BUILD_TRIPLE))/$(CFG_RUNTIME_$(CFG_BUILD_TRIPLE)): \
25 $(HBIN0_H_$(CFG_BUILD_TRIPLE))/rustc$(X_$(CFG_BUILD_TRIPLE))
26 $(Q)touch $@
27
28 $(HLIB0_H_$(CFG_BUILD_TRIPLE))/$(CFG_CORELIB_$(CFG_BUILD_TRIPLE)): \
29 $(HBIN0_H_$(CFG_BUILD_TRIPLE))/rustc$(X_$(CFG_BUILD_TRIPLE))
30 $(Q)touch $@
31
32 $(HLIB0_H_$(CFG_BUILD_TRIPLE))/$(CFG_STDLIB_$(CFG_BUILD_TRIPLE)): \
33 $(HBIN0_H_$(CFG_BUILD_TRIPLE))/rustc$(X_$(CFG_BUILD_TRIPLE))
34 $(Q)touch $@
35
36 $(HLIB0_H_$(CFG_BUILD_TRIPLE))/$(CFG_LIBRUSTC_$(CFG_BUILD_TRIPLE)): \
37 $(HBIN0_H_$(CFG_BUILD_TRIPLE))/rustc$(X_$(CFG_BUILD_TRIPLE))
38 $(Q)touch $@
39
40 $(HLIB0_H_$(CFG_BUILD_TRIPLE))/$(CFG_RUSTLLVM_$(CFG_BUILD_TRIPLE)): \
41 $(HBIN0_H_$(CFG_BUILD_TRIPLE))/rustc$(X_$(CFG_BUILD_TRIPLE))
42 $(Q)touch $@
43
44 # For other targets, let the host build the target:
45
46 define BOOTSTRAP_STAGE0
47 # $(1) target to bootstrap
48 # $(2) stage to bootstrap from
49 # $(3) target to bootstrap from
50
51 $$(HBIN0_H_$(1))/rustc$$(X_$(1)): \
52 $$(TBIN$(2)_T_$(1)_H_$(3))/rustc$$(X_$(1))
53 @$$(call E, cp: $$@)
54 $$(Q)cp $$< $$@
55
56 $$(HLIB0_H_$(1))/$(CFG_RUNTIME_$(1)): \
57 $$(TLIB$(2)_T_$(1)_H_$(3))/$(CFG_RUNTIME_$(1))
58 @$$(call E, cp: $$@)
59 $$(Q)cp $$< $$@
60
61 $$(HLIB0_H_$(1))/$(CFG_CORELIB_$(1)): \
62 $$(TLIB$(2)_T_$(1)_H_$(3))/$(CFG_CORELIB_$(1))
63 @$$(call E, cp: $$@)
64 $$(Q)cp $$(TLIB$(2)_T_$(1)_H_$(3))/$(CORELIB_GLOB_$(1)) $$@
65
66 $$(HLIB0_H_$(1))/$(CFG_STDLIB_$(1)): \
67 $$(TLIB$(2)_T_$(1)_H_$(3))/$(CFG_STDLIB_$(1))
68 @$$(call E, cp: $$@)
69 $$(Q)cp $$(TLIB$(2)_T_$(1)_H_$(3))/$(STDLIB_GLOB_$(1)) $$@
70
71 $$(HLIB0_H_$(1))/$(CFG_LIBRUSTC_$(1)): \
72 $$(TLIB$(2)_T_$(1)_H_$(3))/$(CFG_LIBRUSTC_$(1))
73 @$$(call E, cp: $$@)
74 $$(Q)cp $$(TLIB$(2)_T_$(1)_H_$(3))/$(LIBRUSTC_GLOB_$(1)) $$@
75
76 $$(HLIB0_H_$(1))/$(CFG_RUSTLLVM_$(1)): \
77 $$(TLIB$(2)_T_$(1)_H_$(3))/$(CFG_RUSTLLVM_$(1))
78 @$$(call E, cp: $$@)
79 $$(Q)cp $$< $$@
80
81 endef
82
83 # Use stage1 to build other architectures: then you don't have to wait
84 # for stage2, but you get the latest updates to the compiler source.
85 $(foreach t,$(NON_BUILD_HOST_TRIPLES), \
86 $(eval $(call BOOTSTRAP_STAGE0,$(t),1,$(CFG_BUILD_TRIPLE))))