Subject: [StGit PATCH 04/17] Emacs mode: Makefile for building stgit.el

From: David Kågedal <[email-masked]>
Date: Fri, 14 Dec 2007 11:57:00 +0100

From: Karl Hasselström <[email-masked]>

Shamelessly stolen from git's contrib/emacs/Makefile.

Signed-off-by: Karl Hasselström <[email-masked]>
Signed-off-by: David Kågedal <[email-masked]>
---

 contrib/Makefile |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
 create mode 100644 contrib/Makefile

diff --git a/contrib/Makefile b/contrib/Makefile
new file mode 100644
index 0000000..8556910
--- /dev/null
+++ b/contrib/Makefile
@@ -0,0 +1,19 @@
+EMACS = emacs
+
+ELC = stgit.elc
+INSTALL ?= install
+INSTALL_ELC = $(INSTALL) -m 644
+prefix ?= $(HOME)
+emacsdir = $(prefix)/share/emacs/site-lisp
+RM ?= rm -f
+
+all: $(ELC)
+
+install: all
+	$(INSTALL) -d $(DESTDIR)$(emacsdir)
+	$(INSTALL_ELC) $(ELC:.elc=.el) $(ELC) $(DESTDIR)$(emacsdir)
+
+%.elc: %.el
+	$(EMACS) -batch -f batch-byte-compile $<
+
+clean:; $(RM) $(ELC)