aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-12-24 11:36:02 -0500
committerKyle Meyer <kyle@kyleam.com>2015-12-24 11:36:02 -0500
commitaafede3f45b2a7c173a524a52036c95d72468979 (patch)
tree383ffa15bbf0690f463674310d8bbaccea4e5716
parent567263538cd019f6519239ff1c8677825f891044 (diff)
downloadorg-link-edit-aafede3f45b2a7c173a524a52036c95d72468979.tar.gz
Makefile: Simplify
-rw-r--r--Makefile47
1 files changed, 14 insertions, 33 deletions
diff --git a/Makefile b/Makefile
index 5fa0893..cae7a6d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,41 +1,22 @@
-EMACS = emacs -Q --batch
-name = org-link-edit
-main_el := $(name).el
-main_elc = $(main_el)c
-AUTOLOADS_FILE := $(name)-autoloads.el
-all: elc autoloads
+LOAD_PATH ?=
+BATCH = emacs -Q --batch $(LOAD_PATH)
-.PHONY: autoloads
-autoloads: $(AUTOLOADS_FILE)
+all: org-link-edit-autoloads.el org-link-edit.elc
-$(AUTOLOADS_FILE): $(main_el)
- @$(EMACS) --eval \
- "(let (make-backup-files) \
- (update-file-autoloads \"$(CURDIR)/$<\" t \"$(CURDIR)/$@\"))"
+.PHONY: test
+test: org-link-edit.elc
+ @$(BATCH) -L . -l test-org-link-edit \
+ --eval "(ert-run-tests-batch-and-exit '(not (tag interactive)))"
.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: $(main_elc)
- @$(EMACS) -L . -l test-org-link-edit \
- --eval "(ert-run-tests-batch-and-exit '(not (tag interactive)))"
+ $(RM) org-link-edit-autoloads.el org-link-edit.elc
%.elc: %.el
- @$(EMACS) -f batch-byte-compile $<
+ @$(BATCH) -f batch-byte-compile $<
+
+%-autoloads.el: %.el
+ @$(BATCH) --eval \
+ "(let (make-backup-files) \
+ (update-file-autoloads \"$(CURDIR)/$<\" t \"$(CURDIR)/$@\"))"