forked from clojure-emacs/cider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
95 lines (73 loc) · 2.1 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
export EMACS ?= emacs
EMACSFLAGS = -L .
CASK = cask
VERSION = $(shell git describe --tags --abbrev=0 | sed 's/^v//')
PKG = cider
ELS_ALL = $(wildcard *.el)
ELS = $(filter-out $(PKG)-autoloads.el,$(ELS_ALL))
OBJECTS = $(ELS:.el=.elc)
.PHONY: elpa build version test lint clean elpaclean autoloads run-$(PKG)
all: build
.depend: $(ELS)
@echo Compute dependencies
@rm -f .depend
@for f in $(ELS); do \
sed -n "s/(require '\(\(cider\|nrepl\)-.*\)).*$$/$${f}c: \1.elc/p" $$f >> .depend;\
done
-include .depend
elpa-$(EMACS):
$(CASK) install
$(CASK) update
touch $@
elpa: elpa-$(EMACS)
autoloads: $(PKG)-autoloads.el
$(PKG)-autoloads.el: $(ELS)
@printf "Generating $@\n"
@printf "%s" "$$LOADDEFS_TMPL" > $@
@$(CASK) exec $(EMACS) -Q --batch -l autoload.el --eval "(progn\
(fset 'message (lambda (&rest _)))\
(setq make-backup-files nil)\
(setq vc-handled-backends nil)\
(setq default-directory (file-truename default-directory))\
(setq generated-autoload-file (expand-file-name \"$@\"))\
(setq find-file-visit-truename t)\
(update-directory-autoloads default-directory))"
build: version elpa autoloads
$(CASK) build
version:
$(EMACS) --version
test: version build
$(CASK) exec buttercup -L . -L ./test/utils/
lint: version elpa
$(CASK) exec $(EMACS) -Q --batch \
--eval "(setq enable-local-variables :safe)" \
-l elisp-lint.el -f elisp-lint-files-batch \
--no-package-format \
--no-fill-column \
$(ELS)
test-all: lint test
clean:
rm -f .depend $(OBJECTS) $(PKG)-autoloads.el
elpaclean: clean
rm -f elpa*
rm -rf .cask # Clean packages installed for development
run-$(PKG): elpa
cask exec $(EMACS) -Q -L . --eval "(require '$(PKG))"
html:
mkdocs build
## Templates #########################################################
define LOADDEFS_TMPL
;;; $(PKG)-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name \
(or (file-name-directory #$$) (car load-path))))
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; $(PKG)-autoloads.el ends here
endef
export LOADDEFS_TMPL
#'