-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (48 loc) · 2.1 KB
/
Makefile
File metadata and controls
63 lines (48 loc) · 2.1 KB
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
emacs ?= emacs
FILES := ialign.el
ELC := $(FILES:.el=.elc)
ARGS := --batch -Q
PACKAGE_INIT := -f package-initialize
INSTALL_DEPENDENCIES := ${PACKAGE_INIT} --eval '(progn \
(unless (package-installed-p (quote package-lint)) \
(push (quote ("melpa" . "https://melpa.org/packages/")) package-archives)\
(package-refresh-contents) \
(package-install (quote package-lint))))'
deps:
${emacs} -Q --batch ${INSTALL_DEPENDENCIES}
compile: $(ELC)
%.elc: %.el
${emacs} ${ARGS} -L . \
--eval '(setq byte-compile-error-on-warn t)' \
-f batch-byte-compile $<
# Run emacs -Q with packages installed and ialign loaded
sandbox: ${ELC}
${emacs} -Q -L . -l ialign
%.elc: %.el
${emacs} -Q --batch ${PACKAGE_INIT} -L . \
--eval '(setq byte-compile-error-on-warn t)' \
-f batch-byte-compile $<
%.lint-checkdoc: %.el
@lint=$$(mktemp); \
${emacs} -Q --batch $< \
--eval '(checkdoc-file (buffer-file-name))' 2>&1 | tee $$lint \
&& test -z "$$(cat $$lint)"
%.lint-long-lines: %.el
@sed '1{s/.*//}' $< | grep -n -E "^.{80,}" `# Catch long lines` \
| sed -r 's/^([0-9]+).*/'$<':\1: Too long/;q1';
%.lint-package: %.el
@file=$$(mktemp); \
${emacs} -Q --batch ${PACKAGE_INIT} \
-f 'package-lint-batch-and-exit' $< 2>$$file || true \
&& sed -i "/^Entering directory/d" $$file \
&& cat $$file \
&& test -z "$$(cat $$file)"
%.lint: %.el %.lint-checkdoc %.lint-long-lines %.lint-package
@true
lint: $(patsubst %.el,%.lint,$(filter-out %-test.el,$(FILES)))
update-copyright-years:
year=`date +%Y`; \
sed -i *.el *.org -r \
-e 's/Copyright \(C\) ([0-9]+)(-[0-9]+)?/Copyright (C) \1-'$$year'/'
clean:
rm -f *.elc