summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--emacs/.emacs.d/Makefile19
-rwxr-xr-xhooks/post-up/emacs17
2 files changed, 19 insertions, 17 deletions
diff --git a/emacs/.emacs.d/Makefile b/emacs/.emacs.d/Makefile
new file mode 100644
index 0000000..fd51e39
--- /dev/null
+++ b/emacs/.emacs.d/Makefile
@@ -0,0 +1,19 @@
+define EMACS_TANGLE
+(progn\
+  (setq vc-follow-symlinks nil)\
+  (find-file \"init.org\")\
+  (require 'ob-tangle)\
+  (org-babel-tangle nil \"init.el\"))
+endef
+
+all: init.elc
+.PHONY: all
+
+init.el:
+	@emacs --batch --no-init-file --eval "$(EMACS_TANGLE)" --kill
+
+init.elc: init.el
+	@emacs --batch --no-init-file --funcall batch-byte-compile init.el
+
+clean:
+	rm init.el init.elc
diff --git a/hooks/post-up/emacs b/hooks/post-up/emacs
deleted file mode 100755
index 05a5c9d..0000000
--- a/hooks/post-up/emacs
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-EMACS_COMMAND=$(command -v Emacs || command -v emacs)
-
-if [[ -s $EMACS_COMMAND ]]
-then
-  pushd ~/.emacs.d
-  emacs --batch --eval "(progn
-(setq vc-follow-symlinks nil)
-(find-file \"init.org\")
-(require 'ob-tangle)
-(org-babel-tangle nil \"init.el\")
-(byte-compile-file \"init.el\")
-(load-file \"init.el\")
-)"
-  popd
-fi