arnaucube
arnaucube/miden-cryptoPublic Self-hosted repository
miden-crypto/Makefile
MakefileRaw
 1.DEFAULT_GOAL := help
 2
 3.PHONY: help
 4help:
 5	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
 6
 7# -- variables --------------------------------------------------------------------------------------
 8
 9WARNINGS=RUSTDOCFLAGS="-D warnings"
10DEBUG_OVERFLOW_INFO=RUSTFLAGS="-C debug-assertions -C overflow-checks -C debuginfo=2"
11
12# -- linting --------------------------------------------------------------------------------------
13
14.PHONY: clippy
15clippy: ## Run Clippy with configs
16	$(WARNINGS) cargo +nightly clippy --workspace --all-targets --all-features
17
18
19.PHONY: fix
20fix: ## Run Fix with configs
21	cargo +nightly fix --allow-staged --allow-dirty --all-targets --all-features
22
23
24.PHONY: format
25format: ## Run Format using nightly toolchain
26	cargo +nightly fmt --all
27
28
29.PHONY: format-check
30format-check: ## Run Format using nightly toolchain but only in check mode
31	cargo +nightly fmt --all --check
32
33
34.PHONY: lint
35lint: format fix clippy ## Run all linting tasks at once (Clippy, fixing, formatting)
36
37# --- docs ----------------------------------------------------------------------------------------
38
39.PHONY: doc
40doc: ## Generate and check documentation
41	$(WARNINGS) cargo doc --all-features --keep-going --release
42
43# --- testing -------------------------------------------------------------------------------------
44
45.PHONY: test-default
46test-default: ## Run tests with default features
47	$(DEBUG_OVERFLOW_INFO) cargo nextest run --profile default --release --all-features
48
49
50.PHONY: test-no-std
51test-no-std: ## Run tests with `no-default-features` (std)
52	$(DEBUG_OVERFLOW_INFO) cargo nextest run --profile default --release --no-default-features
53
54
55.PHONY: test
56test: test-default test-no-std ## Run all tests
57
58# --- checking ------------------------------------------------------------------------------------
59
60.PHONY: check
61check: ## Check all targets and features for errors without code generation
62	cargo check --all-targets --all-features
63
64# --- building ------------------------------------------------------------------------------------
65
66.PHONY: build
67build: ## Build with default features enabled
68	cargo build --release
69
70.PHONY: build-no-std
71build-no-std: ## Build without the standard library
72	cargo build --release --no-default-features --target wasm32-unknown-unknown
73
74.PHONY: build-avx2
75build-avx2: ## Build with avx2 support
76	RUSTFLAGS="-C target-feature=+avx2" cargo build --release
77
78.PHONY: build-sve
79build-sve: ## Build with sve support
80	RUSTFLAGS="-C target-feature=+sve" cargo build --release
81
82# --- benchmarking --------------------------------------------------------------------------------
83
84.PHONY: bench
85bench: ## Run crypto benchmarks
86	cargo bench --features="concurrent"
87
88.PHONY: bench-smt-concurrent
89bench-smt-concurrent: ## Run SMT benchmarks with concurrent feature
90	cargo run --release --features concurrent,executable -- --size 1000000