dotfiles/emacs/.emacs.d/GNUmakefile
Tom Willemse 7f5546870c Compile site lisps before main init
This stops Emacs complaining that some file is newer when the main
config depends on it. I don’t add a make dependency between them because
init.el doesn’t need to be recompiled when normal elisp files are
changed. Only when macros are involved.
2016-10-19 21:01:01 +02:00

25 lines
757 B
Makefile

include ../../dotfiles.mk
AUTOLOADS_FILE = site-lisp/site-autoloads.el
UNWANTED = $(AUTOLOADS_FILE) site-lisp/flycheck_% site-lisp/flycheck-%
SITE_LISPS = $(addsuffix c,$(filter-out $(UNWANTED),$(wildcard site-lisp/*.el)))
INIT_LISPS = $(addsuffix .elc,$(basename $(wildcard init/*.org)))
all: $(SITE_LISPS) init.elc $(AUTOLOADS_FILE)
%.el: %.org
$(call tangle,emacs-lisp)
%.elc: %.el
@echo -e "\e[31mELC\e[0m $<"
@$(EMACS) -batch \
-eval "(package-initialize)" \
-eval "(byte-compile-file \"$<\")"
### Site Lisp
$(AUTOLOADS_FILE): $(SITE_LISPS)
@echo -e "\e[32mGEN\e[0m $@"
@$(EMACS) -batch \
-eval "(setq generated-autoload-file \"$(CURDIR)/$@\")" \
-eval "(update-directory-autoloads \"$(CURDIR)/site-lisp/\")"