-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
53 lines (39 loc) · 1.37 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
50
51
52
53
SHELL := /bin/bash
#ENABLE_FEATURES ?= default
default: release
.PHONY: all
all: format build test
pre-clippy: unset-override
@rustup component add clippy-preview
clippy: pre-clippy
@cargo clippy --release --all --all-targets -- \
-A clippy::module_inception -A clippy::needless_pass_by_value \
-A clippy::cognitive_complexity -A clippy::unreadable_literal \
-A clippy::should_implement_trait -A clippy::verbose_bit_mask \
-A clippy::implicit_hasher -A clippy::large_enum_variant \
-A clippy::new_without_default -A clippy::disallowed_names \
-A clippy::neg_cmp_op_on_partial_ord -A clippy::too_many_arguments \
-A clippy::excessive_precision -A clippy::collapsible_if \
-D warnings
build:
cargo build --release #--features "${ENABLE_FEATURES}"
release:
@cargo build --release #--features "${ENABLE_FEATURES}"
benchmarks:
@cargo build --release --features="runtime-benchmarks"
try-runtime:
@cargo build --release --features="try-runtime"
test:
export LOG_LEVEL=DEBUG && \
export RUST_BACKTRACE=1 && \
cargo test --release --all -- --nocapture
unset-override:
@# unset first in case of any previous overrides
@if rustup override list | grep `pwd` > /dev/null; then rustup override unset; fi
pre-format: unset-override
@rustup component add rustfmt-preview
format: pre-format
@cargo fmt --all -- --check >/dev/null || \
cargo fmt --all
clean:
@cargo clean