Makefile 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #
  2. # Copyright (C) 2020-2024 Tony Ambardar <[email protected]>
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=bpftool
  9. PKG_VERSION:=7.4.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_URL:=https://github.com/libbpf/bpftool
  12. PKG_MIRROR_HASH:=18e22f72e67ff402b5ecaf314445f25c40bfe23299cb783b5834a496297c51ed
  13. PKG_SOURCE_PROTO:=git
  14. PKG_SOURCE_VERSION:=v7.4.0
  15. PKG_MAINTAINER:=Tony Ambardar <[email protected]>
  16. PKG_BUILD_FLAGS:=no-mips16 gc-sections lto
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/nls.mk
  21. define Package/bpftool/Default
  22. SECTION:=net
  23. CATEGORY:=Network
  24. TITLE:=bpftool - eBPF subsystem utility
  25. LICENSE:=GPL-2.0-only OR BSD-2-Clause
  26. URL:=http://www.kernel.org
  27. DEPENDS:=+libelf
  28. endef
  29. define Package/bpftool-minimal
  30. $(call Package/bpftool/Default)
  31. TITLE+= (Minimal)
  32. VARIANT:=minimal
  33. DEFAULT_VARIANT:=1
  34. PROVIDES:=bpftool
  35. ALTERNATIVES:=200:/usr/sbin/bpftool:/usr/libexec/bpftool-minimal
  36. endef
  37. define Package/bpftool-full
  38. $(call Package/bpftool/Default)
  39. TITLE+= (Full)
  40. VARIANT:=full
  41. PROVIDES:=bpftool
  42. ALTERNATIVES:=300:/usr/sbin/bpftool:/usr/libexec/bpftool-full
  43. DEPENDS+= +libbfd +libopcodes
  44. endef
  45. define Package/bpftool-minimal/description
  46. A tool for inspection and simple manipulation of eBPF programs and maps.
  47. endef
  48. define Package/bpftool-full/description
  49. A tool for inspection and simple manipulation of eBPF programs and maps.
  50. This full version uses libbfd and libopcodes to support disassembly of
  51. eBPF programs and jited code.
  52. endef
  53. ifeq ($(BUILD_VARIANT),full)
  54. full:=1
  55. else
  56. full:=0
  57. endif
  58. MAKE_FLAGS += \
  59. OUTPUT="$(PKG_BUILD_DIR)/" \
  60. prefix="/usr" \
  61. $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
  62. check_feat=0 \
  63. feature-clang-bpf-co-re=0 \
  64. feature-libbfd=$(full) \
  65. feature-llvm=0 \
  66. feature-libcap=0 \
  67. feature-disassembler-four-args=1 \
  68. feature-disassembler-init-styled=1
  69. MAKE_PATH = src
  70. define Package/bpftool-$(BUILD_VARIANT)/install
  71. $(INSTALL_DIR) $(1)/usr/libexec
  72. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/bpftool \
  73. $(1)/usr/libexec/bpftool-$(BUILD_VARIANT)
  74. endef
  75. $(eval $(call BuildPackage,bpftool-full))
  76. $(eval $(call BuildPackage,bpftool-minimal))