kumquat-buildroot/package/linux-tools/linux-tool-bpftool.mk.in
James Hilliard d41d796568 package/linux-tools: add support for bpftool
This tool is available to be compiled since kernel 4.15.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2021-07-28 22:18:40 +02:00

38 lines
956 B
Makefile

################################################################################
#
# bpftool
#
################################################################################
LINUX_TOOLS += bpftool
BPFTOOL_DEPENDENCIES = binutils elfutils
ifeq ($(BR2_PACKAGE_LIBCAP),y)
BPFTOOL_DEPENDENCIES += libcap
endif
ifeq ($(BR2_PACKAGE_ZLIB),y)
BPFTOOL_DEPENDENCIES += zlib
endif
BPFTOOL_MAKE_OPTS = $(LINUX_MAKE_FLAGS)
define BPFTOOL_BUILD_CMDS
$(Q)if ! grep install $(LINUX_DIR)/tools/bpf/bpftool/Makefile >/dev/null 2>&1 ; then \
echo "Your kernel version is too old and does not have install section in the bpf tools." ; \
echo "At least kernel 4.15 must be used." ; \
exit 1 ; \
fi
$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/bpf/bpftool \
$(BPFTOOL_MAKE_OPTS)
endef
define BPFTOOL_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_DIR)/tools/bpf/bpftool \
$(BPFTOOL_MAKE_OPTS) \
DESTDIR=$(TARGET_DIR) \
install
endef