-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (36 loc) · 1.24 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
.PHONY: default compile clean major minor patch tag tests
prefix ?= /usr/local
lispdir?= $(prefix)/share/emacs/site-lisp/homebrew-mode
emacs ?= $(shell which emacs)
inf_ruby ?= /usr/local/share/emacs/site-lisp/inf-ruby/
dash ?= /usr/local/share/emacs/site-lisp/dash-emacs/
BASE_FILE = homebrew-mode.el
LISPS = $(BASE_FILE)
default: compile
compile: $(LISPS)
$(emacs) --batch -Q --directory $(inf_ruby) --directory $(dash) -f batch-byte-compile $<
install: compile
mkdir -p $(lispdir)
install -m 644 $(LISPS) *.elc $(lispdir)
tests:
$(emacs) --batch -Q --load ert --directory $(inf_ruby) --directory $(dash) \
--load homebrew-mode.el --load tests/homebrew-mode-ert.el \
--eval "(ert-run-tests-batch-and-exit '(not (tag interactive)))"
clean:
rm *.elc
temp ?= $(uuid)
major:
HM_VERSION_SHIFT=major build/version.awk $(BASE_FILE) > $(temp).el
rm $(BASE_FILE)
mv $(temp).el $(BASE_FILE)
minor:
HM_VERSION_SHIFT=minor build/version.awk $(BASE_FILE) > $(temp).el
rm $(BASE_FILE)
mv $(temp).el $(BASE_FILE)
patch:
HM_VERSION_SHIFT=patch build/version.awk $(BASE_FILE) > $(temp).el
rm $(BASE_FILE)
mv $(temp).el $(BASE_FILE)
version=$(shell ack -o -m 1 "[0-9]+\.[0-9]+\.[0-9]+" $(BASE_FILE))
tag:
git tag -a $(version) -m "v$(version)"