-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (37 loc) · 1015 Bytes
/
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
50
.PHONY: all clean lint fmt release doc build run test test-panic test-st macros
# non-versioned include
VARS ?= vars.mk
-include $(VARS)
override CARGO_BUILD_ARGS += --features "$(FEATURES)" --color=always
all: build
build: fmt
cargo build $(CARGO_BUILD_ARGS)
fmt:
cargo fmt
release: override CARGO_BUILD_ARGS += --release
release: build
doc:
cargo doc $(CARGO_BUILD_ARGS)
test: fmt
cargo test $(TEST) $(CARGO_BUILD_ARGS) -- --nocapture
test-release: override CARGO_BUILD_ARGS += --release
test-release: test
test-panic: override FEATURES += panic-on-error
test-panic: fmt
RUST_BACKTRACE=1 \
cargo test \
$(TEST) \
$(CARGO_BUILD_ARGS) -- \
--nocapture
test-st: fmt
cargo test $(TEST) $(CARGO_BUILD_ARGS) -- --nocapture --test-threads 1
lint:
cargo clippy $(CARGO_BUILD_ARGS) -- \
-A clippy::comparison_chain \
-A clippy::module_inception \
-A clippy::redundant_closure \
-A clippy::redundant_pattern_matching \
-A clippy::search_is_some
clean:
rm -rf target/
cargo clean