aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-04-28 13:56:06 -0500
committerCraig Jennings <c@cjennings.net>2026-04-28 13:56:06 -0500
commit71ccfdd0e6216356ec6cac90bc627fe02dbfdeb1 (patch)
treea75a387d0c2ec95bfc3850e01fb58067b56aa628 /Makefile
downloadgloss-71ccfdd0e6216356ec6cac90bc627fe02dbfdeb1.tar.gz
gloss-71ccfdd0e6216356ec6cac90bc627fe02dbfdeb1.zip
chore: scaffold gloss package
Five layered files per the design at docs/design/gloss.org. gloss-core for the data layer, gloss-fetch for the network layer, gloss-display for the UI, gloss-drill for the spaced-repetition export, and gloss.el as the entry point. All five are skeletons. Implementation comes next. The Makefile delegates to ert with the usual unit, integration, and per-file targets. It also runs paren and lint passes. The package is licensed GPL-3.0-or-later. README is a placeholder pointing at the design doc.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile60
1 files changed, 60 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..047039a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,60 @@
+# Makefile for gloss
+# Run `make help' for available targets.
+
+EMACS ?= emacs
+EMACSFLAGS = --batch -Q
+LOADPATH = -L . -L tests
+
+PACKAGE_FILES = $(filter-out gloss-pkg.el,$(wildcard gloss*.el))
+TEST_FILES = $(wildcard tests/test-*.el)
+UNIT_TESTS = $(filter-out tests/test-integration-%.el,$(TEST_FILES))
+INTEGRATION_TESTS = $(wildcard tests/test-integration-*.el)
+
+.PHONY: help test test-unit test-integration test-file test-name validate-parens compile lint clean
+
+help:
+ @echo "Targets:"
+ @echo " make test Run all tests"
+ @echo " make test-unit Unit tests only"
+ @echo " make test-integration Integration tests only"
+ @echo " make test-file FILE=path/to/test-foo.el Run one test file"
+ @echo " make test-name TEST=pattern Run tests whose name matches PATTERN"
+ @echo " make validate-parens check-parens on every .el"
+ @echo " make compile Byte-compile package files"
+ @echo " make lint elisp-lint pass"
+ @echo " make clean Remove .elc"
+
+test:
+ @$(EMACS) $(EMACSFLAGS) $(LOADPATH) -l ert $(addprefix -l ,$(TEST_FILES)) -f ert-run-tests-batch-and-exit
+
+test-unit:
+ @$(EMACS) $(EMACSFLAGS) $(LOADPATH) -l ert $(addprefix -l ,$(UNIT_TESTS)) -f ert-run-tests-batch-and-exit
+
+test-integration:
+ @$(EMACS) $(EMACSFLAGS) $(LOADPATH) -l ert $(addprefix -l ,$(INTEGRATION_TESTS)) -f ert-run-tests-batch-and-exit
+
+test-file:
+ @if [ -z "$(FILE)" ]; then echo "Usage: make test-file FILE=tests/test-NAME.el"; exit 1; fi
+ @$(EMACS) $(EMACSFLAGS) $(LOADPATH) -l ert -l "$(FILE)" -f ert-run-tests-batch-and-exit
+
+test-name:
+ @if [ -z "$(TEST)" ]; then echo "Usage: make test-name TEST=pattern"; exit 1; fi
+ @$(EMACS) $(EMACSFLAGS) $(LOADPATH) -l ert $(addprefix -l ,$(TEST_FILES)) --eval "(ert-run-tests-batch-and-exit \"$(TEST)\")"
+
+validate-parens:
+ @for f in $(PACKAGE_FILES) $(TEST_FILES); do \
+ echo " check-parens: $$f"; \
+ $(EMACS) --batch --eval "(progn (find-file \"$$f\") (check-parens))" 2>&1 | grep -v '^Loading' || true; \
+ done
+
+compile:
+ @for f in $(PACKAGE_FILES); do \
+ echo " byte-compile: $$f"; \
+ $(EMACS) $(EMACSFLAGS) $(LOADPATH) --eval "(byte-compile-file \"$$f\")"; \
+ done
+
+lint:
+ @$(EMACS) $(EMACSFLAGS) $(LOADPATH) -l elisp-lint --funcall elisp-lint-files-batch $(PACKAGE_FILES)
+
+clean:
+ @rm -f *.elc tests/*.elc