.PHONY: help check fmt fmt-check clippy test build build-release clean all ci
.PHONY: wasm-build wasm-pack-publish wasm-serve
help:
@echo "Available targets:"
@echo " make check - Run all checks (format + clippy + test)"
@echo " make fmt - Format code with rustfmt"
@echo " make fmt-check - Check code formatting without modifying"
@echo " make clippy - Run clippy linter with strict warnings"
@echo " make test - Run all tests"
@echo " make build - Build in debug mode"
@echo " make build-release- Build in release mode"
@echo " make clean - Clean build artifacts"
@echo " make ci - Run all CI checks (same as GitHub Actions)"
@echo " make all - Format, build, and test"
ci: fmt-check clippy test
@echo "โ
All CI checks passed!"
check: fmt clippy test
@echo "โ
All checks passed!"
fmt:
@echo "๐ง Formatting code..."
@cargo fmt
fmt-check:
@echo "๐ Checking code formatting..."
@cargo fmt -- --check
clippy:
@echo "๐ Running clippy..."
@cargo clippy --all-targets --all-features -- -D warnings
test:
@echo "๐งช Running tests..."
@cargo test --all-features
build:
@echo "๐จ Building (debug mode)..."
@cargo build --all-features
build-release:
@echo "๐จ Building (release mode)..."
@cargo build --release --all-features
clean:
@echo "๐งน Cleaning build artifacts..."
@cargo clean
all: fmt build test
@echo "โ
Build and test completed!"
bench:
@echo "๐ Running benchmarks..."
@cargo bench
examples:
@echo "๐จ Building all examples..."
@cargo build --examples --all-features
example-%:
@echo "๐จ Building example: $*..."
@cargo build --example $*
run-example-%:
@echo "๐ Running example: $*..."
@cargo run --example $*
verbose:
@echo "๐ Running with verbose output..."
@cargo build --verbose --all-features
@cargo test --verbose --all-features
doc:
@echo "๐ Building documentation..."
@cargo doc --all-features --no-deps
doc-open:
@echo "๐ Opening documentation..."
@cargo doc --all-features --no-deps --open
wasm-build:
@echo "๐จ Building wasm_adapter package..."
@cd wasm_adapter && wasm-pack build --target web --release
@echo "๐จ Copying pkg into demo folder..."
@cd wasm_adapter && rm -rf wasm_demo/pkg || true && cp -r pkg wasm_demo/pkg || true
wasm-pack-publish:
@echo "๐ฆ Packing and publishing wasm_adapter/pkg to npm (requires NODE_AUTH_TOKEN/NPM_TOKEN)"
@cd wasm_adapter/pkg && echo "About to publish pkg in $$PWD" && npm publish --access public
wasm-serve:
@echo "๐ Serving wasm_adapter/ on :8080"
@cd wasm_adapter && python -m http.server 8080
update:
@echo "๐ฆ Updating dependencies..."
@cargo update
outdated:
@echo "๐ฆ Checking for outdated dependencies..."
@cargo outdated || echo "Install cargo-outdated: cargo install cargo-outdated"
audit:
@echo "๐ Running security audit..."
@cargo audit || echo "Install cargo-audit: cargo install cargo-audit"
coverage:
@echo "๐ Generating coverage report..."
@cargo tarpaulin --all-features || echo "Install cargo-tarpaulin: cargo install cargo-tarpaulin"
pre-commit: fmt clippy test
@echo "โ
Pre-commit checks passed!"
pre-push: ci
@echo "โ
Ready to push!"