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
|
### 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)
ELPADEPS ?=--eval '(setq package-user-dir (expand-file-name "elpa-eglot-test" temporary-file-directory))' \
--eval '(package-initialize)' \
--eval '(package-refresh-contents)' \
--eval '(defun install-latest (p) \
(package-install \
(cadr (assoc p \
package-archive-contents \
(quote equal)))))' \
--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))' \
--eval '(load "eldoc")' \
--eval '(install-latest (quote company))' \
--eval '(install-latest (quote yasnippet))' \
--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 \
$(ELPADEPS) \
$(LOAD_PATH) \
-l eglot \
-l eglot-tests \
check: eglot-check-noelpa
# Cleanup
#
clean:
find . -iname '*.elc' -exec rm {} \;
.PHONY: all compile clean check
|