2017-02-07 07:00:34 +08:00
|
|
|
# Ensure emacs always runs from this makefile's PWD
|
2017-06-15 02:26:17 +08:00
|
|
|
EMACS_FLAGS=--eval '(setq user-emacs-directory default-directory)' -l core/core.el
|
2017-11-07 20:09:24 +08:00
|
|
|
EMACS=emacs --quick --batch $(EMACS_FLAGS)
|
2017-06-15 02:26:17 +08:00
|
|
|
EMACSI=emacs -q $(EMACS_FLAGS)
|
|
|
|
|
|
|
|
MODULES=$(patsubst modules/%, %, $(shell find modules/ -maxdepth 2 -type d))
|
2017-02-07 07:00:34 +08:00
|
|
|
|
2017-06-29 08:40:29 +08:00
|
|
|
all: autoloads autoremove install
|
2016-05-29 12:40:13 +08:00
|
|
|
|
2017-11-06 00:16:13 +08:00
|
|
|
## Shortcuts
|
2017-09-15 20:34:43 +08:00
|
|
|
a: autoloads
|
|
|
|
i: install
|
|
|
|
u: update
|
|
|
|
r: autoremove
|
|
|
|
c: compile
|
2017-09-23 03:39:31 +08:00
|
|
|
cc: compile-core
|
|
|
|
ce: compile-elpa
|
2017-09-15 20:34:43 +08:00
|
|
|
|
2017-07-10 04:53:50 +08:00
|
|
|
## Package management
|
2017-04-06 09:43:02 +08:00
|
|
|
install: init.el .local/autoloads.el
|
2017-11-05 08:23:36 +08:00
|
|
|
@$(EMACS) -f doom//packages-install
|
2016-02-26 22:37:20 +08:00
|
|
|
|
2017-04-06 09:43:02 +08:00
|
|
|
update: init.el .local/autoloads.el
|
2017-11-05 08:23:36 +08:00
|
|
|
@$(EMACS) -f doom//packages-update
|
2016-03-26 01:37:48 +08:00
|
|
|
|
2017-04-06 09:43:02 +08:00
|
|
|
autoremove: init.el .local/autoloads.el
|
2017-11-05 08:23:36 +08:00
|
|
|
@$(EMACS) -f doom//packages-autoremove
|
2017-02-03 20:58:16 +08:00
|
|
|
|
|
|
|
autoloads: init.el
|
2017-11-05 08:23:36 +08:00
|
|
|
@$(EMACS) -f doom//reload-autoloads
|
2016-03-26 01:37:48 +08:00
|
|
|
|
2017-03-29 03:53:47 +08:00
|
|
|
|
2017-07-10 04:53:50 +08:00
|
|
|
## Byte compilation
|
|
|
|
# compile
|
2017-09-23 03:39:31 +08:00
|
|
|
# compile-core
|
|
|
|
# compile-module
|
|
|
|
# compile-module/submodule
|
2017-02-11 13:46:42 +08:00
|
|
|
compile: init.el clean
|
2017-11-05 08:23:36 +08:00
|
|
|
@$(EMACS) -f doom//byte-compile
|
2017-03-25 13:03:02 +08:00
|
|
|
|
2017-09-23 03:39:31 +08:00
|
|
|
compile-core: init.el clean
|
2017-11-05 08:23:36 +08:00
|
|
|
@$(EMACS) -f doom//byte-compile-core
|
2017-02-03 10:56:52 +08:00
|
|
|
|
2017-09-23 03:39:31 +08:00
|
|
|
compile-elpa: init.el
|
2017-11-05 08:23:36 +08:00
|
|
|
@$(EMACS) -f doom//byte-recompile-plugins
|
2017-07-19 20:09:29 +08:00
|
|
|
|
2017-09-23 03:39:31 +08:00
|
|
|
$(patsubst %, compile-%, $(MODULES)): init.el .local/autoloads.el
|
2017-11-07 20:08:19 +08:00
|
|
|
@$(EMACS) -f doom//byte-compile -- $(patsubst compile-%, %, $@)
|
2017-06-07 22:00:01 +08:00
|
|
|
|
2017-07-10 04:53:50 +08:00
|
|
|
recompile: init.el
|
2017-11-07 20:08:19 +08:00
|
|
|
@$(EMACS) -f doom//byte-compile -- -r
|
2016-04-08 13:44:10 +08:00
|
|
|
|
2017-07-10 04:52:28 +08:00
|
|
|
clean:
|
2017-11-05 08:23:36 +08:00
|
|
|
@$(EMACS) -f doom//clean-byte-compiled-files
|
2017-07-10 04:50:29 +08:00
|
|
|
|
2017-07-10 04:55:06 +08:00
|
|
|
|
|
|
|
## Unit tests
|
|
|
|
# test
|
2017-09-23 03:39:31 +08:00
|
|
|
# test-core
|
|
|
|
# test-module
|
|
|
|
# test-module/submodule
|
2017-04-06 09:43:02 +08:00
|
|
|
test: init.el .local/autoloads.el
|
2017-11-05 08:23:36 +08:00
|
|
|
@$(EMACS) -f doom//run-tests
|
2017-06-15 02:26:17 +08:00
|
|
|
|
2017-09-23 03:39:31 +08:00
|
|
|
test-core $(patsubst %, test-%, $(MODULES)): init.el .local/autoloads.el
|
2017-11-05 08:23:36 +08:00
|
|
|
@$(EMACS) -f doom//run-tests -- $(subst test-, , $@)
|
2017-06-15 02:26:17 +08:00
|
|
|
|
|
|
|
# run tests interactively
|
|
|
|
testi: init.el .local/autoloads.el
|
2017-12-11 04:37:18 +08:00
|
|
|
@$(EMACSI) -f doom//run-tests
|
2017-04-05 10:18:38 +08:00
|
|
|
|
2017-07-10 04:55:06 +08:00
|
|
|
|
|
|
|
## Utility tasks
|
|
|
|
# Runs Emacs from a different folder than ~/.emacs.d
|
2017-06-15 02:26:17 +08:00
|
|
|
run:
|
2017-07-07 16:45:01 +08:00
|
|
|
@$(EMACSI) -l init.el
|
2017-04-05 10:18:38 +08:00
|
|
|
|
2017-07-10 04:55:06 +08:00
|
|
|
# Diagnoses potential OS/environment issues
|
2017-05-21 00:15:40 +08:00
|
|
|
doctor:
|
2017-11-06 00:16:13 +08:00
|
|
|
@bin/doom-doctor
|
2017-05-21 00:15:40 +08:00
|
|
|
|
2017-07-10 04:55:06 +08:00
|
|
|
## Internal tasks
|
2017-01-31 17:31:14 +08:00
|
|
|
init.el:
|
2017-07-10 04:55:06 +08:00
|
|
|
@$(error No init.el file; create one or copy init.example.el)
|
2017-02-21 01:20:15 +08:00
|
|
|
|
2017-04-06 09:43:02 +08:00
|
|
|
.local/autoloads.el:
|
2017-06-05 23:36:22 +08:00
|
|
|
@$(EMACS) -f doom-initialize-autoloads
|
2017-04-06 09:43:02 +08:00
|
|
|
|
2017-11-05 08:23:36 +08:00
|
|
|
.PHONY: all compile test testi clean
|