forked from sigp/ethereum_hashing
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
49 lines (37 loc) · 1.33 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
# Heavily inspired by Reth: https://github.com/paradigmxyz/reth/blob/4c39b98b621c53524c6533a9c7b52fc42c25abd6/Makefile
.DEFAULT_GOAL := help
# Cargo features for builds.
FEATURES ?=
# Cargo profile for builds.
PROFILE ?= release
# Extra flags for Cargo.
CARGO_INSTALL_EXTRA_FLAGS ?=
CARGO_TARGET_DIR ?= target
##@ Help
.PHONY: help
help: # Display this help.
@awk 'BEGIN {FS = ":.*#"; printf "Usage:\n make \033[34m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?#/ { printf " \033[34m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) }' $(MAKEFILE_LIST)
##@ Build
.PHONY: build
build: # Build the Ream binary into `target` directory.
cargo build --release
.PHONY: test
test: # Run all tests.
cargo test --workspace -- --nocapture
cargo test --no-default-features --features=poseidon2,zero_hash_cache
##@ Others
.PHONY: clean
clean: # Run `cargo clean`.
cargo clean
.PHONY: lint
lint: # Run `clippy` and `rustfmt`.
cargo +nightly fmt --all
cargo clippy --all --all-targets --features "$(FEATURES)" --no-deps -- --deny warnings
# clippy for bls with supranational feature
cargo clippy --all-targets --no-deps -- --deny warnings
cargo clippy --all-targets --no-default-features --features=poseidon2,zero_hash_cache --no-deps -- --deny warnings
# cargo sort
cargo sort --grouped
pr:
make lint && \
make test