forked from radian-software/straight.el
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
64 lines (56 loc) · 1.78 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
EMACS ?= emacs
# The order is important for compilation.
for_compile := straight.el bootstrap.el install.el straight-x.el
for_checkdoc := straight.el
for_longlines := $(wildcard *.el *.md *.yml) Makefile
.PHONY: all
all: compile checkdoc toc longlines
.PHONY: compile
compile:
@for file in $(for_compile); do \
echo "[compile] $$file" ;\
$(EMACS) -Q --batch -L . -f batch-byte-compile $$file 2>&1 \
| grep -v "^Wrote" \
| grep . && exit 1 || true ;\
done
.PHONY: checkdoc
checkdoc:
@for file in $(for_checkdoc); do \
echo "[checkdoc] $$file" ;\
$(EMACS) -Q --batch \
--eval "(or (fboundp 'checkdoc-file) (kill-emacs))" \
--eval "(setq sentence-end-double-space nil)" \
--eval "(checkdoc-file \"$$file\")" 2>&1 \
| grep . && exit 1 || true ;\
done
.PHONY: longlines
longlines:
@echo "[longlines] $(for_longlines)"
@for file in $(for_longlines); do \
cat "$$file" \
| sed '/[<]!-- toc -->/,/<!-- tocstop -->/d' \
| sed '/[l]onglines-start/,/longlines-stop/d' \
| grep -E '.{80}' \
| grep -E -v '\[.+\]: (#|http)' \
| sed "s/^/$$file:long line: /" \
| grep . && exit 1 || true ;\
done
.PHONY: toc
toc: README.md
@echo "[toc] $^"
@if command -v markdown-toc >/dev/null; then \
markdown-toc -i $^ ; \
else \
echo " --> markdown-toc missing, skipping" ; \
fi
.PHONY: clean
clean:
@echo "[clean]" *.elc
@rm -f *.elc
# Make sure to test with a package that supports Emacs 24.4 here.
travis: compile checkdoc longlines
mkdir -p ~/.emacs.d/straight/repos/
ln -s $(PWD) ~/.emacs.d/straight/repos/
$(EMACS) --batch -l ~/.emacs.d/straight/repos/straight.el/bootstrap.el \
--eval "(straight-use-package 'use-package)" \
--eval "(use-package clojure-mode :straight t)"