2015-07-08 15:21:41 +02:00
|
|
|
EMACS = cask exec emacs
|
2015-12-18 21:04:12 +01:00
|
|
|
EARGS = -Q -batch -l package -L site-lisp/
|
2015-07-08 12:38:23 +02:00
|
|
|
|
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))) \
|
2016-01-08 11:41:05 +01:00
|
|
|
site-lisp/circe-init.elc site-lisp/lui-init.elc
|
2015-10-03 00:19:21 +02:00
|
|
|
|
2015-07-08 15:21:41 +02:00
|
|
|
.PHONY: all site-lisp snippets
|
2015-10-03 00:19:21 +02:00
|
|
|
all: init2.elc init.elc $(AUTOLOADS_FILE) $(SITE_LISPS) snippets
|
2015-07-08 15:21:41 +02:00
|
|
|
|
|
|
|
### Init
|
2014-08-21 00:23:56 +02:00
|
|
|
|
|
|
|
%.elc: %.el
|
2016-02-08 00:59:02 +01:00
|
|
|
@echo -e "\e[31mELC\e[0m $<"
|
2015-07-08 15:21:41 +02:00
|
|
|
@$(EMACS) $(EARGS) -eval "(byte-compile-file \"$<\")"
|
2014-08-21 00:23:56 +02:00
|
|
|
|
2015-10-03 00:39:52 +02:00
|
|
|
define tangle=
|
2016-02-08 00:59:02 +01:00
|
|
|
@echo -e "\e[35mOBT\e[0m $<"
|
2015-07-08 15:21:41 +02:00
|
|
|
@$(EMACS) $(EARGS) -l "ob-tangle" \
|
2016-04-13 15:34:29 +02:00
|
|
|
-eval "(progn \
|
|
|
|
(setq org-id-locations-file \
|
|
|
|
(concat user-emacs-directory \"data/org-id-locations\")) \
|
|
|
|
(org-babel-tangle-file \"$<\"))"
|
2015-10-03 00:39:52 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
init.el: init2.el
|
|
|
|
init2.el: init.org
|
|
|
|
$(call tangle)
|
|
|
|
|
2016-01-08 11:41:05 +01:00
|
|
|
site-lisp/%-init.el: init-%.org
|
2015-10-03 00:39:52 +02:00
|
|
|
$(call tangle)
|
2015-07-08 15:21:41 +02:00
|
|
|
|
|
|
|
### Site Lisp
|
|
|
|
|
|
|
|
$(AUTOLOADS_FILE): $(SITE_LISPS)
|
2016-02-08 00:59:02 +01:00
|
|
|
@echo -e "\e[32mGEN\e[0m $@"
|
2015-07-08 15:21:41 +02:00
|
|
|
@$(EMACS) $(EARGS) \
|
2015-07-08 12:38:23 +02:00
|
|
|
-eval "(setq generated-autoload-file \"$(CURDIR)/$@\")" \
|
|
|
|
-eval "(update-directory-autoloads \"$(CURDIR)/site-lisp/\")"
|
|
|
|
|
2015-07-08 15:21:41 +02:00
|
|
|
### Snippets
|
|
|
|
|
|
|
|
SNIPPET_DIRS = $(wildcard snippets/*)
|
|
|
|
COMPILED_SNIPPETS = $(addsuffix /.yas-compiled-snippets.el, $(SNIPPET_DIRS))
|
|
|
|
|
|
|
|
%/.yas-compiled-snippets.el: %/*
|
2016-02-08 00:59:02 +01:00
|
|
|
@echo -e "\e[36mYAS\e[0m $(CURDIR)/snippets"
|
2015-12-17 09:39:17 +01:00
|
|
|
@$(EMACS) $(EARGS) -l yasnippet \
|
2015-07-08 15:21:41 +02:00
|
|
|
-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
|
2015-07-08 15:21:41 +02:00
|
|
|
$(EMACS) $(EARGS) --visit packages/rudel/rudel-compile.el \
|
2014-08-21 00:23:56 +02:00
|
|
|
--eval "(eval-buffel)"
|
|
|
|
|
2015-07-08 15:21:41 +02:00
|
|
|
### Cleanup
|
|
|
|
|
2015-07-08 12:38:23 +02:00
|
|
|
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/*.*
|
|
|
|
|
2015-07-08 12:38:23 +02:00
|
|
|
clean: clean-export clean-byte-compiled clean-generated
|
|
|
|
|
2015-07-08 15:21:41 +02:00
|
|
|
### HTML Export
|
|
|
|
|
2015-07-08 12:38:23 +02:00
|
|
|
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
|