41 lines
1.0 KiB
Makefile
41 lines
1.0 KiB
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_SRCDIR)/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
|
|
|
|
$(Q)mkdir -p $(@D)/tools/
|
|
$(Q)$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_SRCDIR)/tools \
|
|
O=$(@D)/tools/ \
|
|
$(BPFTOOL_MAKE_OPTS) bpf/bpftool
|
|
endef
|
|
|
|
define BPFTOOL_INSTALL_TARGET_CMDS
|
|
$(Q)$(TARGET_MAKE_ENV) $(MAKE1) -C $(LINUX_SRCDIR)/tools/ \
|
|
O=$(@D)/tools/ \
|
|
$(BPFTOOL_MAKE_OPTS) \
|
|
DESTDIR=$(TARGET_DIR) \
|
|
bpf_install
|
|
endef
|