tools/resolve_btfids: Install libbpf headers when building
authorQuentin Monnet <quentin@isovalent.com>
Thu, 7 Oct 2021 19:44:30 +0000 (20:44 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 8 Oct 2021 18:54:11 +0000 (11:54 -0700)
commit1478994aad82810d833bf9c816fb4e9845553e9b
treea3ae2e66d95184fdff5f3ea0c3a939079a896eee
parentf012ade10b34c461663bc3dd957636be06804b0d
tools/resolve_btfids: Install libbpf headers when building

API headers from libbpf should not be accessed directly from the
library's source directory. Instead, they should be exported with "make
install_headers". Let's make sure that resolve_btfids installs the
headers properly when building.

When descending from a parent Makefile, the specific output directories
for building the library and exporting the headers are configurable with
LIBBPF_OUT and LIBBPF_DESTDIR, respectively. This is in addition to
OUTPUT, on top of which those variables are constructed by default.

Also adjust the Makefile for the BPF selftests in order to point to the
(target) libbpf shared with other tools, instead of building a version
specific to resolve_btfids. Remove libbpf's order-only dependencies on
the include directories (they are created by libbpf and don't need to
exist beforehand).

Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211007194438.34443-5-quentin@isovalent.com
tools/bpf/resolve_btfids/Makefile
tools/bpf/resolve_btfids/main.c
tools/testing/selftests/bpf/Makefile