-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
38 lines (29 loc) · 867 Bytes
/
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
EMACS ?= emacs
ELS = igist.el
ELCS = igist.elc
TEST_ELS = tests/test-bootstrap.el tests/igist-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 clean
%.elc:%.el
$(EMACS) -batch -L . -l tests/test-bootstrap.el -f batch-byte-compile $(ELS)
compile:$(ELCS)
.PHONY: test
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
help:
@echo make
@echo make compile
@echo make test [SELECTOR]
@echo make clean
clean:
@rm -f *.elc