forked from doomemacs/doomemacs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
89 lines (65 loc) · 1.94 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Ensure emacs always runs from this makefile's PWD
EMACS_FLAGS=--eval '(setq user-emacs-directory default-directory)' -l core/core.el
EMACS=emacs --quick --batch $(EMACS_FLAGS)
EMACSI=emacs -q $(EMACS_FLAGS)
MODULES=$(patsubst modules/%, %, $(shell find modules/ -maxdepth 2 -type d))
all: autoloads autoremove install
## Shortcuts
a: autoloads
i: install
u: update
r: autoremove
c: compile
cc: compile-core
ce: compile-elpa
## Package management
install: init.el .local/autoloads.el
@$(EMACS) -f doom//packages-install
update: init.el .local/autoloads.el
@$(EMACS) -f doom//packages-update
autoremove: init.el .local/autoloads.el
@$(EMACS) -f doom//packages-autoremove
autoloads: init.el
@$(EMACS) -f doom//reload-autoloads
## Byte compilation
# compile
# compile-core
# compile-module
# compile-module/submodule
compile: init.el clean
@$(EMACS) -f doom//byte-compile
compile-core: init.el clean
@$(EMACS) -f doom//byte-compile-core
compile-elpa: init.el
@$(EMACS) -f doom//byte-recompile-plugins
$(patsubst %, compile-%, $(MODULES)): init.el .local/autoloads.el
@$(EMACS) -f doom//byte-compile -- $(patsubst compile-%, %, $@)
recompile: init.el
@$(EMACS) -f doom//byte-compile -- -r
clean:
@$(EMACS) -f doom//clean-byte-compiled-files
## Unit tests
# test
# test-core
# test-module
# test-module/submodule
test: init.el .local/autoloads.el
@$(EMACS) -f doom//run-tests
test-core $(patsubst %, test-%, $(MODULES)): init.el .local/autoloads.el
@$(EMACS) -f doom//run-tests -- $(subst test-, , $@)
# run tests interactively
testi: init.el .local/autoloads.el
@$(EMACSI) -f doom//run-tests
## Utility tasks
# Runs Emacs from a different folder than ~/.emacs.d
run:
@$(EMACSI) -l init.el
# Diagnoses potential OS/environment issues
doctor:
@bin/doom-doctor
## Internal tasks
init.el:
@$(error No init.el file; create one or copy init.example.el)
.local/autoloads.el:
@$(EMACS) -f doom-initialize-autoloads
.PHONY: all compile test testi clean