forked from DamienCassou/vdirel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (52 loc) · 1.75 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
CASK ?= cask
EMACS ?= emacs
DIST ?= dist
EMACSFLAGS = --batch -Q
EMACSBATCH = $(EMACS) $(EMACSFLAGS)
VERSION := $(shell EMACS=$(EMACS) $(CASK) version)
PKG_DIR := $(shell EMACS=$(EMACS) $(CASK) package-directory)
PROJ_ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
EMACS_D = ~/.emacs.d
USER_ELPA_D = $(EMACS_D)/elpa
SRCS = $(filter-out %-autoloads.el, $(filter-out %-pkg.el, $(wildcard *.el)))
EXAMPLES = $(wildcard examples/*.el)
TESTS = $(wildcard test/*.el)
TAR = $(DIST)/vdirel-$(VERSION).tar
.PHONY: all check test unit lint ecukes deps install uninstall reinstall clean-all clean clean-elc
all : deps $(TAR)
deps :
$(CASK) install
install : $(TAR)
$(EMACSBATCH) -l package -f package-initialize \
--eval '(package-install-file "$(PROJ_ROOT)/$(TAR)")'
uninstall :
rm -rf $(USER_ELPA_D)/vdirel-*
reinstall : clean uninstall install
clean-all : clean
rm -rf $(PKG_DIR)
clean-elc :
rm -f *.elc test/*.elc examples/*.elc
clean : clean-elc
rm -rf $(DIST)
rm -f *-pkg.el
$(TAR) : $(DIST) $(SRCS)
$(CASK) package $(DIST)
$(DIST) :
mkdir $(DIST)
check : test lint
test: unit
unit: $(PKG_DIR) clean-elc
${CASK} exec buttercup -L .
lint : $(SRCS) clean-elc
# Byte compile all and stop on any warning or error
${CASK} emacs $(EMACSFLAGS) \
--eval "(setq byte-compile-error-on-warn t)" \
-L . -f batch-byte-compile ${SRCS} ${EXAMPLES} ${TESTS}
# Run package-lint to check for packaging mistakes
${CASK} emacs $(EMACSFLAGS) \
--eval "(require 'package)" \
--eval "(push '(\"melpa\" . \"http://melpa.org/packages/\") package-archives)" \
--eval "(package-initialize)" \
--eval "(package-refresh-contents)" \
-l package-lint.el \
-f package-lint-batch-and-exit ${SRCS}