doomemacs/Makefile

71 lines
1.8 KiB
Makefile
Raw Normal View History

# Ensure emacs always runs from this makefile's PWD
2017-04-06 09:43:02 +08:00
EMACS_LIBS=-l core/core.el
EMACS=emacs --batch --eval '(setq user-emacs-directory default-directory)' $(EMACS_LIBS)
TEST_EMACS=$(EMACS) --eval '(setq noninteractive nil)' $(EMACS_LIBS)
TESTS=$(patsubst %,-l %, $(wildcard test/**/test-*.el))
# Tasks
all: autoloads install update
2016-05-29 12:40:13 +08:00
2017-04-06 09:43:02 +08:00
install: init.el .local/autoloads.el
@$(EMACS) -f 'doom/packages-install'
2017-04-06 09:43:02 +08:00
update: init.el .local/autoloads.el
@$(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
@$(EMACS) -f 'doom/packages-autoremove'
autoloads: init.el
2017-03-20 14:44:52 +08:00
@$(EMACS) -f 'doom/reload-autoloads'
2016-03-26 01:37:48 +08:00
recompile: init.el
@$(EMACS) -f 'doom/recompile'
2017-02-11 13:46:42 +08:00
compile: init.el clean
@$(EMACS) -f 'doom/compile'
compile-lite: init.el clean
@$(EMACS) -f 'doom/compile-lite'
2017-02-03 10:56:52 +08:00
clean:
2017-03-20 14:44:52 +08:00
@$(EMACS) -f 'doom/clean-compiled'
2016-04-08 13:44:10 +08:00
clean-cache:
2017-03-20 14:44:52 +08:00
@$(EMACS) -f 'doom/clean-cache'
2017-04-06 09:43:02 +08:00
test: init.el .local/autoloads.el
@$(TEST_EMACS) $(TESTS) -f 'ert-run-tests-batch-and-exit'
2017-04-06 09:43:02 +08:00
test/%: init.el .local/autoloads.el
@$(TEST_EMACS) -l $@.el -f 'ert-run-tests-batch-and-exit'
# Syntactic sugar for bootstrapping modules. Allows: make bootstrap javascript
# See doom/bootstrap for more information.
ifeq (bootstrap,$(firstword $(MAKECMDGOALS)))
ARGV := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(ARGV):;@:)
endif
bootstrap: init.el
@$(EMACS) -f 'doom-initialize-autoloads' --eval "(doom/bootstrap '($(ARGV)))"
2017-02-20 13:45:17 +08:00
# This is only useful if your emacs.d is somewhere other than ~/.emacs.d (for
# development purposes for instance).
run:
2017-03-20 14:44:52 +08:00
@emacs $(EMACS_FLAGS) -q -l init.el
2017-02-20 13:45:17 +08:00
reload:
@$(EMACS) -f 'doom/reload'
2017-01-31 17:31:14 +08:00
init.el:
2017-02-21 02:12:24 +08:00
@[ -e init.el ] || $(error No init.el file; create one or copy init.example.el)
2017-04-06 09:43:02 +08:00
.local/autoloads.el:
@$(EMACS) -f 'doom-initialize-autoloads'
.PHONY: all test bootstrap