2 # Copyright (C) 2020-2024 Tony Ambardar <itugrok@yahoo.com>
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE_URL
:=https
://github.com
/libbpf
/bpftool
15 PKG_MIRROR_HASH
:=7406a424375642fda35cae6eccaa8e27c21e4f132123c0207a83f763ef6fe899
17 PKG_SOURCE_VERSION
:=v
$(PKG_VERSION
)
19 PKG_MAINTAINER
:=Tony Ambardar
<itugrok@yahoo.com
>
21 PKG_BUILD_FLAGS
:=no-mips16 gc-sections lto
25 HOST_BUILD_PARALLEL
:=1
27 include $(INCLUDE_DIR
)/package.mk
28 include $(INCLUDE_DIR
)/nls.mk
29 include $(INCLUDE_DIR
)/host-build.mk
31 define Package
/bpftool
/Default
34 TITLE
:=bpftool
- eBPF subsystem utility
35 LICENSE
:=GPL-2.0
-only OR BSD-2-Clause
36 URL
:=https
://www.kernel.org
40 define Package
/bpftool-minimal
41 $(call Package
/bpftool
/Default
)
46 ALTERNATIVES
:=200:/usr
/sbin
/bpftool
:/usr
/libexec
/bpftool-minimal
49 define Package
/bpftool-full
50 $(call Package
/bpftool
/Default
)
54 ALTERNATIVES
:=300:/usr
/sbin
/bpftool
:/usr
/libexec
/bpftool-full
55 DEPENDS
+= +libbfd
+libopcodes
58 define Package
/bpftool-minimal
/description
59 A tool for inspection and simple manipulation of eBPF programs and maps.
62 define Package
/bpftool-full
/description
63 A tool for inspection and simple manipulation of eBPF programs and maps.
64 This full version uses libbfd and libopcodes to support disassembly of
65 eBPF programs and jited code.
68 ifeq ($(BUILD_VARIANT
),full
)
75 OUTPUT
="$(PKG_BUILD_DIR)/" \
77 $(if
$(findstring c
,$(OPENWRT_VERBOSE
)),V
=1,V
='') \
79 feature-clang-bpf-co-re
=0 \
80 feature-libbfd
=$(full
) \
83 feature-disassembler-four-args
=1 \
84 feature-disassembler-init-styled
=1
88 define Package
/bpftool-
$(BUILD_VARIANT
)/install
89 $(INSTALL_DIR
) $(1)/usr
/libexec
90 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/bpftool \
91 $(1)/usr
/libexec
/bpftool-
$(BUILD_VARIANT
)
95 OUTPUT
="$(HOST_BUILD_DIR)/" \
97 $(if
$(findstring c
,$(OPENWRT_VERBOSE
)),V
=1,V
='') \
99 feature-clang-bpf-co-re
=0 \
103 feature-disassembler-four-args
=1 \
104 feature-disassembler-init-styled
=1
109 $(INSTALL_DIR
) $(STAGING_DIR_HOST
)/usr
/sbin
110 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/bpftool \
111 $(STAGING_DIR_HOST
)/usr
/sbin
/bpftool
115 rm -f
$(STAGING_DIR_HOST
)/usr
/sbin
/bpftool
118 $(eval
$(call BuildPackage
,bpftool-full
))
119 $(eval
$(call BuildPackage
,bpftool-minimal
))
120 $(eval
$(call HostBuild
))