-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
39 lines (31 loc) · 890 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
39
EMACS ?= emacs
ELS = jagger-util.el \
jagger-swap.el \
jagger-move.el \
jagger-sort.el
TEST_ELS = test-util.el \
test-jagger-util.el \
test-jagger-swap.el \
test-jagger-move.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
compile:
$(EMACS) -batch -L . -f batch-byte-compile $(ELS)
test:
ifeq ($(SELECTOR),)
$(EMACS) -Q --batch -L . $(addprefix -l , $(ELS) $(TEST_ELS)) -f ert-run-tests-batch-and-exit
else
$(EMACS) -Q --batch -L . $(addprefix -l , $(ELS) $(TEST_ELS)) --eval "(ert-run-tests-batch-and-exit '$(SELECTOR))"
endif
help:
@echo make
@echo make compile
@echo make test [SELECTOR]
clean:
@rm -f *.elc