-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
72 lines (60 loc) · 1.89 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
EMACS ?= emacs
# only use KEG if it is available in the PATH or the location is explicitely
# given
ifndef KEG
ifneq (, $(shell which keg))
KEGEXEC = keg exec
KEG = keg
endif
else
KEGEXEC = $(KEG) exec
endif
ifdef OCC_CONFIG
loadconf = -l $(OCC_CONFIG)
endif
ifdef OCC_INIT
loadinit = -l $(OCC_INIT)
endif
ifdef TESTNAME
testcmd = (ert \"$(TESTNAME)\")
else
testcmd = (ert t)
endif
.PHONY: test debug test-regx clean
.SUFFIXES: .el .elc
.el.elc:
$(EMACS) -Q --batch -L . -f batch-byte-compile $<
all: test
compile: org-clock-convenience.elc
@echo "Byte compiling $<"
$(KEGEXEC) $(EMACS) --batch \
--eval "(byte-compile-file \"org-clock-convenience.el\")"
test: org-clock-convenience.elc
@echo "Emacs binary at $(shell which $(EMACS))"
$(KEGEXEC) $(EMACS) --batch \
$(loadinit) \
-l org-clock-convenience.elc \
-l test/test-org-clock-convenience.el \
$(loadconf) \
--eval "(princ (format \"Emacs version: %s\n\" (emacs-version)) t)" \
--eval "(princ (format \"Org version: %s\n\" (org-version)) t)" \
--eval "(ert-run-tests-batch-and-exit nil)"
debug:
$(KEGEXEC) $(EMACS) -q \
$(loadinit) \
-l org-clock-convenience.el \
-l test/test-org-clock-convenience.el \
$(loadconf) \
--eval "(progn (setq occ-no-cleanup t)$(testcmd))"
test-regx:
$(KEGEXEC) $(EMACS) --batch \
$(loadinit) \
-l org-clock-convenience.el \
-l test/test-org-clock-convenience.el \
$(loadconf) \
--eval "(occ-print-all-agendaline-vals)"
clean:
rm -f org-clock-convenience.elc
@if test x"${KEGEXEC}" != x; then \
$(KEG) clean; \
fi