legacy-dotfiles/emacs/.emacs.d/Makefile

78 lines
1.8 KiB
Makefile
Raw Normal View History

EMACS = cask exec emacs
EARGS = -Q -batch -l package
2015-10-03 00:19:21 +02:00
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))) \
site-lisp/circe-init.elc
.PHONY: all site-lisp snippets
2015-10-03 00:19:21 +02:00
all: init2.elc init.elc $(AUTOLOADS_FILE) $(SITE_LISPS) snippets
### Init
2014-08-21 00:23:56 +02:00
%.elc: %.el
2015-04-08 15:15:36 +02:00
@echo "ELC $<"
@$(EMACS) $(EARGS) -eval "(byte-compile-file \"$<\")"
2014-08-21 00:23:56 +02:00
define tangle=
2015-04-08 15:15:36 +02:00
@echo "OBT $<"
@$(EMACS) $(EARGS) -l "ob-tangle" \
-eval "(org-babel-tangle-file \"$<\")"
endef
init.el: init2.el
init2.el: init.org
$(call tangle)
site-lisp/circe-init.el: init-circe.org
$(call tangle)
### Site Lisp
$(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
2014-08-21 00:23:56 +02:00
rudel:
git clone git://github.com/scymtym/rudel.git packages/rudel
$(EMACS) $(EARGS) --visit packages/rudel/rudel-compile.el \
2014-08-21 00:23:56 +02:00
--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:
2014-08-21 00:23:56 +02:00
rm -rf _publish/*.*
clean: clean-export clean-byte-compiled clean-generated
### HTML Export
export: clean-export
2015-09-23 15:00:48 +02:00
$(EMACS) $(EARGS) -L $(CURDIR) -l project.el -f org-publish-all
2014-08-21 00:23:56 +02:00
publish: export
rsync -avuz --exclude=*~ --delete _publish/ \
ryuslash.org:public_html/orgweb/dotfiles/emacs