-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
50 lines (37 loc) · 1.55 KB
/
Makefile
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
49
50
CARGO := $(PWD)/cargo-minix
RUST_RELEASEDIR := rust/target/i586-unknown-minix/release
all: .cargo/config $(RUST_RELEASEDIR)/libtest.rlib
libc-test: .cargo/config $(RUST_RELEASEDIR)/libtest.rlib
cd libc/libc-test && ../../cargo-minix test --target i586-unknown-minix --no-run
clean:
rm -rf deps .cargo
cd libc && $(CARGO) clean
cd rust && $(CARGO) clean
update-submodules:
git submodule update --init rust libc
git -C rust submodule update --init src/stdsimd src/tools
.cargo/config: $(RUST_RELEASEDIR)/libstd.rlib
mkdir -p .cargo
echo "[target.i586-unknown-minix]" > $@
echo 'rustflags = ["-L$(PWD)/rust/target/i586-unknown-minix/release/deps"]' >> $@
$(RUST_RELEASEDIR)/libstd.rlib: FORCE deps/lib/libpthread.so deps/lib/libsemaphore.so i586-unknown-minix.json
cd rust/src/$(notdir $(@:.rlib=)) && \
env -u CARGO_TARGET_DIR \
RUSTFLAGS='-Z force-unstable-if-unmarked' \
$(CARGO) build --target i586-unknown-minix \
--features "panic-unwind backtrace" \
--release
$(RUST_RELEASEDIR)/%.rlib: FORCE $(RUST_RELEASEDIR)/libstd.rlib .cargo/config
cd rust/src/$(notdir $(@:.rlib=)) && \
env -u CARGO_TARGET_DIR \
$(CARGO) build --target i586-unknown-minix \
--release
deps/lib/libpthread.so: deps/pth-2.0.7nb4.tgz
tar xf $< -C deps include lib
deps/lib/libsemaphore.so: deps/pthread-sem-1.0nb2.tgz
tar xf $< -C deps include lib
deps/%.tgz:
mkdir -p deps
curl -o $@ https://minix3.org/pkgsrc/packages/3.4.0/i386/All/$(@:deps/%=%)
FORCE: ;
.PHONY: all clean update-submodules libc-test