.PHONY: all header help \
build build-release check \
test test-default test-all test-no-default \
fmt fmt-check \
clippy clippy-fix \
doc doc-open \
coverage coverage-html \
bench audit \
verify publish-dry \
clean clean-all
.DEFAULT_GOAL := help
ifeq ($(OS),Windows_NT)
header:
@echo _
@echo _ __ ___ __^(_^) __ _ ___ ___ __ _ _ __
@echo ^| '_ \ / _ \_____ / _^| ^|/ _` / __^|/ __/ _` ^| '_ \
@echo ^| ^|_^) ^| __/_____\__ \ ^| ^(_^| \__ \ ^(_^| ^(_^| ^| ^| ^| ^|
@echo ^| .__/ \___^| ^|___/_^|\__, ^|___/\___\__,_^|_^| ^|_^|
@echo ^|_^| ^|___/
@echo.
@echo pe-sigscan by H0llyW00dzZ ^(@github.com/H0llyW00dzZ^)
@echo.
else
header:
@printf '%s\n' ' _ '
@printf '%s\n' ' _ __ ___ __(_) __ _ ___ ___ __ _ _ __ '
@printf '%s\n' ' | '"'"'_ \ / _ \_____ / _| |/ _` / __|/ __/ _` | '"'"'_ \ '
@printf '%s\n' ' | |_) | __/_____\__ \ | (_| \__ \ (_| (_| | | | | '
@printf '%s\n' ' | .__/ \___| |___/_|\__, |___/\___\__,_|_| |_| '
@printf '%s\n' ' |_| |___/ '
@printf '%s\n' ''
@printf '%s\n' ' pe-sigscan by H0llyW00dzZ (@github.com/H0llyW00dzZ) '
@printf '%s\n' ''
endif
help: header
@echo Usage: make ^<target^>
@echo.
@echo Build:
@echo build Debug build
@echo build-release Release build
@echo check Quick type-check across all features and targets
@echo.
@echo Test:
@echo test Run tests with all features
@echo test-default Run tests with default features
@echo test-no-default Run tests with --no-default-features
@echo test-all Run all three test variants
@echo.
@echo Lint and format:
@echo fmt Apply rustfmt to the workspace
@echo fmt-check Verify rustfmt is clean (CI gate)
@echo clippy Run clippy with -D warnings on all features and targets
@echo clippy-fix Apply clippy auto-fixes
@echo.
@echo Docs and coverage:
@echo doc Build rustdoc for the local crate
@echo doc-open Build and open rustdoc
@echo coverage Print line/region coverage summary
@echo coverage-html Generate HTML coverage report
@echo.
@echo Benchmarks and audit:
@echo bench Run criterion benchmarks
@echo audit cargo-audit security check (requires cargo-audit)
@echo.
@echo Composite:
@echo verify fmt-check + clippy + test-all (full local CI gate)
@echo publish-dry cargo publish --dry-run
@echo all header + build + test
@echo.
@echo Cleanup:
@echo clean cargo clean
@echo clean-all cargo clean + remove benchmark artifacts
all: header build test
build: header
@echo :: Building debug profile...
cargo build --all-features
@echo :: Done.
build-release: header
@echo :: Building release profile...
cargo build --release --all-features
@echo :: Done.
check: header
@echo :: Running cargo check...
cargo check --all-features --all-targets
@echo :: Done.
test: header
@echo :: Running tests (all features)...
cargo test --all-features
@echo :: Done.
test-default: header
@echo :: Running tests (default features)...
cargo test
@echo :: Done.
test-no-default: header
@echo :: Running tests (--no-default-features)...
cargo test --no-default-features
@echo :: Done.
test-all: header test-default test-no-default test
fmt: header
@echo :: Applying rustfmt...
cargo fmt --all
@echo :: Done.
fmt-check: header
@echo :: Checking rustfmt...
cargo fmt --all -- --check
@echo :: Done.
clippy: header
@echo :: Running clippy...
cargo clippy --all-features --all-targets -- -D warnings
@echo :: Done.
clippy-fix: header
@echo :: Applying clippy fixes...
cargo clippy --all-features --all-targets --fix --allow-dirty --allow-staged
@echo :: Done.
doc: header
@echo :: Building rustdoc...
cargo doc --no-deps --all-features
@echo :: Done.
doc-open: header
@echo :: Building and opening rustdoc...
cargo doc --no-deps --all-features --open
@echo :: Done.
coverage: header
@echo :: Running cargo llvm-cov (summary)...
cargo llvm-cov --all-features --workspace --summary-only
@echo :: Done.
coverage-html: header
@echo :: Generating HTML coverage report...
cargo llvm-cov --all-features --workspace --html
@echo :: Done. Open target/llvm-cov/html/index.html
bench: header
@echo :: Running benchmarks...
cargo bench --all-features
@echo :: Done.
audit: header
@echo :: Running cargo-audit...
cargo audit
@echo :: Done.
verify: header fmt-check clippy test-all
@echo :: Verify passed.
publish-dry: header verify
@echo :: Running cargo publish --dry-run...
cargo publish --dry-run --all-features
@echo :: Done.
clean: header
@echo :: Cleaning cargo target...
cargo clean
@echo :: Done.
clean-all: header clean
@echo :: Removing criterion artifacts...
ifeq ($(OS),Windows_NT)
-@if exist target\criterion rmdir /s /q target\criterion
else
-@rm -rf target/criterion
endif
@echo :: Done.