-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (51 loc) · 1.51 KB
/
Copy pathMakefile
File metadata and controls
64 lines (51 loc) · 1.51 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
64
.POSIX:
.PHONY: all compile test clean purge
.SUFFIXES: .el .elc
.INTERMEDIATE: make-readme-markdown.el
RM = rm -f
EMACS = emacs
SRC = autosync-magit.el
BYTEC = $(SRC)c
# Should pull the following dependencies:
# dash
# with-editor
# magit-section
DEPS := cl-lib magit
PKGCACHE := $(abspath $(PWD)/package-cache)
# INIT_PACKAGES from package-lint (https://github.com/purcell/package-lint)
# Copyrights: Steve Purcell (https://github.com/purcell)
INIT_PACKAGES="(progn \
(require 'package) \
(setq package-user-dir \"$(PKGCACHE)\") \
(push '(\"nongnu\" . \"https://elpa.nongnu.org/nongnu/\") package-archives) \
(push '(\"gnu\" . \"https://elpa.gnu.org/packages/\") package-archives) \
(package-initialize) \
(dolist (pkg '(${DEPS})) \
(unless (package-installed-p pkg) \
(unless (assoc pkg package-archive-contents) \
(package-refresh-contents)) \
(package-install pkg))) \
(unless package-archive-contents (package-refresh-contents)) \
)"
BATCH = $(EMACS) -Q --batch --eval $(INIT_PACKAGES)
all: compile
compile: $(BYTEC)
test: $(BYTEC)
@echo "Testing $<"
$(BATCH) \
-L . \
-l autosync-magit-tests.el \
-f ert-run-tests-batch-and-exit
purge: clean
$(RM) -r $(PKGCACHE)
clean:
$(RM) $(BYTEC)
README.md: make-readme-markdown.el $(SRC)
$(EMACS) -Q --script $< <$(SRC) >$@
make-readme-markdown.el:
curl -L -o $@ https://raw.github.com/mgalgs/make-readme-markdown/master/make-readme-markdown.el
.el.elc:
@echo "Compiling $<"
@$(BATCH) \
-L . \
-f batch-byte-compile $<