View raw

1 # Repo-wide checks and install for agent-assets. 2 # 3 # make check Run every skill test suite and byte-compile every .el file. 4 # make test Run every skill test suite. 5 # make compile Byte-compile every .el file with warnings as errors. 6 # make install Symlink every skill and steering module into ~/.kiro. 7 # make clean Remove byte-compiled files. 8 9 EMACS ?= emacs 10 11 SKILL_DIRS := $(wildcard skills/*) 12 TEST_RUNNERS := $(wildcard skills/*/run-tests.sh) 13 EL_FILES := $(wildcard skills/*/*.el) 14 ELC_FILES := $(EL_FILES:.el=.elc) 15 16 .PHONY: check test compile install clean 17 18 check: test compile 19 20 test: $(TEST_RUNNERS) 21 @for runner in $(TEST_RUNNERS); do \ 22 echo "==> $$runner"; \ 23 "$$runner" || exit 1; \ 24 done 25 26 # Compile each skill directory in one Emacs, with the skill directory on 27 # the load path so that cross-file requires resolve. A warning fails the 28 # build, so the sources stay warning-free. 29 compile: 30 @for dir in $(SKILL_DIRS); do \ 31 files=$$(ls "$$dir"/*.el 2>/dev/null) || continue; \ 32 [ -n "$$files" ] || continue; \ 33 echo "==> byte-compile $$dir"; \ 34 $(EMACS) --batch -Q -L "$$dir" \ 35 --eval '(setq byte-compile-error-on-warn t)' \ 36 -f batch-byte-compile $$files || exit 1; \ 37 done 38 @$(MAKE) --no-print-directory clean 39 40 install: 41 @./install.sh 42 43 clean: 44 @rm -f $(ELC_FILES) 45