aboutsummaryrefslogtreecommitdiff
path: root/claude-templates/Makefile
blob: e097cc20a92f5831016ac244bd4e95ded104a6b4 (plain)
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
.DEFAULT_GOAL := help

PREFIX ?= $(HOME)/.local/bin
SRC    := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))

.PHONY: help install uninstall list test-scripts

help:
	@printf 'claude-templates — session launcher + project seed\n\n'
	@printf 'Targets:\n'
	@printf '  make install       symlink bin/ai into %s\n' "$(PREFIX)"
	@printf '  make uninstall     remove the symlink\n'
	@printf '  make list          show installed symlink\n'
	@printf '  make test-scripts  run pytest + ERT suites under .ai/scripts/tests/\n'

install:
	@mkdir -p $(PREFIX)
	@chmod +x $(SRC)/bin/ai
	@ln -sfn $(SRC)/bin/ai $(PREFIX)/ai
	@printf 'installed %s/ai -> %s/bin/ai\n' "$(PREFIX)" "$(SRC)"

uninstall:
	@if [ -L $(PREFIX)/ai ]; then \
		rm $(PREFIX)/ai; \
		printf 'removed %s/ai\n' "$(PREFIX)"; \
	else \
		printf '%s/ai is not a symlink; nothing to remove\n' "$(PREFIX)"; \
	fi

list:
	@ls -la $(PREFIX)/ai 2>/dev/null || printf 'not installed\n'

test-scripts:
	@cd $(SRC)/.ai/scripts/tests && python -m pytest
	@set -e; for f in $(SRC)/.ai/scripts/tests/test-*.el; do \
		[ -e "$$f" ] || continue; \
		echo "ert: $$(basename "$$f")"; \
		emacs --batch -q -L $(SRC)/.ai/scripts -l ert -l "$$f" -f ert-run-tests-batch-and-exit; \
	done