PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/mk/stage0.mk

http://github.com/jruderman/rust
Makefile | 82 lines | 53 code | 19 blank | 10 comment | 1 complexity | f054d24379e1a6469fde6f8699689442 MD5 | raw file
 1# Extract the snapshot host compiler
 2
 3
 4
 5$(HBIN0_H_$(CFG_HOST_TRIPLE))/rustc$(X):		\
 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.  
11ifdef CFG_ENABLE_LOCAL_RUST
12	$(Q)$(S)src/etc/local_stage0.sh $(CFG_HOST_TRIPLE) $(CFG_LOCAL_RUST_ROOT)
13else 
14	$(Q)$(S)src/etc/get-snapshot.py $(CFG_HOST_TRIPLE) $(SNAPSHOT_FILE)
15endif 
16	$(Q)touch $@
17
18# Host libs will be extracted by the above rule
19
20$(HLIB0_H_$(CFG_HOST_TRIPLE))/$(CFG_RUNTIME): \
21		$(HBIN0_H_$(CFG_HOST_TRIPLE))/rustc$(X)
22	$(Q)touch $@
23
24$(HLIB0_H_$(CFG_HOST_TRIPLE))/$(CFG_CORELIB): \
25		$(HBIN0_H_$(CFG_HOST_TRIPLE))/rustc$(X)
26	$(Q)touch $@
27
28$(HLIB0_H_$(CFG_HOST_TRIPLE))/$(CFG_STDLIB): \
29		$(HBIN0_H_$(CFG_HOST_TRIPLE))/rustc$(X)
30	$(Q)touch $@
31
32$(HLIB0_H_$(CFG_HOST_TRIPLE))/$(CFG_LIBRUSTC): \
33		$(HBIN0_H_$(CFG_HOST_TRIPLE))/rustc$(X)
34	$(Q)touch $@
35
36$(HLIB0_H_$(CFG_HOST_TRIPLE))/$(CFG_RUSTLLVM): \
37		$(HBIN0_H_$(CFG_HOST_TRIPLE))/rustc$(X)
38	$(Q)touch $@
39
40# For other targets, let the host build the target:
41
42define BOOTSTRAP_STAGE0
43  # $(1) target to bootstrap
44  # $(2) stage to bootstrap from
45  # $(3) target to bootstrap from
46
47$$(HBIN0_H_$(1))/rustc$$(X):								\
48		$$(TBIN$(2)_T_$(1)_H_$(3))/rustc$$(X)
49	@$$(call E, cp: $$@)
50	$$(Q)cp $$< $$@
51
52$$(HLIB0_H_$(1))/$$(CFG_RUNTIME): \
53		$$(TLIB$(2)_T_$(1)_H_$(3))/$$(CFG_RUNTIME)
54	@$$(call E, cp: $$@)
55	$$(Q)cp $$< $$@
56
57$$(HLIB0_H_$(1))/$(CFG_CORELIB): \
58		$$(TLIB$(2)_T_$(1)_H_$(3))/$$(CFG_CORELIB)
59	@$$(call E, cp: $$@)
60	$$(Q)cp $$(TLIB$(2)_T_$(1)_H_$(3))/$$(CORELIB_GLOB) $$@
61
62$$(HLIB0_H_$(1))/$(CFG_STDLIB): \
63		$$(TLIB$(2)_T_$(1)_H_$(3))/$$(CFG_STDLIB)
64	@$$(call E, cp: $$@)
65	$$(Q)cp $$(TLIB$(2)_T_$(1)_H_$(3))/$$(STDLIB_GLOB) $$@
66
67$$(HLIB0_H_$(1))/$(CFG_LIBRUSTC): \
68		$$(TLIB$(2)_T_$(1)_H_$(3))/$$(CFG_LIBRUSTC)
69	@$$(call E, cp: $$@)
70	$$(Q)cp $$(TLIB$(2)_T_$(1)_H_$(3))/$$(LIBRUSTC_GLOB) $$@
71
72$$(HLIB0_H_$(1))/$(CFG_RUSTLLVM): \
73		$$(TLIB$(2)_T_$(1)_H_$(3))/$$(CFG_RUSTLLVM)
74	@$$(call E, cp: $$@)
75	$$(Q)cp $$< $$@
76
77endef
78
79# Use stage1 to build other architectures: then you don't have to wait
80# for stage2, but you get the latest updates to the compiler source.
81$(foreach t,$(NON_HOST_TRIPLES),								\
82 $(eval $(call BOOTSTRAP_STAGE0,$(t),1,$(CFG_HOST_TRIPLE))))