summary refs log tree commit diff stats
path: root/emacs/.emacs.d/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/.emacs.d/Makefile')
-rw-r--r--emacs/.emacs.d/Makefile22
1 files changed, 22 insertions, 0 deletions
diff --git a/emacs/.emacs.d/Makefile b/emacs/.emacs.d/Makefile
new file mode 100644
index 0000000..3d965e4
--- /dev/null
+++ b/emacs/.emacs.d/Makefile
@@ -0,0 +1,22 @@
+define EMACS_TANGLE
+(progn\
+  (setq vc-follow-symlinks nil)\
+  (find-file \"init.org\")\
+  (require 'ob-tangle)\
+  (org-babel-tangle nil \"init.el\"))
+endef
+
+# The first target is the default.  `all` is typically defined here.
+all: init.elc
+
+# These targets don't pertain to files
+.PHONY: all clean
+
+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