doomemacs/Makefile

94 lines
2 KiB
Makefile
Raw Normal View History

# 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 -L modules/ -maxdepth 2 -type d))
2017-06-29 02:40:29 +02:00
all: autoloads autoremove install
2016-05-29 00:40:13 -04:00
2017-11-05 17:16:13 +01:00
## Shortcuts
a: autoloads
i: install
u: update
r: autoremove
c: compile
2017-09-22 21:39:31 +02:00
cc: compile-core
ce: compile-elpa
## Package management
2017-04-05 21:43:02 -04:00
install: init.el .local/autoloads.el
@$(EMACS) -f doom//packages-install
2017-04-05 21:43:02 -04:00
update: init.el .local/autoloads.el
@$(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
@$(EMACS) -f doom//packages-autoremove
autoloads: init.el
@$(EMACS) -f doom//reload-autoloads
2016-03-25 13:37:48 -04:00
## Byte compilation
# compile
2017-09-22 21:39:31 +02:00
# compile-core
# compile-module
# compile-module/submodule
2017-02-11 00:46:42 -05:00
compile: init.el clean
@$(EMACS) -f doom//byte-compile
2017-09-22 21:39:31 +02:00
compile-core: init.el clean
@$(EMACS) -f doom//byte-compile-core
2017-02-02 21:56:52 -05:00
2017-09-22 21:39:31 +02:00
compile-elpa: init.el
@$(EMACS) -f doom//byte-recompile-plugins
2017-09-22 21:39:31 +02:00
$(patsubst %, compile-%, $(MODULES)): init.el .local/autoloads.el
2017-11-07 13:08:19 +01:00
@$(EMACS) -f doom//byte-compile -- $(patsubst compile-%, %, $@)
recompile: init.el
2017-11-07 13:08:19 +01:00
@$(EMACS) -f doom//byte-compile -- -r
2016-04-08 01:44:10 -04:00
clean:
@$(EMACS) -f doom//clean-byte-compiled-files
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
2017-04-05 21:43:02 -04:00
test: init.el .local/autoloads.el
@$(EMACS) -f doom//run-tests
2017-09-22 21:39:31 +02:00
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
2017-07-09 22:55:06 +02:00
## Utility tasks
# Runs Emacs from a different folder than ~/.emacs.d
run:
@$(EMACSI) -l init.el
2017-07-09 22:55:06 +02:00
# Diagnoses potential OS/environment issues
doctor:
2017-11-05 17:16:13 +01:00
@bin/doom-doctor
2018-02-10 17:27:15 -05:00
# Prints debug info about your current setup
info:
@$(EMACS) -l core/autoload/debug.el -f doom/info
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-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
.PHONY: all compile test testi clean