Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (60 loc) · 2.15 KB
/
Copy pathMakefile
File metadata and controls
72 lines (60 loc) · 2.15 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
70
71
72
.PHONY: all build release test clean install install-completions lint fuzz-check audit help
CARGO ?= cargo
PREFIX ?= /usr/local
DESTDIR ?=
BINDIR := $(DESTDIR)$(PREFIX)/bin
SENDBOX := target/release/sendbox
FUZZ_MANIFESTS := \
fuzz/security/Cargo.toml \
fuzz/git/Cargo.toml \
fuzz/secrets/Cargo.toml \
fuzz/credentials/Cargo.toml \
fuzz/mcp/Cargo.toml \
fuzz/bpf/Cargo.toml \
fuzz/project/Cargo.toml \
fuzz/config/Cargo.toml \
fuzz/protocol/Cargo.toml \
fuzz/registry/Cargo.toml
all: release
build:
$(CARGO) build --locked --workspace
release:
$(CARGO) build --locked --workspace --release
test:
$(CARGO) test --locked --workspace --all-features
clean:
$(CARGO) clean
install: release
install -d "$(BINDIR)"
install -m 0755 "$(SENDBOX)" "$(BINDIR)/sendbox"
@if [ -z "$(DESTDIR)" ]; then \
"$(SENDBOX)" completions install 2>/dev/null \
|| echo "Shell completions not installed; run 'sendbox completions install' manually."; \
else \
echo "Skipping shell completions for staged install"; \
fi
@echo "sendbox installed to $(BINDIR)/sendbox"
install-completions: release
@"$(SENDBOX)" completions install
lint: fuzz-check
$(CARGO) fmt --all -- --check
$(CARGO) clippy --locked --workspace --all-targets --all-features -- -D warnings
fuzz-check:
@set -e; for manifest in $(FUZZ_MANIFESTS); do \
$(CARGO) check --locked --manifest-path "$$manifest" --bins; \
done
audit:
$(CARGO) audit
help:
@echo "Available targets:"
@echo " all Build the release workspace (default)"
@echo " build Build the Rust workspace in debug mode"
@echo " release Build the Rust workspace in release mode"
@echo " test Run all Rust tests"
@echo " clean Remove Cargo build artifacts"
@echo " install Install the sendbox binary and user completions"
@echo " install-completions Install user shell completions"
@echo " lint Check fuzz locks, rustfmt, and Clippy"
@echo " fuzz-check Compile every standalone fuzz workspace with its lockfile"
@echo " audit Audit Cargo.lock with cargo-audit"
@echo " help Show this help message"