blob: 71c124a3fb14e606e4a068dca0934a92a8de8005 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# Makefile that builds libstd using the mrustc-built rustc
RUSTC := ../output/rustc
RUST_SRC := ../rustc-nightly/src/
PREFIX := prefix/
BINDIR := $(PREFIX)bin/
LIBDIR := $(PREFIX)lib/
V ?= @
all: $(LIBDIR)libstd.rlib $(BINDIR)hello_world
RUSTFLAGS_output/liblibc.rlib := --cfg stdbuild
$(RUSTC):
make -C ../ output/rustc -j 3
$(BINDIR)rustc: $(RUSTC)
@mkdir -p $(dir $@)
$Vcp $@ $<
$(LIBDIR)%.rlib: $(RUST_SRC)%/lib.rs $(RUSTC)
@mkdir -p $(dir $@)
@echo "[RUSTC] -o $@"
$Vtime $(RUSTC) $(RUSTFLAGS_$@) -L output/ -L ../output/libs $< -o $@
$(LIBDIR)%.rlib: $(RUST_SRC)%/src/lib.rs $(RUSTC)
@mkdir -p $(dir $@)
@echo "[RUSTC] -o $@"
$Vtime $(RUSTC) $(RUSTFLAGS_$@) -L output/ -L ../output/libs $< -o $@
$(BINDIR)hello_world: $(RUST_SRC)test/run-pass/hello.rs $(LIBDIR)libstd.rlib $(RUSTC)
$Vmkdir -p $(dir $@)
@echo "[RUSTC] -o $@"
$Vtime $(RUSTC) $(RUSTFLAGS_$@) -L output/ -L ../output/libs $< -o $@
fcn_extcrate = $(patsubst %,$(LIBDIR)lib%.rlib,$(1))
$(LIBDIR)libarena.rlib: $(call fcn_extcrate, std)
$(LIBDIR)liballoc.rlib: $(call fcn_extcrate, core)
$(LIBDIR)libstd_unicode.rlib: $(call fcn_extcrate, core)
$(LIBDIR)libcollections.rlib: $(call fcn_extcrate, core alloc std_unicode)
$(LIBDIR)librand.rlib: $(call fcn_extcrate, core)
$(LIBDIR)liblibc.rlib: $(call fcn_extcrate, core)
$(LIBDIR)libcompiler_builtins.rlib: $(call fcn_extcrate, core)
$(LIBDIR)libstd.rlib: $(call fcn_extcrate, core collections rand libc unwind compiler_builtins alloc_system panic_unwind)
$(LIBDIR)libunwind.rlib: $(call fcn_extcrate, core libc)
|