[PATCH 8/8] tools lib bpf: install header file

From: Eric Leblond
Date: Sun Oct 16 2016 - 18:01:15 EST


Makefile was not installing the header file of the library and a
manual copy was needed to have a usable library on the system.

Signed-off-by: Eric Leblond <eric@xxxxxxxxx>
---
tools/lib/bpf/Makefile | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index 62d89d5..9525956 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -47,6 +47,7 @@ endif

prefix ?= /usr/local
libdir = $(prefix)/$(libdir_relative)
+includedir = $(prefix)/include/bpf
man_dir = $(prefix)/share/man
man_dir_SQ = '$(subst ','\'',$(man_dir))'

@@ -87,14 +88,16 @@ include $(FEATURES_DUMP)
endif
endif

-export prefix libdir src obj
+export prefix libdir includedir src obj

# Shell quotes
libdir_SQ = $(subst ','\'',$(libdir))
libdir_relative_SQ = $(subst ','\'',$(libdir_relative))
+includedir_SQ = $(subst ','\'',$(includedir))
plugin_dir_SQ = $(subst ','\'',$(plugin_dir))

LIB_FILE = libbpf.a libbpf.so
+HEADER_FILE = libbpf.h

VERSION = $(BPF_VERSION)
PATCHLEVEL = $(BPF_PATCHLEVEL)
@@ -189,7 +192,11 @@ install_lib: all_cmd
$(call QUIET_INSTALL, $(LIB_FILE)) \
$(call do_install,$(LIB_FILE),$(libdir_SQ))

-install: install_lib
+install_header: all_cmd
+ $(call QUIET_INSTALL, $(HEADER_FILE)) \
+ $(call do_install,$(HEADER_FILE),$(includedir_SQ))
+
+install: install_lib install_header

### Cleaning rules

--
2.9.3