Thread (5 messages) flat view 5 messages, 3 authors, 2017-07-26
STALE3340d

[PATCH net-next v2] bpf: install libbpf headers on 'make install'

From: Jakub Kicinski <hidden>
Date: 2017-07-25 18:17:16
Subsystem: bpf [general] (safe dynamic programs and tools), bpf [library] (libbpf), the rest · Maintainers: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, Eduard Zingerman, Kumar Kartikeya Dwivedi, Linus Torvalds

Add a new target to install the bpf.h header to $(prefix)/include/bpf/ 
directory.  This is necessary to build standalone applications using 
libbpf, without the need to clone the kernel sources and point to them.

Signed-off-by: Jakub Kicinski <redacted>
---
v2:
 - make the header installation similar to tools/lib/traceevent (Daniel).

The functional change is that the header will not be installed as part
of make install, one has to make install_headers, which seems OK.

Out of curiosity - why are only "force elfdep bpfdep" added to the PHONY
target?  Is there some Makefile magic that makes adding install* targets
there unnecessary?  Or does the PHONY target just not matter in practice
so it's not updated?

 tools/lib/bpf/Makefile | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index 1f5300e56b44..445289555487 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -189,6 +189,10 @@ install_lib: all_cmd
 	$(call QUIET_INSTALL, $(LIB_FILE)) \
 		$(call do_install,$(LIB_FILE),$(libdir_SQ))
 
+install_headers:
+	$(call QUIET_INSTALL, headers) \
+		$(call do_install,bpf.h,$(prefix)/include/bpf,644)
+
 install: install_lib
 
 ### Cleaning rules
-- 
2.11.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help