hc
2024-11-01 a01b5c9f91adaee088a817861603a5dbe14775c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
################################################################################
#
# 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