forked from radian-software/prescient.el
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (49 loc) · 1.56 KB
/
Makefile
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
VERSION ?=
CMD ?=
EMACS ?= emacs
# The order is important for compilation.
for_compile := prescient.el $(wildcard *-prescient.el)
for_checkdoc := prescient.el $(wildcard *-prescient.el)
for_longlines := $(wildcard *.el *.md *.yml) Makefile
.PHONY: help
help: ## Show this message
@echo "usage:" >&2
@grep -h "[#]# " $(MAKEFILE_LIST) | \
sed 's/^/ make /' | \
sed 's/:[^#]*[#]# /|/' | \
sed 's/%/LANG/' | \
column -t -s'|' >&2
.PHONY: lint
lint: compile checkdoc longlines test ## Run all the linters and tests
.PHONY: compile
compile: ## Byte-compile
@for file in $(for_compile); do \
echo "[compile] $$file" ;\
$(EMACS) -Q --batch -L . -L stub -f batch-byte-compile $$file 2>&1 \
| grep -v "^Wrote" \
| grep . && exit 1 || true ;\
done
.PHONY: checkdoc
checkdoc: ## Check docstring style
@for file in $(for_checkdoc); do \
echo "[checkdoc] $$file" ;\
$(EMACS) -Q --batch \
--eval "(or (fboundp 'checkdoc-file) (kill-emacs))" \
--eval "(setq sentence-end-double-space nil)" \
--eval "(checkdoc-file \"$$file\")" 2>&1 \
| grep . && exit 1 || true ;\
done
.PHONY: longlines
longlines: ## Check for long lines
@scripts/check-line-length.bash
.PHONY: test
test:
$(EMACS) -Q --batch -L . -l ert -l ./test/prescient-test.el \
--eval "(let ((ert-quiet t)) (ert-run-tests-batch-and-exit))"
.PHONY: clean
clean: ## Remove build artifacts
@echo "[clean]" *.elc
@rm -f *.elc
.PHONY: docker
docker: ## Start a Docker shell; e.g. make docker VERSION=25.3
@scripts/docker.bash "$(VERSION)" "$(CMD)"