11# Variables
2- PKG = github.com/habedi/template-rust-project
2+ PKG = github.com/habedi/vq
33BINARY_NAME = $(or $(PROJ_BINARY ) , $(notdir $(PKG ) ) )
44BINARY = target/release/$(BINARY_NAME )
55PATH := /snap/bin:$(PATH )
6+ CARGO_TERM_COLOR = always
7+ DEBUG_VQ = 0
68
79# Default target
810.DEFAULT_GOAL := help
@@ -19,22 +21,22 @@ format: ## Format Rust files
1921.PHONY : test
2022test : format # # Run tests
2123 @echo " Running tests..."
22- cargo test -- --nocapture
24+ DEBUG_VQ= $( DEBUG_VQ ) cargo test -- --nocapture
2325
2426.PHONY : coverage
2527coverage : format # # Generate test coverage report
2628 @echo " Generating test coverage report..."
27- cargo tarpaulin --out Xml --out Html
29+ DEBUG_VQ= $( DEBUG_VQ ) cargo tarpaulin --out Xml --out Html
2830
2931.PHONY : build
3032build : format # # Build the binary for the current platform
3133 @echo " Building the project..."
32- cargo build --release
34+ DEBUG_VQ= $( DEBUG_VQ ) cargo build --release
3335
3436.PHONY : run
3537run : build # # Build and run the binary
3638 @echo " Running the $( BINARY) binary..."
37- ./$(BINARY )
39+ DEBUG_VQ= $( DEBUG_VQ ) ./$(BINARY )
3840
3941.PHONY : clean
4042clean : # # Remove generated and temporary files
@@ -54,13 +56,24 @@ install-deps: install-snap ## Install development dependencies
5456 @echo " Installing dependencies..."
5557 rustup component add rustfmt clippy
5658 cargo install cargo-tarpaulin
59+ cargo install cargo-audit
5760
5861.PHONY : lint
5962lint : format # # Run linters on Rust files
6063 @echo " Linting Rust files..."
61- cargo clippy -- -D warnings
64+ DEBUG_VQ= $( DEBUG_VQ ) cargo clippy -- -D warnings
6265
6366.PHONY : publish
6467publish : # # Publish the package to crates.io (requires CARGO_REGISTRY_TOKEN to be set)
6568 @echo " Publishing the package to Cargo registry..."
66- cargo publish --token $(CARGO_REGISTRY_TOKEN )
69+ cargo publish --token $(CARGO_REGISTRY_TOKEN )
70+
71+ .PHONY : bench
72+ bench : # # Run benchmarks
73+ @echo " Running benchmarks..."
74+ DEBUG_VQ=$(DEBUG_VQ ) cargo bench
75+
76+ .PHONY : audit
77+ audit : # # Run security audit on Rust dependencies
78+ @echo " Running security audit..."
79+ cargo audit
0 commit comments