forked from syohex/emacs-hcl-mode
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
46 lines (36 loc) · 1.51 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
EMACS ?= emacs
BATCH_W_ERROR = -batch --eval "(setq byte-compile-error-on-warn t)"
# A space-separated list of required package names
NEEDED_PACKAGES = package-lint
INIT_PACKAGES="(progn \
(require 'package) \
(push '(\"melpa\" . \"https://melpa.org/packages/\") package-archives) \
(package-initialize) \
(dolist (pkg '(${NEEDED_PACKAGES})) \
(unless (package-installed-p pkg) \
(unless (assoc pkg package-archive-contents) \
(package-refresh-contents)) \
(package-install pkg))) \
)"
all: compile-tests test package-lint clean-elc
package-lint:
${EMACS} --eval ${INIT_PACKAGES} $(BATCH_W_ERROR) -f package-lint-batch-and-exit hcl-mode.el
hcl-mode.elc: hcl-mode.el Makefile
${EMACS} $(BATCH_W_ERROR) -f batch-byte-compile $<
test/test-helper.elc: test/test-helper.el hcl-mode.elc
${EMACS} -L . $(BATCH_W_ERROR) -f batch-byte-compile $<
TESTS-EL = test/test-command.el test/test-highlighting.el test/test-indentation.el
TESTS-ELC = test/test-command.elc test/test-highlighting.elc test/test-indentation.elc
$(TESTS-ELC): test/test-helper.elc hcl-mode.elc $(TESTS-EL)
${EMACS} -L . -l test/test-helper.elc $(BATCH_W_ERROR) -f batch-byte-compile test/test-command.el test/test-highlighting.el test/test-indentation.el
compile-tests: $(TESTS-ELC)
test: $(TESTS-ELC)
$(EMACS) -L . -batch \
-l test/test-helper.elc \
-l test/test-indentation.elc \
-l test/test-command.elc \
-l test/test-highlighting.elc \
-f ert-run-tests-batch-and-exit
clean-elc:
rm -f f.elc
.PHONY: all clean-elc package-lint test