CARGO ?= cargo
RUSTUP ?= rustup
EXAMPLES := wallet_basics keystore transfer contract_dynamic contract_typed subscribe_logs
.PHONY: help ci fmt fmt-fix clippy build test test-no-fail-fast doc examples \
run-wallet run-keystore clean toolchain
help:
@awk 'BEGIN {FS = ":.*?## "} \
/^[a-zA-Z0-9_-]+:.*?##/ { \
printf " \033[36m%-22s\033[0m %s\n", $$1, $$2 \
}' $(MAKEFILE_LIST)
ci: fmt clippy build test doc examples
@echo "✔ ci passed"
fmt:
$(CARGO) fmt --all -- --check
fmt-fix:
$(CARGO) fmt --all
clippy:
$(CARGO) clippy --workspace --all-targets -- -D warnings
build:
$(CARGO) build --workspace --all-targets
test:
$(CARGO) test --workspace
test-no-fail-fast:
$(CARGO) test --workspace --no-fail-fast
doc:
RUSTDOCFLAGS="-D warnings" $(CARGO) doc --workspace --no-deps
examples:
$(CARGO) build --workspace --examples
run-wallet:
$(CARGO) run --example wallet_basics
run-keystore:
$(CARGO) run --example keystore
toolchain:
$(RUSTUP) show
clean:
$(CARGO) clean