From b454f2c4c493b3edaefd6575bbce70cb52b4ad6e Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Fri, 15 May 2020 22:54:48 -0400 Subject: 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/ --- .gitignore | 1 - Makefile | 31 ++++++++++++++++--------------- 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 $< -- cgit v1.2.3