summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Monjalon <thomas.monjalon@6wind.com>2014-02-03 17:14:30 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-03-27 10:32:25 +0100
commit0b68e20b8ab4f30a1d058b79b98e91c97f4721fa (patch)
tree851e21dd368c64f3009d9a4205027056d1148457
parent12bafe7c46bb21b10f67dd70399487110855d36d (diff)
downloadvirtio-net-pmd-0b68e20b8ab4f30a1d058b79b98e91c97f4721fa.zip
virtio-net-pmd-0b68e20b8ab4f30a1d058b79b98e91c97f4721fa.tar.gz
virtio-net-pmd-0b68e20b8ab4f30a1d058b79b98e91c97f4721fa.tar.xz
mk: allow to install lib and doc
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
-rw-r--r--Makefile30
1 files changed, 28 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 4ff4c1d..a0345bb 100644
--- a/Makefile
+++ b/Makefile
@@ -30,6 +30,7 @@
# OF THE POSSIBILITY OF SUCH DAMAGE.
SOLIB = librte_pmd_virtio.so
+DOC = dpdk-virtio-net-pmd.rst
CC = $(CROSS)gcc
override CPPFLAGS += -Wall -Wextra -Werror
@@ -39,6 +40,12 @@ override LDFLAGS += -shared
S ?= .
O ?= .
+prefix ?= /usr/local
+exec_prefix ?= $(prefix)
+libdir ?= $(exec_prefix)/lib
+datarootdir ?= $(prefix)/share
+docdir ?= $(datarootdir)/doc/dpdk
+
all : $O/$(SOLIB)
$O :
@@ -52,19 +59,38 @@ endif
-I$(RTE_INCLUDE) -include $(RTE_INCLUDE)/rte_config.h \
-o $@ $<
+install : $(DESTDIR)$(libdir)/$(SOLIB)
+$(DESTDIR)$(libdir)/$(SOLIB) : $O/$(SOLIB)
+ install -D -m 644 $< $@
+
+install : $(DESTDIR)$(docdir)/$(DOC)
+$(DESTDIR)$(docdir)/$(DOC) : $S/README.rst
+ install -D -m 644 $< $@
+
clean :
- rm -f $O/$(SOLIB)
ifneq '$(abspath $O)' '$(CURDIR)'
- rmdir -p $O 2>&-
endif
+uninstall :
+ - rm -f $(DESTDIR)$(libdir)/$(SOLIB)
+ - rmdir -p $(DESTDIR)$(libdir) 2>&-
+ - rm -f $(DESTDIR)$(docdir)/$(DOC)
+ - rmdir -p $(DESTDIR)$(docdir) 2>&-
+
help :
@ echo 'rules:'
@ echo ' all (default)'
@ echo ' clean'
- @ echo 'variables:'
+ @ echo ' install'
+ @ echo ' uninstall'
+ @ echo 'build variables:'
@ echo ' RTE_INCLUDE (e.g. ../dpdk/build/include),'
@ echo ' CPPFLAGS, CFLAGS, LDFLAGS,'
@ echo ' S (source directory), O (build directory)'
+ @ echo 'install variables:'
+ @ echo ' DESTDIR (optional),'
+ @ echo ' prefix, exec_prefix, libdir, datarootdir, docdir'
-.PHONY : all clean help
+.PHONY : all clean install uninstall help