-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathMakefile
More file actions
105 lines (70 loc) · 4.08 KB
/
Copy pathMakefile
File metadata and controls
105 lines (70 loc) · 4.08 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
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 test lint fmt
check: ## Full quality gate — format, lint, test
@printf '\n$(BOLD)[1/3] Checking format$(RESET)\n'
$(CARGO) fmt --all -- --check
@printf '\n$(BOLD)[2/3] Running clippy$(RESET)\n'
$(CARGO) clippy --workspace --all-targets -- -D warnings
@printf '\n$(BOLD)[3/3] Running tests$(RESET)\n'
$(CARGO) test --workspace
@printf '\n$(GREEN) ✓ All checks passed$(RESET)\n\n'
test: ## Run tests
$(CARGO) test --workspace
lint: ## Run clippy
$(CARGO) clippy --workspace --all-targets -- -D warnings
fmt: ## Format code
$(CARGO) fmt --all
# ── Documentation ────────────────────────────────────────────────────────────
.PHONY: doc
doc: ## Generate API documentation
$(CARGO) doc --no-deps
# ── Install ──────────────────────────────────────────────────────────────────
.PHONY: install uninstall
install: ## Install binary 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 binary
$(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)