Update Makefile for plugins installation
authorJF Ding <jian-feng.ding@intel.com>
Wed, 10 Aug 2011 03:47:24 +0000 (11:47 +0800)
committerJF Ding <jian-feng.ding@intel.com>
Wed, 10 Aug 2011 03:47:24 +0000 (11:47 +0800)
Makefile
tools/micng [changed mode: 0644->0755]

index 23a4b5c..c4fa678 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,26 +4,36 @@ TAGVER = $(shell cat VERSION | sed -e "s/\([0-9\.]*\).*/\1/")
 
 PKGNAME = micng
 
+PLUGIN_DIR = /usr/lib/micng/plugins
+
 ifeq ($(VERSION), $(TAGVER))
        TAG = $(TAGVER)
 else
        TAG = "HEAD"
 endif
 
+ifndef PREFIX
+    PREFIX = "/usr/local"
+endif
 
 all:
        $(PYTHON) setup.py build
 
 dist-bz2:
-       git archive --format=tar --prefix=$(PKGNAME)-$(VERSION)/ $(TAG) | \
-               bzip2  > $(PKGNAME)-$(VERSION).tar.bz2
+       git archive --format=tar --prefix=$(PKGNAME)-$(TAGVER)/ $(TAG) | \
+               bzip2  > $(PKGNAME)-$(TAGVER).tar.bz2
 
 dist-gz:
-       git archive --format=tar --prefix=$(PKGNAME)-$(VERSION)/ $(TAG) | \
-               gzip  > $(PKGNAME)-$(VERSION).tar.gz
+       git archive --format=tar --prefix=$(PKGNAME)-$(TAGVER)/ $(TAG) | \
+               gzip  > $(PKGNAME)-$(TAGVER).tar.gz
+
+install-plugins:
+       install -d ${DESTDIR}/${PLUGIN_DIR}
+       install -D -m 644 plugins/imager/* ${DESTDIR}/${PLUGIN_DIR}/imager
+       install -D -m 644 plugins/backend/* ${DESTDIR}/${PLUGIN_DIR}/backend
 
-install: all
-       $(PYTHON) setup.py install --root=${DESTDIR}
+install: all install-plugins
+       $(PYTHON) setup.py install  --prefix=$(DESTDIR)/$(PREFIX)
 
 develop: all
        $(PYTHON) setup.py develop
old mode 100644 (file)
new mode 100755 (executable)