CARGO ?= cargo
PYTHON ?= python3
MATURIN ?= maturin
RUST_FEATURES ?=
PYTHON_FEATURES ?= python
WHEEL_DIR ?= target/wheels
.PHONY: help build build-release fmt lint check test itest bench example-basic clean
help:
@echo "Targets:"
@echo " build - cargo build (debug)"
@echo " build-release - cargo build --release"
@echo " fmt - cargo fmt --all"
@echo " lint - cargo clippy --all-targets --all-features -D warnings"
@echo " check - cargo check --all-targets --features='$(RUST_FEATURES)'"
@echo " test - cargo test --features='$(RUST_FEATURES)'"
@echo " itest - cargo test --tests --features='$(RUST_FEATURES)'"
@echo " bench - cargo bench --features='$(RUST_FEATURES)'"
@echo " example-basic - cargo run --example basic"
@echo " clean - cargo clean && rm -rf $(WHEEL_DIR)"
build:
$(CARGO) build --features="$(RUST_FEATURES)"
build-release:
$(CARGO) build --release --features="$(RUST_FEATURES)"
fmt:
$(CARGO) fmt --all
lint:
$(CARGO) clippy --all-targets --all-features -D warnings
check:
$(CARGO) check --all-targets --features="$(RUST_FEATURES)"
test:
$(CARGO) test --features="$(RUST_FEATURES)"
itest:
$(CARGO) test --tests --features="$(RUST_FEATURES)"
bench:
$(CARGO) bench --features="$(RUST_FEATURES)"
example-basic:
$(CARGO) run --example basic
clean:
$(CARGO) clean
rm -rf $(WHEEL_DIR)