Skip to content

Commit 8e305eb

Browse files
authored
Update Makefile
1 parent 0408003 commit 8e305eb

1 file changed

Lines changed: 21 additions & 16 deletions

File tree

Makefile

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
EMACS ?= emacs
2-
ELPA_DIRS := $(shell find ~/.emacs.d/elpa* -maxdepth 0 -type d 2>/dev/null)
3-
LOAD_PATH = -L . $(patsubst %,-L %,$(wildcard $(addsuffix /*,$(ELPA_DIRS))))
42

5-
.PHONY: check compile lint clean
3+
# A space-separated list of required package names
4+
DEPS = tree-mode ivy beacon
65

7-
check: compile lint
6+
INIT_PACKAGES="(progn \
7+
(require 'package) \
8+
(push '(\"melpa\" . \"https://melpa.org/packages/\") package-archives) \
9+
(package-initialize) \
10+
(dolist (pkg '(PACKAGES)) \
11+
(unless (package-installed-p pkg) \
12+
(unless (assoc pkg package-archive-contents) \
13+
(package-refresh-contents)) \
14+
(package-install pkg))) \
15+
)"
816

9-
compile: clean
10-
$(EMACS) --batch $(LOAD_PATH) \
11-
-f batch-byte-compile call-graph.el
17+
all: compile package-lint clean-elc
1218

13-
lint:
14-
$(EMACS) --batch $(LOAD_PATH) \
15-
--eval "(require 'checkdoc)" \
16-
--eval "(require 'package-lint nil t)" \
17-
--eval "(with-current-buffer (find-file-noselect \"call-graph.el\") \
18-
(princ (format \"package-lint: %s\n\" (package-lint-buffer))) \
19-
(princ (format \"checkdoc: %s\n\" (checkdoc-current-buffer t))) \
20-
(kill-buffer))"
19+
package-lint:
20+
${EMACS} -Q --eval $(subst PACKAGES,package-lint,${INIT_PACKAGES}) -batch -f package-lint-batch-and-exit call-graph.el
2121

22-
clean:
22+
compile: clean-elc
23+
${EMACS} -Q --eval $(subst PACKAGES,${DEPS},${INIT_PACKAGES}) -L . -batch -f batch-byte-compile *.el
24+
25+
clean-elc:
2326
rm -f *.elc
27+
28+
.PHONY: all compile clean-elc package-lint

0 commit comments

Comments
 (0)