-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (49 loc) · 1.38 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
.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
REQS := magit
PKGCACHE := $(abspath $(PWD)/package-cache)
# INIT_PACKAGE_EL from package-lint (https://github.com/purcell/package-lint)
# Copyrights: Steve Purcell (https://github.com/purcell)
INIT_PACKAGE_EL := "(progn \
(require 'package) \
(setq package-user-dir \"$(PKGCACHE)\") \
(setq package-archives \
'((\"gnu\" . \"https://elpa.gnu.org/packages/\") \
(\"nongnu\" . \"https://elpa.nongnu.org/nongnu/\"))) \
(package-initialize) \
(unless package-archive-contents \
(package-refresh-contents)) \
(dolist (pkg '($(REQS))) \
(unless (package-installed-p pkg) \
(package-install pkg))))"
BATCH = $(EMACS) -Q --batch --eval $(INIT_PACKAGE_EL)
all: compile
compile: $(BYTEC)
test: $(BYTEC)
$(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 $<