legacy-dotfiles/emacs/Makefile

28 lines
816 B
Makefile

EMACS = emacs
files = init.el init.elc eshell-init.el eshell-init.elc
install-files = $(addprefix install-,$(files)) install-loaddefs.el
submodules = eshell
install-submodules = $(addprefix install-,$(submodules))
.PHONY: all $(submodules) install $(install-submodules) $(install-files)
all: loaddefs.el $(files) $(submodules)
$(submodules):
$(MAKE) -C $@/
$(filter %.elc,$(files)): %.elc: %.el
$(EMACS) -batch -eval "(byte-compile-file \"$^\")"
loaddefs.el: $(files)
$(EMACS) -batch -eval "(let ((generated-autoload-file \"${CURDIR}/loaddefs.el\")) \
(update-directory-autoloads \"${CURDIR}\"))"
install: $(install-files) $(install-submodules)
$(install-files): install-%: $*
install -Dm 444 $* ${HOME}/.emacs.d/$*
$(install-submodules): install-%:
$(MAKE) -C $*/ install