Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
148 lines (113 loc) · 5.39 KB
/
Copy pathjustfile
File metadata and controls
148 lines (113 loc) · 5.39 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# Justfile for the Ferrous Systems Rust Training
#
# Copyright (c) Ferrous Systems, 2025
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
default:
@just --choose
everything: build-book build-slides test-book build-rust format-check-rust
format-check: format-check-rust
format: format-rust
build: build-book build-slides build-rust ferrocene-rust
clean: clean-rust
rm -rf ./training-slides/book
rm -rf ./training-slides/slides
serve: build-book build-slides
cd training-slides && python3 -m http.server
build-book: make-plugins
cd training-slides && RUST_LOG=info mdbook build
test-book: make-plugins
cd training-slides && RUST_LOG=info mdbook test
make-plugins:
mdbook-striplineno supports || cargo install --path ./mdbook-striplineno
build-slides: build-book
cd training-slides && RUST_LOG=debug mdslides --template ./template.html --output-dir ./slides --mdbook-path . --index-template ./index-template.html
cp -r ./training-slides/book/images ./training-slides/slides
assemble version: build-book build-slides clean-rust
echo "Making ./rust-training-{{ version }}..."
rm -rf ./rust-training-{{ version }}
mkdir -p ./rust-training-{{ version }}
mv ./training-slides/slides ./rust-training-{{ version }}/training-slides-presentation
mv ./training-slides/book ./rust-training-{{ version }}/training-slides-book
cp -r ./example-code ./rust-training-{{ version }}
echo "Compressing ./rust-training-{{ version }}.zip..."
zip -r ./rust-training-{{ version }}.zip ./rust-training-{{ version }}
make-cheatsheet LANG:
cargo xtask make-cheatsheet {{LANG}}
test-cheatsheet LANG:
cargo xtask test-cheatsheet {{LANG}}
test-all-cheatsheets:
cargo xtask test-all-cheatsheets
# This is a script because we want to check everything, rather than stop on first failure
format-check-rust:
#!/bin/sh
FAIL=0
cargo fmt --check --manifest-path example-code/native/ffi/use-c-in-rust/Cargo.toml || FAIL=1
cargo fmt --check --manifest-path example-code/native/ffi/use-rust-in-c/Cargo.toml || FAIL=1
cargo fmt --check --manifest-path example-code/native/stdout/Cargo.toml || FAIL=1
cargo fmt --check --manifest-path example-code/nrf52/bsp_demo/Cargo.toml || FAIL=1
cargo fmt --check --manifest-path example-code/qemu-aarch32v8r/Cargo.toml || FAIL=1
cargo fmt --check --manifest-path example-code/qemu-aarch64v8a/Cargo.toml || FAIL=1
cargo fmt --check --manifest-path example-code/qemu-thumbv7em/Cargo.toml || FAIL=1
cargo fmt --check --manifest-path xtask/Cargo.toml || FAIL=1
if [[ "$FAIL" == 1 ]]; then exit 1; else echo "Formatting all OK"; fi
format-rust:
cargo fmt --manifest-path example-code/native/ffi/use-c-in-rust/Cargo.toml
cargo fmt --manifest-path example-code/native/ffi/use-rust-in-c/Cargo.toml
cargo fmt --manifest-path example-code/native/stdout/Cargo.toml
cargo fmt --manifest-path example-code/nrf52/bsp_demo/Cargo.toml
cargo fmt --manifest-path example-code/qemu-aarch32v8r/Cargo.toml
cargo fmt --manifest-path example-code/qemu-aarch64v8a/Cargo.toml
cargo fmt --manifest-path example-code/qemu-thumbv7em/Cargo.toml
cargo fmt --manifest-path xtask/Cargo.toml
build-rust: build-native-ffi-use-c-in-rust build-native-ffi-use-rust-in-c build-native-stdout build-native-lifetimes build-nrf52-bsp-demo build-qemu-aarch32v8r build-qemu-aarch64v8a build-qemu-thumbv7em build-qemu-riscv64 build-xtask
build-native-ffi-use-c-in-rust:
cd example-code/native/ffi/use-c-in-rust && cargo build --release
build-native-ffi-use-rust-in-c:
cd example-code/native/ffi/use-rust-in-c && cargo build --release
build-native-stdout:
cd example-code/native/stdout && RUSTC_BOOTSTRAP=1 cargo build --release
build-native-lifetimes:
cd example-code/native/lifetimes && cargo build --release && cargo run --release
build-nrf52-bsp-demo:
cd example-code/nrf52/bsp_demo && cargo build --release
build-qemu-aarch32v8r:
cd example-code/qemu-aarch32v8r && cargo build --release
build-qemu-aarch64v8a:
cd example-code/qemu-aarch64v8a && cargo build --release
build-qemu-thumbv7em:
cd example-code/qemu-thumbv7em && cargo build --release
build-qemu-riscv64:
cd example-code/qemu-riscv64 && cargo build --release
build-xtask:
cd xtask && cargo build
[windows]
[working-directory: "example-code/native/ffi/use-rust-in-c/windows-example"]
msbuild:
msbuild.exe windows-example.sln /p:Configuration=Release
.\x64\Release\windows-example.exe
ferrocene-rust: ferrocene-qemu-aarch64v8a ferrocene-qemu-aarch32v8r ferrocene-qemu-thumbv7em
ferrocene-qemu-aarch64v8a:
#!/bin/sh
cd example-code/qemu-aarch64v8a
criticalup install
criticalup run cargo build --release
ferrocene-qemu-aarch32v8r:
#!/bin/sh
cd example-code/qemu-aarch32v8r
criticalup install
criticalup run cargo build --release
ferrocene-qemu-thumbv7em:
#!/bin/sh
cd example-code/qemu-thumbv7em
criticalup install
criticalup run cargo build --release
clean-rust:
cargo clean --manifest-path example-code/native/ffi/use-c-in-rust/Cargo.toml
cargo clean --manifest-path example-code/native/ffi/use-rust-in-c/Cargo.toml
cargo clean --manifest-path example-code/native/stdout/Cargo.toml
cargo clean --manifest-path example-code/nrf52/bsp_demo/Cargo.toml
cargo clean --manifest-path example-code/qemu-aarch32v8r/Cargo.toml
cargo clean --manifest-path example-code/qemu-aarch64v8a/Cargo.toml
cargo clean --manifest-path example-code/qemu-thumbv7em/Cargo.toml
cargo clean --manifest-path example-code/qemu-riscv64/Cargo.toml
cargo clean --manifest-path example-code/qemu-common/Cargo.toml