doomemacs/Makefile
2017-04-17 23:34:08 -04:00

63 lines
1.6 KiB
Makefile

# Ensure emacs always runs from this makefile's PWD
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 %, $(shell find test/ -type f -name 'test-*.el'))
# Tasks
all: autoloads install update
install: init.el .local/autoloads.el
@$(EMACS) -f 'doom/packages-install'
update: init.el .local/autoloads.el
@$(EMACS) -f 'doom/packages-update'
autoremove: init.el .local/autoloads.el
@$(EMACS) -f 'doom/packages-autoremove'
autoloads: init.el
@$(EMACS) -f 'doom/reload-autoloads'
recompile: init.el
@$(EMACS) -f 'doom/recompile'
compile: init.el clean
@$(EMACS) -f 'doom/compile'
compile-lite: init.el clean
@$(EMACS) -f 'doom/compile-lite'
clean:
@$(EMACS) -f 'doom/clean-compiled'
clean-cache:
@$(EMACS) -f 'doom/clean-cache'
test: init.el .local/autoloads.el
@$(TEST_EMACS) $(TESTS) -f 'ert-run-tests-batch-and-exit'
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 .local/autoloads.el
@$(EMACS) --eval "(doom/bootstrap '($(ARGV)))"
init.el:
@[ -e init.el ] || $(error No init.el file; create one or copy init.example.el)
.local/autoloads.el:
@$(EMACS) -f 'doom-initialize-autoloads'
.PHONY: all test bootstrap