-
Notifications
You must be signed in to change notification settings - Fork 43
/
Makefile
54 lines (40 loc) · 1.59 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
.POSIX:
EMACS = emacs
EVAL := $(EMACS) --eval
MU4E = /opt/homebrew/share/emacs/site-lisp/mu/mu4e
ELISP = mu4e-dashboard.el
PKGDIR := .
# Additional emacs loadpath
LOADPATH := -L $(PKGDIR)
# Prefer emacs config folder in XDG_CONFIG_HOME to ~/.emacs.d
# Assume emacs-user-directory is ~/.emacs.d
# Try to find ELPA directory or STRAIGHT directory.
XDG_ELPA_DIR := $(if $(XDG_CONFIG_HOME), $(XDG_CONFIG_HOME)/emacs/elpa, $(HOME)/.config/emacs/elpa)
ELPA_DIR := $(if $(shell test -d $(XDG_ELPA_DIR)), $(XDG_ELPA_DIR), $(HOME)/.emacs.d/elpa)
XDG_STRAIGHT_DIR := $(if $(XDG_CONFIG_HOME), $(XDG_CONFIG_HOME)/emacs/straight/build, $(HOME)/.config/emacs/straight/build)
STRAIGHT_DIR := $(if $(shell test -d $(XDG_STRAIGHT_DIR)), $(XDG_STRAIGHT_DIR), $(HOME)/.emacs.d/straight/build)
ASYNC_ELPA_DIR = $(shell \
test -d $(ELPA_DIR) && \
find -L $(ELPA_DIR) -maxdepth 1 -regex '.*/async-[.0-9]*' 2> /dev/null | \
sort | tail -n 1)
ifneq "$(ASYNC_ELPA_DIR)" ""
LOADPATH += -L $(ASYNC_ELPA_DIR)
endif
ASYNC_STRAIGHT_DIR = $(shell \
test -d $(STRAIGHT_DIR) && \
find -L $(STRAIGHT_DIR) -maxdepth 1 -regex '.*/async' 2> /dev/null | \
sort | tail -n 1)
ifneq "$(ASYNC_STRAIGHT_DIR)" ""
LOADPATH += -L $(ASYNC_STRAIGHT_DIR)
endif
all: lints $(ELISP:.el=.elc)
lints: checkdoc
checkdoc:
for f in $(ELISP); do $(EMACS) -batch -Q --eval "(checkdoc-file \"$$f\")"; done
check: all
srcdir=$(PWD) $(EMACS) -batch -Q $(LOADPATH) -L $(MU4E) -l test/regression-tests.el -f ert-run-tests-batch
clean:
rm -f $(ELISP:.el=.elc)
.SUFFIXES: .el .elc
.el.elc:
$(EMACS) -batch -Q $(LOADPATH) -L . -L $(MU4E) -f batch-byte-compile $<