-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
70 lines (54 loc) · 1.58 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
# Makefile --- Puppet Treesitter Mode for Emacs
CASK := cask
EMACS := emacs
SRCS := $(filter-out %-autoloads.el %-mode-pkg.el, $(shell cask files))
OBJS := $(SRCS:.el=.elc)
CHECKS := $(wildcard test/*-test.el)
PKGDIR := $(shell $(CASK) package-directory)
#
# rules
#
all: compile check lint clean
compile: $(OBJS)
check: $(CHECKS)
clean: $(PKGDIR)
@$(CASK) clean-elc
@$(RM) *-autoloads.el
lint: lint-package lint-elisp
lint-package: $(PKGDIR)
@$(CASK) $(EMACS) --batch \
--eval "(require 'package)" \
--eval "(setq package-archives '((\"melpa\" . \"http://melpa.org/packages/\")))" \
--eval "(package-initialize)" \
--eval "(package-refresh-contents)" \
-L '$(abspath .)' \
-l package-lint -f package-lint-batch-and-exit $(SRCS)
lint-elisp: $(PKGDIR)
@$(CASK) $(EMACS) --batch \
--eval "(require 'package)" \
--eval "(setq package-archives '((\"melpa\" . \"http://melpa.org/packages/\")))" \
--eval "(package-initialize)" \
--eval "(package-refresh-contents)" \
--eval "(setq make-backup-files nil)" \
-L '$(abspath .)' \
-l elisp-lint \
-f elisp-lint-files-batch --no-indent-character --no-fill-column \
$(SRCS)
grammar: $(PKGDIR)
@$(CASK) $(EMACS) --batch \
-L '$(abspath .)' \
-l puppet-ts-mode -f puppet-ts-mode-install-grammar
%.elc: %.el $(PKGDIR)
@$(CASK) build
test/%.el: .FORCE
@$(CASK) $(EMACS) -Q -batch -L '$(abspath .)' -L test \
-l ert -l test/test-helper -l $@ \
-f ert-run-tests-batch-and-exit
$(PKGDIR): Cask
@$(CASK) install
@touch $(PKGDIR)
#
# special targets
#
.FORCE:
.PHONY: all compile check clean lint lint-package lint-elisp grammar