-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
49 lines (41 loc) · 1.65 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
# Copyright (C) 2023 Nitrokey GmbH
# SPDX-License-Identifier: CC0-1.0
GENERATED_FILES := src/se05x/commands.rs README.md
src/se05x/commands.rs: src/se05x/commands.toml generate_commands.py
python generate_commands.py src/se05x/commands.toml src/se05x/commands.rs
rustfmt --edition 2021 src/se05x/commands.rs
.PHONY: verify-commands
verify-commands:
mkdir -p target
python generate_commands.py src/se05x/commands.toml target/commands_diff.rs
rustfmt --edition 2021 target/commands_diff.rs
diff target/commands_diff.rs src/se05x/commands.rs
.PHONY: check
check: src/se05x/commands.rs
cargo c
cargo c --features builder
cargo c --features nrf,nrf-hal-common/52840 --target thumbv7em-none-eabihf
cargo c --features lpc55-v0.3 --target thumbv8m.main-none-eabi
cargo c --features lpc55-v0.4 --target thumbv8m.main-none-eabi
.PHONY: lint
lint: src/se05x/commands.rs verify-commands
reuse lint
cargo c
cargo fmt --check
cargo clippy
cargo clippy --features nrf,nrf-hal-common/52840 --target thumbv7em-none-eabihf
cargo clippy --features lpc55-v0.3 --target thumbv8m.main-none-eabi
cargo clippy --features lpc55-v0.4 --target thumbv8m.main-none-eabi
cargo doc --features aes-session,builder,serde --no-deps
README.md: src/lib.rs Makefile
# REUSE-IgnoreStart
echo '<!-- Copyright (C) 2023 Nitrokey GmbH -->' > README.md
echo '<!-- SPDX-License-Identifier: LGPL-3.0-only -->' >> README.md
# REUSE-IgnoreEnd
grep '//!' src/lib.rs |grep -v '//! # ' | sed 's/^...//g' | sed 's/^ //g' >> README.md
.PHONY: ci
ci: export RUSTFLAGS=-Dwarnings
ci: export RUSTDOCFLAGS=-Dwarnings
ci: check lint
$(MAKE) --always-make $(GENERATED_FILES)
git diff --exit-code -- $(GENERATED_FILES)