2 # Copyright (C) 2020-2023 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
16 PKG_SOURCE_VERSION
:=19ff0564980a7429e730f6987a0b0bf418b3c676
17 PKG_MIRROR_HASH
:=f9b9871f64986dd2e5dab7060bb919398256ba93964da49c62efaf0e6bc9bbc4
19 PKG_MAINTAINER
:=Tony Ambardar
<itugrok@yahoo.com
>
21 PKG_BUILD_FLAGS
:=no-mips16
25 include $(INCLUDE_DIR
)/package.mk
26 include $(INCLUDE_DIR
)/nls.mk
28 define Package
/bpftool
/Default
31 TITLE
:=bpftool
- eBPF subsystem utility
32 LICENSE
:=GPL-2.0
-only OR BSD-2-Clause
33 URL
:=http
://www.kernel.org
37 define Package
/bpftool-minimal
38 $(call Package
/bpftool
/Default
)
43 ALTERNATIVES
:=200:/usr
/sbin
/bpftool
:/usr
/libexec
/bpftool-minimal
46 define Package
/bpftool-full
47 $(call Package
/bpftool
/Default
)
51 ALTERNATIVES
:=300:/usr
/sbin
/bpftool
:/usr
/libexec
/bpftool-full
52 DEPENDS
+= +libbfd
+libopcodes
55 define Package
/bpftool-minimal
/description
56 A tool for inspection and simple manipulation of eBPF programs and maps.
59 define Package
/bpftool-full
/description
60 A tool for inspection and simple manipulation of eBPF programs and maps.
61 This full version uses libbfd and libopcodes to support disassembly of
62 eBPF programs and jited code.
65 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
-flto
66 TARGET_LDFLAGS
+= -Wl
,--gc-sections
-flto
68 ifeq ($(BUILD_VARIANT
),full
)
75 EXTRA_CFLAGS
="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
76 LDFLAGS
="$(TARGET_LDFLAGS)"
79 OUTPUT
="$(PKG_BUILD_DIR)/" \
81 $(if
$(findstring c
,$(OPENWRT_VERBOSE
)),V
=1,V
='') \
83 feature-clang-bpf-co-re
=0 \
84 feature-libbfd
=$(full
) \
87 feature-disassembler-four-args
=1 \
88 feature-disassembler-init-styled
=1
92 define Package
/bpftool-
$(BUILD_VARIANT
)/install
93 $(INSTALL_DIR
) $(1)/usr
/libexec
94 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/bpftool \
95 $(1)/usr
/libexec
/bpftool-
$(BUILD_VARIANT
)
98 $(eval
$(call BuildPackage
,bpftool-full
))
99 $(eval
$(call BuildPackage
,bpftool-minimal
))