ELC := $(filter-out init.elc,$(patsubst %.el,%.elc,$(wildcard *.el */*.el))) EMACSOPT := --eval '(add-to-list (quote load-path) (concat user-emacs-directory "site-lisp"))' EMACSOPT += --eval '(add-to-list (quote load-path) (concat user-emacs-directory "initlibs") t)' EMACSOPT += -l package -f package-initialize .PHONY: all all: $(ELC) # permit the use and setting of undeclared variables and functions: this is # appropriate for user init files, I think, though not for arbitrary .el libs # under ~/.emacs.d init-%.elc: init-%.el emacs -batch $(EMACSOPT) \ --eval '(setq byte-compile-warnings (quote (not free-vars unresolved)))' \ -f batch-byte-compile $< notmuch-private.elc: notmuch-private.el emacs -batch $(EMACSOPT) \ --eval '(setq byte-compile-warnings (quote (not free-vars)))' \ -f batch-byte-compile $< %.elc: %.el emacs -batch $(EMACSOPT) -f batch-byte-compile $< .PHONY: clean clean: rm -f $(ELC)