-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (55 loc) · 1.88 KB
/
Makefile
File metadata and controls
69 lines (55 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
.PHONY: build build-release build-linux-musl-debug build-linux-musl-release clippy fmt audit clean check install help
# Default target
all: build
# Build Debug
build:
cargo build
# Build Release
build-release:
cargo build --release
# Build Debug with MUSL (static binary)
build-linux-musl-debug:
cargo build --target x86_64-unknown-linux-musl
# Build Release with MUSL
build-linux-musl-release:
cargo build --release --target x86_64-unknown-linux-musl
# Run Clippy with all targets/features, fail on warnings
clippy:
cargo clippy --all-targets --all-features -- -D warnings
# Format code
fmt:
cargo fmt
# Check formatting without making changes
fmt-check:
cargo fmt -- --check
# Audit for vulnerable crates
audit:
cargo install --quiet cargo-audit || true
cargo audit
# Clean build artifacts
clean:
cargo clean
# Run all checks (format, clippy, build)
check: fmt-check clippy build
# Install the binary to ~/.cargo/bin
install:
cargo install --path .
# Install the binary to ~/.cargo/bin (release mode)
install-release:
cargo install --path . --release
# Show help
help:
@echo "Available targets:"
@echo " build - Build debug version"
@echo " build-release - Build release version"
@echo " build-linux-musl-debug - Build debug static binary (Linux MUSL)"
@echo " build-linux-musl-release- Build release static binary (Linux MUSL)"
@echo " clippy - Run clippy linter"
@echo " fmt - Format code"
@echo " fmt-check - Check code formatting"
@echo " audit - Run security audit"
@echo " clean - Clean build artifacts"
@echo " check - Run all checks (fmt, clippy, build)"
@echo " install - Install binary (debug)"
@echo " install-release - Install binary (release)"
@echo " help - Show this help message"