-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
54 lines (38 loc) · 2.04 KB
/
justfile
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
51
52
53
54
build: build-cargo patch-symbols
patch-symbols:
riscv64-linux-gnu-nm --demangle --numeric-sort --line-numbers target/riscv64gc-unknown-none-elf/release/kernel | grep -e ' t ' -e ' T ' > symbols && printf '\0' >> symbols
riscv64-linux-gnu-objcopy --update-section symbols=./symbols target/riscv64gc-unknown-none-elf/release/kernel
build-cargo:
cargo build --release
clippy:
cd userspace && cargo clippy -- -D warnings
cargo clippy -- -D warnings
cargo clippy --manifest-path system-tests/Cargo.toml --target x86_64-unknown-linux-gnu --no-deps -- -D warnings
clean:
rm -f kernel/compiled_userspace/*
rm -f kernel/src/autogenerated/userspace_programs.rs
rm -rf target-userspace
cargo clean
debugReleaseCommand := "cargo run --release -- --wait"
run: build
cargo run --release
test: unit-test system-test
unit-test:
cargo test --release
system-test: build
cargo nextest run --release --manifest-path system-tests/Cargo.toml --target x86_64-unknown-linux-gnu
miri: build-cargo
MIRIFLAGS="-Zmiri-env-forward=RUST_BACKTRACE -Zmiri-strict-provenance" RUST_BACKTRACE=1 cargo miri test --target riscv64gc-unknown-linux-gnu
fetch-deps:
cargo fetch
cargo fetch --manifest-path ./system-tests/Cargo.toml
attach:
gdb-multiarch $(pwd)/target/riscv64gc-unknown-none-elf/release/kernel -ex "target remote :1234"
debug: build
tmux new-session -d '{{debugReleaseCommand}}' \; split-window -v 'gdb-multiarch $(pwd)/target/riscv64gc-unknown-none-elf/release/kernel -ex "target remote :1234"' \; attach
debugf FUNC: build
tmux new-session -d '{{debugReleaseCommand}}' \; split-window -v 'gdb-multiarch $(pwd)/target/riscv64gc-unknown-none-elf/release/kernel -ex "target remote :1234" -ex "hbreak {{FUNC}}" -ex "c"'\; attach
disassm: build
riscv64-linux-gnu-objdump -d --demangle --disassembler-color=on visualize-jumps=extended-color target/riscv64gc-unknown-none-elf/release/kernel | less
addr2line ADDR:
riscv64-linux-gnu-addr2line -f -p -i -C -e target/riscv64gc-unknown-none-elf/release/kernel {{ADDR}}