aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul W. Rankin <pwr@skeletons.cc>2020-10-20 00:56:51 +1000
committerPaul W. Rankin <pwr@skeletons.cc>2020-10-20 00:58:25 +1000
commit3fd9e4712e6da342a818628246ad9832518ba479 (patch)
treec78b38171e3dd8b8e2e0e35aa8fac13cad5681b2
parent0c412fb64840c8405e657986ed0fe88bf406e9d0 (diff)
downloadbinder-3fd9e4712e6da342a818628246ad9832518ba479.zip
Add Makefile
-rw-r--r--Makefile33
1 files changed, 33 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..62f7951
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,33 @@
+PROGRAM = binder
+LISP_FILE = $(PROGRAM).el
+DEPS = seq package-lint
+NEWS_FILE = NEWS
+VERS = $(shell grep -oE -m1 'Version:[ 0-9.]+' $(LISP_FILE) | tr -d :)
+TAG = $(shell echo $(VERS) | sed -E 's/Version:? ([0-9.]+)/v\1/')
+INIT = '(progn \
+ (require (quote package)) \
+ (push (cons "melpa" "https://melpa.org/packages/") package-archives) \
+ (package-initialize) \
+ (mapc (lambda (pkg) \
+ (unless (package-installed-p pkg) \
+ (unless (assoc pkg package-archive-contents) \
+ (package-refresh-contents)) \
+ (package-install pkg))) \
+ (quote ($(DEPS)))))'
+
+all: check compile
+
+check: $(LISP_FILE)
+ emacs -Q --eval $(INIT) --batch -f package-lint-batch-and-exit $(LISP_FILE)
+
+compile: $(LISP_FILE)
+ emacs -Q --eval $(INIT) -L . --batch -f batch-byte-compile $(LISP_FILE)
+
+tag-release: check compile
+ sed -i~ '1 s/.*/* $(VERS)/' $(NEWS_FILE)
+ git add $(NEWS_FILE)
+ git commit -m 'Update $(NEWS_FILE)'
+ awk '/^* Version/ {v ++ 1} v == 1' $(NEWS_FILE) | sed 's/^* //' | git tag -sF - $(TAG)
+
+clean:
+ rm -f $(PROGRAM).elc