-
Notifications
You must be signed in to change notification settings - Fork 201
/
Copy pathMakefile
82 lines (71 loc) · 2.79 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
73
74
75
76
77
78
79
80
81
82
### Makefile for EGLOT
###
# Variables
#
EMACS?=emacs
SELECTOR?=t
ERROR_ON_WARN=nil
LOAD_PATH=-L .
ELFILES := eglot.el eglot-tests.el
ELCFILES := $(ELFILES:.el=.elc)
ELPADIR := $(shell mktemp -d elpa-eglot-test.XXXXXXXX --tmpdir)
ELPADEPS ?=--eval '(setq package-user-dir "$(ELPADIR)")' \
--eval '(setq package-check-signature nil)' \
--eval '(package-initialize)' \
--eval '(package-refresh-contents)' \
--eval '(defun install-latest (p) \
(let ((desc (cadr \
(assoc p \
package-archive-contents\
(quote equal))))) \
(unless (package-installed-p \
p \
(package-desc-version desc)) \
(package-install desc))))' \
--eval '(install-latest (quote jsonrpc))' \
--eval '(install-latest (quote project))' \
--eval '(install-latest (quote xref))' \
--eval '(install-latest (quote seq))' \
--eval '(install-latest (quote eldoc))' \
--eval '(unintern \
(quote eldoc-documentation-function) nil)' \
--eval '(load "eldoc")' \
--eval '(install-latest (quote company))' \
--eval '(install-latest (quote yasnippet))' \
--eval '(install-latest (quote external-completion))'\
--eval '(install-latest (quote flymake))'
BYTECOMP_ERROR_ON_WARN := \
--eval '(setq byte-compile-error-on-warn $(ERROR_ON_WARN))'
all: compile
# Compilation. Note BYTECOMP_ERROR_ON_WARN after ELPADEPS
# so deps can still warn on compilation.
#
%.elc: %.el
$(EMACS) -Q $(ELPADEPS) $(BYTECOMP_ERROR_ON_WARN) $(LOAD_PATH) \
--batch -f batch-byte-compile $<
compile: $(ELCFILES)
# Automated tests
#
eglot-check: compile
$(EMACS) -Q --batch \
$(ELPADEPS) \
$(LOAD_PATH) \
-l eglot \
-l eglot-tests \
--eval '(setq ert-batch-backtrace-right-margin 200)' \
--eval '(ert-run-tests-batch-and-exit (quote $(SELECTOR)))'
eglot-check-noelpa: ELPADEPS=-f package-initialize
eglot-check-noelpa: eglot-check
interactive: compile
$(EMACS) -Q \
--eval '(setq debug-on-error t)' \
$(ELPADEPS) \
$(LOAD_PATH) \
-l eglot \
-l eglot-tests \
check: eglot-check-noelpa
# Cleanup
#
clean:
find . -iname '*.elc' -exec rm {} \;
.PHONY: all compile clean check