forked from patractlabs/europa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (43 loc) · 1.57 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
54
55
56
57
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 --all --all-targets -- \
-A clippy::module_inception -A clippy::needless_pass_by_value \
-A clippy::cyclomatic_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::new_without_default_derive \
-A clippy::neg_cmp_op_on_partial_ord -A clippy::too_many_arguments \
-A clippy::excessive_precision -A clippy::collapsible_if \
-A clippy::blacklisted_name
build:
cargo build #--features "${ENABLE_FEATURES}"
release:
@cargo build --release #--features "${ENABLE_FEATURES}"
test:
export LOG_LEVEL=DEBUG && \
export RUST_BACKTRACE=1 && \
cargo test #--features "${ENABLE_FEATURES}" --all -- --nocapture
bench:
LOG_LEVEL=ERROR RUST_BACKTRACE=1 cargo bench #--features "${ENABLE_FEATURES}" --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 +nightly fmt --all -- --check >/dev/null || \
cargo +nightly fmt --all
clean:
@cargo clean
upgrade:
@echo "Upgrading substrate under native..."
cargo update -p srml-system
@echo
@echo "Upgrading substrate under wasm..."
cd runtime/wasm && cargo update -p srml-system