make installでのインストール先をelispdirとし、デフォルト値を/usr/local/share/emacs/exopen-modeに設定
authorj8takagi <j8takagi@nifty.com>
Wed, 30 Jan 2013 11:39:44 +0000 (20:39 +0900)
committerj8takagi <j8takagi@nifty.com>
Wed, 30 Jan 2013 11:39:44 +0000 (20:39 +0900)
Makefile

index 657a0e5..0b52508 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,22 @@
-TARGETS := exopen-mode.el
-INSTALLDIR := ~/.emacs.d/dev
+prefix ?= /usr/local
+elispdir ?= $(prefix)/share/emacs/site-lisp/exopen-mode
+
+.PHONY: install clean
 
-.PHONY: install
+TARGETS := exopen-mode.el
 
 EMACS := emacs
 COMPILE.el := $(EMACS) -batch -f batch-byte-compile
 INSTALL := install
-INSTALLFLAG :=
 
 $(addsuffix c,$(TARGETS)):
 
 install: $(TARGETS) $(addsuffix c,$(TARGETS))
-       $(INSTALL) $^ $(INSTALLDIR)/
+       $(INSTALL) -d $(elispdir)
+       $(INSTALL) $^ $(elispdir)/
+
+uninstall:
+       $(RM) $(prefix $(elispdir)/,$(TARGETS)) $(suffix c,$(prefix $(elispdir)/,$(TARGETS)))
 
 clean:
        $(RM) *.elc