legacy-dotfiles/emacs/.emacs.d/Makefile
Tom Willemse 668c80ccc7 Compile snippets and improve site-lisp compilation
Files can't be left out from being compiled anymore.

Even though the snippet rules depend on every
`.yas-compiled-snippets.el' separately, when the first is compiled, the
rest don't need to anymore.
2015-07-08 15:21:41 +02:00

71 lines
1.7 KiB
Makefile

EMACS = cask exec emacs
EARGS = -Q -batch -l package
.PHONY: all site-lisp snippets
all: init2.elc init.elc site-lisp/site-autoloads.el snippets
### Init
%.elc: %.el
@echo "ELC $<"
@$(EMACS) $(EARGS) -eval "(byte-compile-file \"$<\")"
init.el: init2.el
init2.el: init.org org/intro.org
@echo "OBT $<"
@$(EMACS) $(EARGS) -l "ob-tangle" \
-eval "(org-babel-tangle-file \"init.org\")"
### Site Lisp
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)))
$(AUTOLOADS_FILE): $(SITE_LISPS)
@echo "GEN $@"
@$(EMACS) $(EARGS) \
-eval "(setq generated-autoload-file \"$(CURDIR)/$@\")" \
-eval "(update-directory-autoloads \"$(CURDIR)/site-lisp/\")"
### Snippets
SNIPPET_DIRS = $(wildcard snippets/*)
COMPILED_SNIPPETS = $(addsuffix /.yas-compiled-snippets.el, $(SNIPPET_DIRS))
%/.yas-compiled-snippets.el: %/*
$(EMACS) $(EARGS) -l yasnippet \
-eval "(yas-compile-directory \"$(CURDIR)/snippets\")"
snippets: $(COMPILED_SNIPPETS)
### Packages
rudel:
git clone git://github.com/scymtym/rudel.git packages/rudel
$(EMACS) $(EARGS) --visit packages/rudel/rudel-compile.el \
--eval "(eval-buffel)"
### Cleanup
clean-byte-compiled:
rm -f $(SITE_LISPS) init2.elc init.elc
clean-autoloads:
rm -f site-lisp/site-autoloads.el init2.el
clean-export:
rm -rf _publish/*.*
clean: clean-export clean-byte-compiled clean-generated
### HTML Export
export: clean-export
emacs -L $(CURDIR) -L ~/.emacs.d/vendor-lisp/org/lisp \
-L ~/.emacs.d/vendor-lisp/org/contrib/lisp -batch -l project.el \
-f org-publish-all
publish: export
rsync -avuz --exclude=*~ --delete _publish/ \
ryuslash.org:public_html/orgweb/dotfiles/emacs