Makefile (2224B)
1 ### Makefile for EGLOT 2 ### 3 # Variables 4 # 5 EMACS?=emacs 6 SELECTOR=t 7 ERROR_ON_WARN=nil 8 9 LOAD_PATH=-L . 10 11 ELFILES := eglot.el eglot-tests.el 12 ELCFILES := $(ELFILES:.el=.elc) 13 14 ELPADEPS ?=--eval '(package-initialize)' \ 15 --eval '(package-refresh-contents)' \ 16 --eval '(defun install-latest (p) \ 17 (package-install \ 18 (cadr (assoc p \ 19 package-archive-contents \ 20 (quote equal)))))' \ 21 --eval '(install-latest (quote jsonrpc))' \ 22 --eval '(install-latest (quote project))' \ 23 --eval '(install-latest (quote xref))' \ 24 --eval '(install-latest (quote eldoc))' \ 25 --eval '(unintern \ 26 (quote eldoc-documentation-function))' \ 27 --eval '(load "eldoc")' \ 28 --eval '(install-latest (quote company))' \ 29 --eval '(install-latest (quote yasnippet))' \ 30 --eval '(install-latest (quote flymake))' 31 32 BYTECOMP_ERROR_ON_WARN := \ 33 --eval '(setq byte-compile-error-on-warn $(ERROR_ON_WARN))' 34 35 all: compile 36 37 # Compilation. Note BYTECOMP_ERROR_ON_WARN after ELPADEPS 38 # so deps can still warn on compilation. 39 # 40 %.elc: %.el 41 $(EMACS) -Q $(ELPADEPS) $(BYTECOMP_ERROR_ON_WARN) $(LOAD_PATH) \ 42 --batch -f batch-byte-compile $< 43 44 compile: $(ELCFILES) 45 46 # Automated tests 47 # 48 eglot-check: compile 49 $(EMACS) -Q --batch \ 50 $(ELPADEPS) \ 51 $(LOAD_PATH) \ 52 -l eglot \ 53 -l eglot-tests \ 54 --eval '(setq ert-batch-backtrace-right-margin 200)' \ 55 --eval '(ert-run-tests-batch-and-exit (quote $(SELECTOR)))' 56 57 eglot-check-noelpa: ELPADEPS=-f package-initialize 58 eglot-check-noelpa: eglot-check 59 60 interactive: compile 61 $(EMACS) -Q \ 62 $(ELPADEPS) \ 63 $(LOAD_PATH) \ 64 -l eglot \ 65 -l eglot-tests \ 66 67 check: eglot-check-noelpa 68 69 # Cleanup 70 # 71 clean: 72 find . -iname '*.elc' -exec rm {} \; 73 .PHONY: all compile clean check