forked from emacs-lsp/lsp-mode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
80 lines (62 loc) · 1.61 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
SHELL := /usr/bin/env bash
EMACS ?= emacs
CASK ?= cask
INIT="(progn \
(require 'package) \
(push '(\"melpa\" . \"https://melpa.org/packages/\") package-archives) \
(package-initialize) \
(package-refresh-contents))"
LINT="(progn \
(unless (package-installed-p 'package-lint) \
(package-install 'package-lint)) \
(require 'package-lint) \
(package-lint-batch-and-exit))"
all:
$(CASK) build
build:
$(CASK) install
# TODO: add 'checkdoc' and 'lint' here when they pass
ci: clean build compile testprereq test
compile:
@echo "Compiling..."
@$(CASK) $(EMACS) -Q --batch \
-L . \
--eval '(setq byte-compile-error-on-warn t)' \
-f batch-byte-compile \
*.el
checkdoc:
$(eval LOG := $(shell mktemp -d)/checklog.log)
@touch $(LOG)
@echo "checking doc..."
@for f in *.el ; do \
$(CASK) $(EMACS) -Q --batch \
-L . \
--eval "(checkdoc-file \"$$f\")" \
*.el 2>&1 | tee -a $(LOG); \
done
@if [ -s $(LOG) ]; then \
echo ''; \
exit 1; \
else \
echo 'checkdoc ok!'; \
fi
lint:
@echo "package linting..."
@$(CASK) $(EMACS) -Q --batch \
-L . \
--eval $(INIT) \
--eval $(LINT) \
*.el
testprereq:
sudo pip install python-language-server
test:
$(CASK) exec ert-runner -t '!no-win' -t '!org'
docs:
make -C docs/ generate
local-webpage: docs
cp -rf README.md examples docs
docker run --rm --volume "`pwd`:/data" --user `id -u`:`id -g` pandoc/core:2.9 -s CHANGELOG.org -t gfm -o docs/page/CHANGELOG.md
docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material
clean:
rm -rf .cask *.elc
.PHONY: all build ci compile checkdoc lint testprereq test docs local-webpage clean