summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-02-17 01:04:40 -0500
committerKyle Meyer <kyle@kyleam.com>2015-02-17 01:04:40 -0500
commit31c69ad222427851f85c8297bd6d8d1dd8863acf (patch)
tree8aa9dd11e0e2d279d9b58bdced634c95e925266c /Makefile
parent679a8e978afed699d487fe6b74b488aa930927b5 (diff)
downloadbog-31c69ad222427851f85c8297bd6d8d1dd8863acf.tar.gz
Expand Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile52
1 files changed, 42 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index ae2638a..5498024 100644
--- a/Makefile
+++ b/Makefile
@@ -1,18 +1,50 @@
-EMACS := emacs
-CURL := curl --silent
+EMACS = emacs -Q --batch
+CURL = curl --silent
+name = bog
+main_el := $(name).el
+main_elc = $(main_el)c
+AUTOLOADS_FILE := $(name)-autoloads.el
-DASH_URL := https://raw.githubusercontent.com/magnars/dash.el/master/dash.el
+DASH_URL = https://raw.githubusercontent.com/magnars/dash.el/master/dash.el
-.PHONY: test
+all: elc autoloads
+
+.PHONY: autoloads
+autoloads: $(AUTOLOADS_FILE)
+
+$(AUTOLOADS_FILE): $(main_el) .downloads
+ @$(EMACS) -L . --eval \
+ "(let (make-backup-files) \
+ (update-file-autoloads \"$(CURDIR)/$<\" t \"$(CURDIR)/$@\"))"
+
+.PHONY: clean
+clean:
+ $(RM) $(main_elc) $(AUTOLOADS_FILE)
+
+.PHONY: elc
+elc: $(main_elc)
+.PHONY: help
+help:
+ @printf "\nMain targets:\n\n"
+ @printf " all Byte compile and generate autoloads.\n"
+ @printf " autoloads Generate $(AUTOLOADS_FILE).\n"
+ @printf " elc Byte compile $(main_el).\n"
+ @printf "\nOther:\n\n"
+ @printf " clean Remove generated files.\n"
+ @printf " help Print this message.\n"
+ @printf " test Run tests.\n"
+
+.PHONY: test
test: .downloads
- ${EMACS} -Q --batch -L . \
- -l bog-tests \
- --eval "(ert-run-tests-batch-and-exit '(not (tag interactive)))"
+ @$(EMACS) -L . -l bog-tests \
+ --eval "(ert-run-tests-batch-and-exit '(not (tag interactive)))"
+
+%.elc: %.el .downloads
+ @$(EMACS) -L . -f batch-byte-compile $<
+
.downloads:
- ${CURL} ${DASH_URL} > dash.el
+ $(CURL) $(DASH_URL) > dash.el
touch .downloads
-clean:
- @rm -rf *.elc