Refactor Makefile

This commit is contained in:
Henrik Lissner 2017-06-05 17:36:22 +02:00
parent 1906de46e8
commit 3d42291314
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -2,43 +2,43 @@
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'))
TESTS=$(shell find test/ -type f -name 'test-*.el')
# Tasks
all: autoloads autoremove install update
install: init.el .local/autoloads.el
@$(EMACS) -f 'doom/packages-install'
@$(EMACS) -f doom/packages-install
update: init.el .local/autoloads.el
@$(EMACS) -f 'doom/packages-update'
@$(EMACS) -f doom/packages-update
autoremove: init.el .local/autoloads.el
@$(EMACS) -f 'doom/packages-autoremove'
@$(EMACS) -f doom/packages-autoremove
autoloads: init.el
@$(EMACS) -f 'doom/reload-autoloads'
@$(EMACS) -f doom/reload-autoloads
recompile: init.el
@$(EMACS) -f 'doom/recompile'
@$(EMACS) -f doom/recompile
compile: init.el clean
@$(EMACS) -f 'doom/compile'
@$(EMACS) -f doom/compile
compile-lite: init.el clean
@$(EMACS) -f 'doom/compile-lite'
@$(EMACS) -f doom/compile-lite
clean:
@$(EMACS) -f 'doom/clean-compiled'
@$(EMACS) -f doom/clean-compiled
clean-cache:
@$(EMACS) -f 'doom/clean-cache'
@$(EMACS) -f doom/clean-cache
test: init.el .local/autoloads.el
@$(TEST_EMACS) $(TESTS) -f 'ert-run-tests-batch-and-exit'
@$(TEST_EMACS) $(patsubst %,-l %, $(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'
$(TESTS): init.el .local/autoloads.el
@$(TEST_EMACS) $(patsubst %,-l %, $@) -f ert-run-tests-batch-and-exit
doctor:
@./bin/doctor
@ -48,7 +48,7 @@ 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'
@$(EMACS) -f doom-initialize-autoloads
.PHONY: all test
.PHONY: all test $(TESTS)