-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
120 lines (99 loc) · 3.18 KB
/
Makefile
File metadata and controls
120 lines (99 loc) · 3.18 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
119
120
# ccft - an agentic self improvement tool
#
# One artifact: the binary. No install dir, no rsync.
# All filesystem state under: ~/.config/ccft/, ~/.local/share/ccft/, ~/.cc-flytrap/
CARGO ?= cargo
BIN_NAME ?= ccft
TARGET ?= release
# Where the build lands.
BUILT_BIN := target/$(TARGET)/$(BIN_NAME)
# Where it gets installed.
INSTALL_DIR := $(HOME)/.local/bin
INSTALL_BIN := $(INSTALL_DIR)/$(BIN_NAME)
.PHONY: help check clippy build dev install uninstall start stop status restart trust logs clean test smoke
# Default target — fastest correctness signal during dev.
.DEFAULT_GOAL := check
help:
@echo "ccft - an agentic self improvement tool"
@echo ""
@echo "fast iteration (no link):"
@echo " make check cargo check (parse + types + borrow, ~5s incremental)"
@echo " make clippy lints + check"
@echo ""
@echo "build + install:"
@echo " make build compile a release binary at $(BUILT_BIN)"
@echo " make dev run from target/release on port 7179, foreground"
@echo " make install build + ./ccft install"
@echo " make uninstall ./ccft uninstall"
@echo ""
@echo "lifecycle:"
@echo " make start ccft start (kick launchd)"
@echo " make stop ccft stop (bootout)"
@echo " make restart ccft restart"
@echo " make status ccft status"
@echo ""
@echo " make trust print env vars for Claude"
@echo " make logs tail launchd output"
@echo ""
@echo " make test cargo test"
@echo " make clean cargo clean"
check:
$(CARGO) check
clippy:
$(CARGO) clippy -- -D warnings
build:
$(CARGO) build --$(TARGET)
dev: build
$(BUILT_BIN) dev
install: build
$(BUILT_BIN) install
uninstall:
@if [ -x "$(INSTALL_BIN)" ]; then \
"$(INSTALL_BIN)" uninstall; \
elif [ -x "$(BUILT_BIN)" ]; then \
"$(BUILT_BIN)" uninstall; \
else \
echo "no ccft binary found — already uninstalled?"; \
fi
start:
"$(INSTALL_BIN)" start
stop:
"$(INSTALL_BIN)" stop
status:
@if [ -x "$(INSTALL_BIN)" ]; then "$(INSTALL_BIN)" status; \
else "$(BUILT_BIN)" status; fi
restart:
"$(INSTALL_BIN)" restart
trust:
@if [ -x "$(INSTALL_BIN)" ]; then "$(INSTALL_BIN)" trust; \
else "$(BUILT_BIN)" trust; fi
logs:
@if [ -x "$(INSTALL_BIN)" ]; then "$(INSTALL_BIN)" logs; \
else "$(BUILT_BIN)" logs; fi
test:
$(CARGO) test
# Isolated install/uninstall smoke against /tmp/ccft-smoke. Never touches
# real ~/.local/bin, ~/Library/LaunchAgents, or the launchctl gui domain.
SMOKE_PREFIX := /tmp/ccft-smoke
smoke: build
@rm -rf $(SMOKE_PREFIX)
@echo "─── isolated install (CCFT_PREFIX=$(SMOKE_PREFIX)) ───"
@CCFT_PREFIX=$(SMOKE_PREFIX) $(BUILT_BIN) install
@echo
@echo "─── status ───"
@CCFT_PREFIX=$(SMOKE_PREFIX) $(BUILT_BIN) status
@echo
@echo "─── what's on disk under the prefix ───"
@find $(SMOKE_PREFIX) -type f | sort
@echo
@echo "─── isolated uninstall ───"
@CCFT_PREFIX=$(SMOKE_PREFIX) $(BUILT_BIN) uninstall
@echo
@echo "─── verify clean ───"
@CCFT_PREFIX=$(SMOKE_PREFIX) $(BUILT_BIN) status
@find $(SMOKE_PREFIX) -type f 2>/dev/null | sort || true
@rm -rf $(SMOKE_PREFIX)
@echo
@echo "✓ smoke passed — production install untouched"
clean:
$(CARGO) clean