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