]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
pynvme: Add install target to Makefile
authorDaniel Wagner <wagi@monom.org>
Tue, 21 Sep 2021 11:55:16 +0000 (13:55 +0200)
committerDaniel Wagner <wagi@monom.org>
Tue, 21 Sep 2021 15:16:02 +0000 (17:16 +0200)
Use setup.py to install the binding to the sitearch.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
Makefile
pynvme/Makefile

index 3574a9ac58dacdc55392a96685fda4dfbcf8698b..6cc8338645e156e778595f35a5ed1553260517f5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -54,6 +54,9 @@ install: $(NAME).pc
 install-tests:
        @$(MAKE) -C test install prefix=$(DESTDIR)$(prefix) datadir=$(DESTDIR)$(datadir)
 
+install-python:
+       @$(MAKE) -C pynvme install prefix=$(DESTDIR)$(prefix)
+
 clean:
        @rm -f config-host.mak config-host.h cscope.out $(NAME).pc
        @$(MAKE) -C src clean
index f82a83bb0dd23b4c424dcdce228bc2775e68bae4..5f2640738a3f8a0ab136b36f319ba6b49e771afc 100644 (file)
@@ -3,6 +3,8 @@
 SWIG ?= swig
 PYTHON ?= python3
 
+prefix ?= /usr
+
 nvme_swig := nvme.i
 
 nvme_wrap.c: $(nvme_swig)
@@ -11,8 +13,8 @@ nvme_wrap.c: $(nvme_swig)
 python: nvme_wrap.c setup.py
        $(PYTHON) setup.py build
 
-#install:
-#
+install:
+       $(PYTHON) setup.py install --prefix=$(prefix)
 
 clean:
        rm -rf nvme_wrap.c nvme.py build