-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
47 lines (38 loc) · 1.24 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
EMACS ?= emacs
ELS = separedit.el
ELCS = separedit.elc
TEST_ELS = test/test-bootstrap.el test/separedit-test-helper.el test/separedit-test.el
# If the first argument is "test"...
ifeq (test, $(firstword $(MAKECMDGOALS)))
# use the rest as arguments for "test"
SELECTOR := $(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(SELECTOR):;@:)
endif
all: compile test readme clean
%.elc:%.el
$(EMACS) -batch -L . -l test/test-bootstrap.el -f batch-byte-compile $(ELS)
compile:$(ELCS)
.PHONY: test readme
test:$(ELCS)
ifeq ($(SELECTOR),)
$(EMACS) -Q --batch -L . $(addprefix -l , $(TEST_ELS)) -f ert-run-tests-batch-and-exit
else
$(EMACS) -Q --batch -L . $(addprefix -l , $(TEST_ELS)) --eval "(ert-run-tests-batch-and-exit '$(SELECTOR))"
endif
readme:
$(EMACS) -Q --batch -L . $(addprefix -l , $(TEST_ELS)) --eval "\
(let ((filename (expand-file-name \"README.md\")))\
(with-temp-buffer\
(insert\
\"<!-- This file was generated from elisp commentary section by tool, DO NOT EDIT -->\n\n\"\
(separedit-test--generate-readme))\
(write-file filename)))"
help:
@echo make
@echo make compile
@echo make test [SELECTOR]
@echo make readme
@echo make clean
clean:
@rm -f *.elc