Turn previously auto-generated libbpf_version.h header into a normal
header file. This prevents various tricky Makefile integration issues,
simplifies the overall build process, but also allows to further extend
it with some more versioning-related APIs in the future.
To prevent accidental out-of-sync versions as defined by libbpf.map and
libbpf_version.h, Makefile checks their consistency at build time.
Simultaneously with this change bump libbpf.map to v0.6.
Also undo adding libbpf's output directory into include path for
kernel/bpf/preload, bpftool, and resolve_btfids, which is not necessary
because libbpf_version.h is just a normal header like any other.
Fixes: 0b46b75505 ("libbpf: Add LIBBPF_DEPRECATED_SINCE macro for scheduling API deprecations")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210913222309.3220849-1-andrii@kernel.org
29 lines
1014 B
Makefile
29 lines
1014 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
LIBBPF_SRCS = $(srctree)/tools/lib/bpf/
|
|
LIBBPF_A = $(obj)/libbpf.a
|
|
LIBBPF_OUT = $(abspath $(obj))
|
|
|
|
# Although not in use by libbpf's Makefile, set $(O) so that the "dummy" test
|
|
# in tools/scripts/Makefile.include always succeeds when building the kernel
|
|
# with $(O) pointing to a relative path, as in "make O=build bindeb-pkg".
|
|
$(LIBBPF_A):
|
|
$(Q)$(MAKE) -C $(LIBBPF_SRCS) O=$(LIBBPF_OUT)/ OUTPUT=$(LIBBPF_OUT)/ $(LIBBPF_OUT)/libbpf.a
|
|
|
|
userccflags += -I $(srctree)/tools/include/ -I $(srctree)/tools/include/uapi \
|
|
-I $(srctree)/tools/lib/ -Wno-unused-result
|
|
|
|
userprogs := bpf_preload_umd
|
|
|
|
clean-files := $(userprogs) bpf_helper_defs.h FEATURE-DUMP.libbpf staticobjs/ feature/
|
|
|
|
bpf_preload_umd-objs := iterators/iterators.o
|
|
bpf_preload_umd-userldlibs := $(LIBBPF_A) -lelf -lz
|
|
|
|
$(obj)/bpf_preload_umd: $(LIBBPF_A)
|
|
|
|
$(obj)/bpf_preload_umd_blob.o: $(obj)/bpf_preload_umd
|
|
|
|
obj-$(CONFIG_BPF_PRELOAD_UMD) += bpf_preload.o
|
|
bpf_preload-objs += bpf_preload_kern.o bpf_preload_umd_blob.o
|