-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
43 lines (32 loc) · 1.03 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
PKGDIR = .
LISPDIR = $(PKGDIR)/
TESTDIR = $(PKGDIR)/test
LISP = $(wildcard $(LISPDIR)/*.el)
TEST = $(wildcard $(TESTDIR)/*.el)
OBJS = $(LISP:.el=.elc) $(TEST:.el=.elc)
# Emacs CLI flags
DIRECTORY = --directory
FUNCALL = --funcall
LOAD = --load
# Emacs batch functions
BATCH = emacs -Q --batch $(DIRECTORY) $(LISPDIR)
COMPILE = $(FUNCALL) batch-byte-compile
RUN_ERT = $(FUNCALL) ert-run-tests-batch-and-exit
# Test commands
RUN_TEST = $(BATCH) $(DIRECTORY) $(TESTDIR)
.PHONY: all clean compile test $(TEST)
all: compile test
clean:
$(RM) $(OBJS)
# This is here to make sure the byte compiler doesn't complain about
# anything, but I don't think it loads any compiled code.
compile: clean
$(BATCH) $(COMPILE) $(LISP)
$(RUN_TEST) $(COMPILE) $(TEST)
test: $(TEST)
# This also runs the test utils file, which contains no tests. This
# doesn't have any ill effects, I don't think, except for the useless
# message "Ran 0 tests, 0 results as expected". Is there a simple way
# to exclude that file?
$(TEST):
$(RUN_TEST) $(LOAD) $@ $(RUN_ERT)