Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
118 lines (79 loc) · 4.68 KB
/
Copy pathMakefile
File metadata and controls
118 lines (79 loc) · 4.68 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
CARGO := cargo
BOLD := \033[1m
CYAN := \033[36m
GREEN := \033[32m
RESET := \033[0m
.DEFAULT_GOAL := help
# ── Build ────────────────────────────────────────────────────────────────────
.PHONY: build release
build: ## Debug build
$(CARGO) build
release: ## Release build (LTO + strip)
$(CARGO) build --release
# ── Quality ──────────────────────────────────────────────────────────────────
.PHONY: check audit test lint fmt
check: audit ## Full quality gate — dependency audit, format, lint, test
@printf '\n$(BOLD)[2/4] Checking format$(RESET)\n'
$(CARGO) fmt --all -- --check
@printf '\n$(BOLD)[3/4] Running clippy$(RESET)\n'
$(CARGO) clippy --workspace --all-targets --features bench -- -D warnings
@printf '\n$(BOLD)[4/4] Running tests$(RESET)\n'
$(CARGO) test --workspace
$(CARGO) build --workspace
python3 scripts/check-contracts target/debug/recall
@printf '\n$(GREEN) ✓ All checks passed$(RESET)\n\n'
audit: ## Check locked Rust dependencies for known vulnerabilities
@printf '\n$(BOLD)[1/4] Auditing dependencies$(RESET)\n'
$(CARGO) audit --file Cargo.lock
test: ## Run tests
$(CARGO) test --workspace
lint: ## Run clippy
$(CARGO) clippy --workspace --all-targets --features bench -- -D warnings
fmt: ## Format code
$(CARGO) fmt --all
# ── Benchmarks ───────────────────────────────────────────────────────────────
.PHONY: bench
bench: ## Run local benchmarks
$(CARGO) bench --features bench --bench recall
# ── Documentation ────────────────────────────────────────────────────────────
.PHONY: doc
doc: ## Generate API documentation
$(CARGO) doc --no-deps
# ── Install ──────────────────────────────────────────────────────────────────
.PHONY: install uninstall
install: ## Install binaries to ~/.cargo/bin
$(CARGO) install --path . --locked
@if [ -d "$(HOME)/.zsh/completions" ]; then \
"$(HOME)/.cargo/bin/recall" completions zsh > "$(HOME)/.zsh/completions/_recall"; \
printf '$(GREEN) ✓ Updated ~/.zsh/completions/_recall$(RESET)\n'; \
fi
uninstall: ## Remove installed binaries
$(CARGO) uninstall recall
# ── Run ──────────────────────────────────────────────────────────────────────
.PHONY: run sync search
run: ## Launch TUI
$(CARGO) run
sync: ## Incremental sync (use FORCE=1 to reprocess all)
$(CARGO) run -- sync $(if $(FORCE),--force,)
search: ## Search sessions (Q="query")
@test -n "$(Q)" || { printf 'Usage: make search Q="query"\n'; exit 1; }
$(CARGO) run -- search "$(Q)"
# ── Release ──────────────────────────────────────────────────────────────────
.PHONY: release-patch release-minor release-major
release-patch: ## Bump patch + commit + tag + push (append EXECUTE=1 to apply)
cargo release patch $(if $(EXECUTE),--execute,)
release-minor: ## Bump minor + commit + tag + push (append EXECUTE=1 to apply)
cargo release minor $(if $(EXECUTE),--execute,)
release-major: ## Bump major + commit + tag + push (append EXECUTE=1 to apply)
cargo release major $(if $(EXECUTE),--execute,)
# ── Maintenance ──────────────────────────────────────────────────────────────
.PHONY: clean
clean: ## Remove build artifacts
$(CARGO) clean
# ── Help ─────────────────────────────────────────────────────────────────────
.PHONY: help
help: ## Show available targets
@awk 'BEGIN {FS = ":.*## "; printf "\n$(BOLD)Recall$(RESET) — local-first AI session search\n"} \
/^# ── / {n = $$0; gsub(/(^# ── | (─)+$$)/, "", n); printf "\n$(BOLD)%s$(RESET)\n", n} \
/^[a-zA-Z_-]+:.*## / {printf " $(CYAN)make %-12s$(RESET) %s\n", $$1, $$2} \
END {printf "\n"}' $(MAKEFILE_LIST)