-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
87 lines (75 loc) · 2.96 KB
/
Makefile
File metadata and controls
87 lines (75 loc) · 2.96 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
# Command to run in `dev` target, e.g. `make RUN=check dev`.
RUN ?= test
# NOTE: when using this command you might want to change the `test` target to
# only run a subset of the tests you're actively working on.
dev:
find src/ tests/ examples/ Makefile Cargo.toml | entr -d -c $(MAKE) $(RUN)
test:
cargo test -- --quiet
cargo test --all-features -- --quiet
test_sanitizers:
$(MAKE) test_sanitizer sanitizer=address
$(MAKE) test_sanitizer sanitizer=thread
$(MAKE) test_sanitizer sanitizer=memory
$(MAKE) test_sanitizer sanitizer=leak
# Run with `make test_sanitizer sanitizer=$sanitizer`, or use `test_sanitizers`.
test_sanitizer:
RUSTDOCFLAGS=-Zsanitizer=$(sanitizer) RUSTFLAGS=-Zsanitizer=$(sanitizer) \
ASAN_OPTIONS=poison_history_size=1000 \
TSAN_OPTIONS='suppressions=tsan_suppressions.txt' \
cargo test -Zbuild-std --target x86_64-unknown-linux-gnu --features nightly
check:
cargo check --all-targets
TARGETS ?= \
x86_64-unknown-linux-gnu x86_64-unknown-linux-musl aarch64-linux-android \
x86_64-unknown-dragonfly x86_64-unknown-freebsd x86_64-unknown-netbsd x86_64-unknown-openbsd \
aarch64-apple-darwin aarch64-apple-ios aarch64-apple-tvos aarch64-apple-visionos aarch64-apple-watchos \
check_all_targets: $(TARGETS)
$(TARGETS):
cargo check --target $@ -Zbuild-std --all-targets
# Disabled lints:
# * `doc-markdown`: has some annoying false positives.
# * `elidable-lifetime-names`: lifetimes serve as documentation.
# * `equatable-if-let`: strongly disagree with this lint.
# * `missing-const-for-fn`: has false positives.
# * `missing-errors-doc`, `missing-panics-doc`: not worth it.
# * `must-use-candidate`: too many bad suggestions.
# * `needless-lifetimes`: lifetimes are additional docs.
# * `option-if-let-else`: don't want to introduce more closures.
# * `redundant-pub-crate`: useless lint.
# * `single-match-else`: prefer match statements over if statements.
# * `use-self`: strongly disagree.
# TODO: resolve the lints after the empty line.
lint: clippy
clippy:
cargo clippy --all-features --workspace -- \
--deny clippy::all \
--deny clippy::correctness \
--deny clippy::style \
--deny clippy::complexity \
--deny clippy::perf \
--deny clippy::pedantic \
--deny clippy::nursery \
--deny clippy::cargo \
--allow clippy::doc-markdown \
--allow clippy::elidable-lifetime-names \
--allow clippy::equatable-if-let \
--allow clippy::missing-const-for-fn \
--allow clippy::missing-errors-doc \
--allow clippy::missing-panics-doc \
--allow clippy::must-use-candidate \
--allow clippy::needless-lifetimes \
--allow clippy::new-without-default \
--allow clippy::option-if-let-else \
--allow clippy::redundant-pub-crate \
--allow clippy::single-match-else \
--allow clippy::use-self \
\
--allow clippy::cast-possible-truncation \
doc:
cargo doc --all-features
doc_private:
cargo doc --document-private-items
clean:
cargo clean
.PHONY: dev test test_sanitizers test_sanitizer check check_all_targets $(TARGETS) lint clippy doc doc_private clean