-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile.toml
84 lines (68 loc) · 1.83 KB
/
Makefile.toml
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
[env]
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
CARGO_MAKE_WORKSPACE_EMULATION = true
CARGO_MAKE_CRATE_WORKSPACE_MEMBERS = ["dsp", "control", "benches", "firmware"]
[tasks.default]
alias = "dev"
[tasks.dev]
workspace = false
dependencies = ["format-black", "format-toml"]
run_task = { name = "dev-workspace", fork = true }
[tasks.dev-workspace]
dependencies = ["format", "clippy", "build", "test"]
[tasks.ci]
workspace = false
dependencies = ["print-env-flow", "check-black", "check-toml"]
run_task = { name = "ci-workspace", fork = true }
[tasks.ci-workspace]
dependencies = ["check-format", "clippy", "build", "test"]
[tasks.test]
condition = { files_not_exist = [".cargo/"] }
[tasks.check-toml]
env = { CARGO_MAKE_FORMAT_TOML_ARGS = "--check" }
run_task = { name = "format-toml" }
[tasks.clippy]
env = { CARGO_MAKE_CLIPPY_ARGS = "--tests --benches -- -Dclippy::all -Dwarnings" }
[tasks.format-black]
condition_script = ["python3 -m black --help >/dev/null"]
condition = { fail_message = "Python black is not available" }
script = "python3 -m black hack/"
[tasks.check-black]
script = "python3 -m black hack/"
[tasks.manual]
workspace = false
script = "make -C manual/user && make -C manual/build"
[tasks.flash]
workspace = false
script = '''
cd firmware
cargo run --release --bin firmware --features idle-measuring
'''
[tasks.flash-dfu]
workspace = false
script = '''
cd firmware
cargo objcopy --release -- -O binary target/kaseta.bin
dfu-util -a 0 -s 0x08000000:leave -D target/kaseta.bin -d ,0483:df11
'''
[tasks.bench]
clear = true
workspace = false
script = '''
cd benches
cargo run --release --bin ${1}
'''
[tasks.test-embedded]
clear = true
workspace = false
script = '''
cd firmware
DEFMT_LOG=info cargo test --test ${1}
'''
[tasks.bloat]
workspace = false
script = '''
cd firmware
cargo size --bin firmware --release -- -m
cargo bloat --release
'''