|
1 | 1 | # AimDB Makefile |
2 | 2 | # Simple automation for common development tasks |
3 | 3 |
|
4 | | -.PHONY: help build test clean fmt fmt-check clippy doc all check test-embedded examples |
| 4 | +.PHONY: help build test clean fmt fmt-check clippy doc all check test-embedded examples deny audit security |
5 | 5 | .DEFAULT_GOAL := help |
6 | 6 |
|
7 | 7 | # Colors for output |
|
29 | 29 | @printf " check Comprehensive development check (fmt + clippy + all tests)\n" |
30 | 30 | @printf " test-embedded Test embedded/MCU cross-compilation compatibility\n" |
31 | 31 | @printf "\n" |
| 32 | + @printf " $(YELLOW)Security & Quality:$(NC)\n" |
| 33 | + @printf " deny Check dependencies (licenses, advisories, bans)\n" |
| 34 | + @printf " audit Audit dependencies for known vulnerabilities\n" |
| 35 | + @printf " security Run all security checks (deny + audit)\n" |
| 36 | + @printf "\n" |
32 | 37 | @printf " $(YELLOW)Convenience:$(NC)\n" |
33 | 38 | @printf " all Build everything\n" |
34 | 39 |
|
@@ -146,13 +151,40 @@ examples: |
146 | 151 | cargo build --package embassy-mqtt-connector-demo --target thumbv7em-none-eabihf |
147 | 152 | @printf "$(GREEN)All examples built successfully!$(NC)\n" |
148 | 153 |
|
| 154 | +## Security & Quality commands |
| 155 | +deny: |
| 156 | + @printf "$(GREEN)Checking dependencies with cargo-deny...$(NC)\n" |
| 157 | + @if ! command -v cargo-deny >/dev/null 2>&1; then \ |
| 158 | + printf "$(YELLOW) ⚠ cargo-deny not found, installing...$(NC)\n"; \ |
| 159 | + cargo install cargo-deny --locked; \ |
| 160 | + fi |
| 161 | + @printf "$(YELLOW) → Checking licenses$(NC)\n" |
| 162 | + @printf "$(YELLOW) → Checking security advisories$(NC)\n" |
| 163 | + @printf "$(YELLOW) → Checking banned dependencies$(NC)\n" |
| 164 | + @printf "$(YELLOW) → Checking dependency sources$(NC)\n" |
| 165 | + cargo deny check |
| 166 | + |
| 167 | +audit: |
| 168 | + @printf "$(GREEN)Auditing dependencies for vulnerabilities...$(NC)\n" |
| 169 | + @if ! command -v cargo-audit >/dev/null 2>&1; then \ |
| 170 | + printf "$(YELLOW) ⚠ cargo-audit not found, installing...$(NC)\n"; \ |
| 171 | + cargo install cargo-audit --locked; \ |
| 172 | + fi |
| 173 | + cargo audit |
| 174 | + |
| 175 | +security: deny audit |
| 176 | + @printf "$(GREEN)All security checks completed!$(NC)\n" |
| 177 | + @printf "$(BLUE)✓ Dependencies verified (licenses, advisories, bans)$(NC)\n" |
| 178 | + @printf "$(BLUE)✓ Known vulnerabilities checked$(NC)\n" |
| 179 | + |
149 | 180 | ## Convenience commands |
150 | | -check: fmt-check clippy test test-embedded |
| 181 | +check: fmt-check clippy test test-embedded deny |
151 | 182 | @printf "$(GREEN)Comprehensive development checks completed!$(NC)\n" |
152 | 183 | @printf "$(BLUE)✓ Code formatting verified$(NC)\n" |
153 | 184 | @printf "$(BLUE)✓ Linter passed$(NC)\n" |
154 | 185 | @printf "$(BLUE)✓ All valid feature combinations tested$(NC)\n" |
155 | 186 | @printf "$(BLUE)✓ Embedded target compatibility verified$(NC)\n" |
| 187 | + @printf "$(BLUE)✓ Dependencies verified (deny)$(NC)\n" |
156 | 188 |
|
157 | 189 | all: build test examples |
158 | 190 | @printf "$(GREEN)Build and test completed!$(NC)\n" |
0 commit comments