doomemacs/Makefile

95 lines
2.2 KiB
Makefile
Raw Normal View History

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