-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
37 lines (29 loc) · 909 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
EMACS ?= emacs
ELS = playonline.el
ELCS = playonline.elc
TEST_ELS = test/test-bootstrap.el test/playonline-test-helper.el test/playonline-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: clean compile test
%.elc:%.el
$(EMACS) -batch -L . -l test/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