aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2020-05-15 22:54:48 -0400
committerKyle Meyer <kyle@kyleam.com>2020-05-15 23:18:56 -0400
commitb454f2c4c493b3edaefd6575bbce70cb52b4ad6e (patch)
tree1b3085ba1f8bbb1c93db34b0ab080225d75daf4b
parentdf116c73561cfb28e9d30e7b85eb4654a05ac901 (diff)
downloadpiem-b454f2c4c493b3edaefd6575bbce70cb52b4ad6e.tar.gz
Makefile: Try to be more portable
This is my attempt to follow Chris Wellons's recommendations [*]. I'm not sure how successful it is, but GNU make and bmake (from Debian) seem happy. [*] https://nullprogram.com/blog/2017/08/20/ https://nullprogram.com/blog/2020/01/22/
-rw-r--r--.gitignore1
-rw-r--r--Makefile31
2 files changed, 16 insertions, 16 deletions
diff --git a/.gitignore b/.gitignore
index 29ad95c..a83b8f4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,3 @@
*-autoloads.el
*.elc
*.info
-config.mk
diff --git a/Makefile b/Makefile
index f71fc68..9080f76 100644
--- a/Makefile
+++ b/Makefile
@@ -1,24 +1,23 @@
+.POSIX:
--include config.mk
-
+EMACS = emacs
# Rely on EMACSLOADPATH for everything but the current directory.
-BATCH = emacs -Q --batch -L .
+BATCH = $(EMACS) --batch -Q -L .
+
+EL = piem.el piem-b4.el piem-elfeed.el piem-eww.el piem-gnus.el \
+ piem-notmuch.el
+ELC = $(EL:.el=.elc)
-all: loadpath piem.info piem.elc \
- piem-b4.elc piem-elfeed.elc piem-eww.elc \
- piem-gnus.elc piem-notmuch.elc
+all: compile piem.info piem-autoloads.el
+
+compile: $(ELC)
piem-autoloads.el:
$(BATCH) -l package --eval \
'(package-generate-autoloads "piem" default-directory)'
-.PHONY: clean
clean:
- $(RM) *.elc *-autoloads.el *.info
-
-.PHONY: loadpath
-loadpath:
- @echo ";;; EMACSLOADPATH=$(EMACSLOADPATH)"
+ rm -f piem.info piem-autoloads.el $(ELC)
piem-b4.elc: piem-b4.el piem.elc
piem-elfeed.elc: piem-elfeed.el piem.elc
@@ -27,8 +26,10 @@ piem-gnus.elc: piem-gnus.el piem.elc
piem-notmuch.elc: piem-notmuch.el piem.elc
piem.elc: piem.el
-%.info: %.texi
- makeinfo $<
+.SUFFIXES: .el .elc .texi .info
-%.elc: %.el
+.el.elc:
$(BATCH) -f batch-byte-compile $<
+
+.texi.info:
+ makeinfo $<