2017-02-06 18:00:34 -05:00
|
|
|
# Ensure emacs always runs from this makefile's PWD
|
2018-03-24 15:53:56 -04:00
|
|
|
EMACS = emacs -q --eval "(setq user-emacs-directory default-directory load-prefer-newer t)"
|
2018-03-12 13:26:34 -04:00
|
|
|
DOOM = $(EMACS) --batch -l init.el
|
|
|
|
DOOMI = $(subst --batch,,$(DOOM))
|
2017-06-14 20:26:17 +02:00
|
|
|
|
2018-03-12 13:26:34 -04:00
|
|
|
MODULES = $(patsubst modules/%/, %, $(sort $(dir $(wildcard modules/*/ modules/*/*/))))
|
2017-02-06 18:00:34 -05:00
|
|
|
|
2018-03-12 13:26:34 -04:00
|
|
|
all: | autoloads autoremove install
|
2016-05-29 00:40:13 -04:00
|
|
|
|
2017-11-05 17:16:13 +01:00
|
|
|
## Shortcuts
|
2017-09-15 14:34:43 +02:00
|
|
|
a: autoloads
|
|
|
|
i: install
|
|
|
|
u: update
|
|
|
|
r: autoremove
|
|
|
|
c: compile
|
2017-09-22 21:39:31 +02:00
|
|
|
cc: compile-core
|
|
|
|
ce: compile-elpa
|
2018-03-12 13:26:34 -04:00
|
|
|
d: doctor
|
2017-09-15 14:34:43 +02:00
|
|
|
|
2017-07-09 22:53:50 +02:00
|
|
|
## Package management
|
2018-03-12 13:26:34 -04:00
|
|
|
install: | init.el .local/autoloads.el
|
|
|
|
@$(DOOM) -f doom//packages-install
|
2016-02-26 09:37:20 -05:00
|
|
|
|
2018-03-12 13:26:34 -04:00
|
|
|
update: | init.el .local/autoloads.el
|
|
|
|
@$(DOOM) -f doom//packages-update
|
2016-03-25 13:37:48 -04:00
|
|
|
|
2018-03-12 13:26:34 -04:00
|
|
|
autoremove: | init.el .local/autoloads.el
|
|
|
|
@$(DOOM) -f doom//packages-autoremove
|
2017-02-03 07:58:16 -05:00
|
|
|
|
2018-03-12 13:26:34 -04:00
|
|
|
autoloads: | init.el
|
|
|
|
@$(DOOM) -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
|
2017-09-22 21:39:31 +02:00
|
|
|
# compile-core
|
|
|
|
# compile-module
|
|
|
|
# compile-module/submodule
|
2018-03-12 13:26:34 -04:00
|
|
|
compile: | init.el clean
|
|
|
|
@$(DOOM) -f doom//byte-compile
|
2017-03-25 01:03:02 -04:00
|
|
|
|
2018-03-12 13:26:34 -04:00
|
|
|
compile-core: | init.el clean
|
|
|
|
@$(DOOM) -f doom//byte-compile-core
|
2017-02-02 21:56:52 -05:00
|
|
|
|
2018-03-12 13:26:34 -04:00
|
|
|
compile-elpa: | init.el
|
|
|
|
@$(DOOM) -f doom//byte-recompile-plugins
|
2017-07-19 14:09:29 +02:00
|
|
|
|
2018-03-12 13:26:34 -04:00
|
|
|
$(patsubst %, compile-%, $(MODULES)): | init.el .local/autoloads.el
|
|
|
|
@$(DOOM) -f doom//byte-compile -- $(patsubst compile-%, %, $@)
|
2017-06-07 16:00:01 +02:00
|
|
|
|
2018-03-12 13:26:34 -04:00
|
|
|
recompile: | init.el
|
|
|
|
@$(DOOM) -f doom//byte-compile -- -r
|
2016-04-08 01:44:10 -04:00
|
|
|
|
2017-07-09 22:52:28 +02:00
|
|
|
clean:
|
2018-03-12 13:26:34 -04:00
|
|
|
@$(DOOM) -f doom//clean-byte-compiled-files
|
2017-07-09 22:50:29 +02:00
|
|
|
|
2017-07-09 22:55:06 +02:00
|
|
|
|
|
|
|
## Unit tests
|
|
|
|
# test
|
2017-09-22 21:39:31 +02:00
|
|
|
# test-core
|
|
|
|
# test-module
|
|
|
|
# test-module/submodule
|
2018-03-12 13:26:34 -04:00
|
|
|
test: | init.el .local/autoloads.el
|
|
|
|
@$(DOOM) -f doom//run-tests
|
2017-06-14 20:26:17 +02:00
|
|
|
|
2018-03-12 13:26:34 -04:00
|
|
|
test-core $(patsubst %, test-%, $(MODULES)): | init.el .local/autoloads.el
|
|
|
|
@$(DOOM) -f doom//run-tests -- $(subst test-, , $@)
|
2017-06-14 20:26:17 +02:00
|
|
|
|
|
|
|
# run tests interactively
|
2018-03-12 13:26:34 -04:00
|
|
|
testi: | init.el .local/autoloads.el
|
|
|
|
@$(DOOMI) -f doom//run-tests
|
2017-04-04 22:18:38 -04:00
|
|
|
|
2017-07-09 22:55:06 +02:00
|
|
|
|
|
|
|
## Utility tasks
|
2018-03-02 17:45:15 -05:00
|
|
|
# Runs Emacs from a different folder than ~/.emacs.d; only use this for testing!
|
2017-06-14 20:26:17 +02:00
|
|
|
run:
|
2018-03-15 00:20:40 -04:00
|
|
|
@$(DOOMI) $(ARGS) --eval "(run-hooks 'after-init-hook 'emacs-startup-hook 'window-setup-hook)"
|
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:
|
2018-03-12 13:26:34 -04:00
|
|
|
@$(EMACS) --script bin/doom-doctor
|
2017-05-20 18:15:40 +02:00
|
|
|
|
2018-02-10 17:27:15 -05:00
|
|
|
# Prints debug info about your current setup
|
|
|
|
info:
|
2018-03-20 20:44:59 -04:00
|
|
|
@$(EMACS) --batch -l core/core.el -l core/autoload/debug.el -f doom/info
|
2018-02-10 17:27:15 -05: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:
|
2018-03-12 13:26:34 -04:00
|
|
|
@$(DOOM) -f doom-initialize-autoloads
|
2017-04-05 21:43:02 -04:00
|
|
|
|
2017-11-05 01:23:36 +01:00
|
|
|
.PHONY: all compile test testi clean
|