@@ -3,6 +3,7 @@ PKG = github.com/habedi/template-rust-project
3
3
BINARY_NAME = $(or $(PROJ_BINARY ) , $(notdir $(PKG ) ) )
4
4
BINARY = target/release/$(BINARY_NAME )
5
5
PATH := /snap/bin:$(PATH )
6
+ DEBUG_PROJ = 1
6
7
7
8
# Default target
8
9
.DEFAULT_GOAL := help
@@ -19,22 +20,22 @@ format: ## Format Rust files
19
20
.PHONY : test
20
21
test : format # # Run tests
21
22
@echo " Running tests..."
22
- cargo test -- --nocapture
23
+ DEBUG_PROJ= $( DEBUG_PROJ ) cargo test -- --nocapture
23
24
24
25
.PHONY : coverage
25
26
coverage : format # # Generate test coverage report
26
27
@echo " Generating test coverage report..."
27
- cargo tarpaulin --out Xml --out Html
28
+ DEBUG_PROJ= $( DEBUG_PROJ ) cargo tarpaulin --out Xml --out Html
28
29
29
30
.PHONY : build
30
31
build : format # # Build the binary for the current platform
31
32
@echo " Building the project..."
32
- cargo build --release
33
+ DEBUG_PROJ= $( DEBUG_PROJ ) cargo build --release
33
34
34
35
.PHONY : run
35
36
run : build # # Build and run the binary
36
37
@echo " Running the $( BINARY) binary..."
37
- ./$(BINARY )
38
+ DEBUG_PROJ= $( DEBUG_PROJ ) ./$(BINARY )
38
39
39
40
.PHONY : clean
40
41
clean : # # Remove generated and temporary files
@@ -54,13 +55,24 @@ install-deps: install-snap ## Install development dependencies
54
55
@echo " Installing dependencies..."
55
56
rustup component add rustfmt clippy
56
57
cargo install cargo-tarpaulin
58
+ cargo install cargo-audit
57
59
58
60
.PHONY : lint
59
61
lint : format # # Run linters on Rust files
60
62
@echo " Linting Rust files..."
61
- cargo clippy -- -D warnings
63
+ DEBUG_PROJ= $( DEBUG_PROJ ) cargo clippy -- -D warnings
62
64
63
65
.PHONY : publish
64
66
publish : # # Publish the package to crates.io (requires CARGO_REGISTRY_TOKEN to be set)
65
67
@echo " Publishing the package to Cargo registry..."
66
- cargo publish --token $(CARGO_REGISTRY_TOKEN )
68
+ cargo publish --token $(CARGO_REGISTRY_TOKEN )
69
+
70
+ .PHONY : bench
71
+ bench : # # Run benchmarks
72
+ @echo " Running benchmarks..."
73
+ DEBUG_PROJ=$(DEBUG_PROJ ) cargo bench
74
+
75
+ .PHONY : audit
76
+ audit : # # Run security audit on Rust dependencies
77
+ @echo " Running security audit..."
78
+ cargo audit
0 commit comments