1
0

Makefile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #
  2. # Copyright (C) 2020-2023 Tony Ambardar <itugrok@yahoo.com>
  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:=libbpf
  9. PKG_VERSION:=1.2.2
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_URL:=https://github.com/libbpf/libbpf
  12. PKG_MIRROR_HASH:=d20f5a226e5729c87c367f3fba61c44d5e13176ef12637d0e0b30629fa3ab0d6
  13. PKG_SOURCE_PROTO:=git
  14. PKG_SOURCE_VERSION:=1728e3e4bef0e138ea95ffe62163eb9a6ac6fa32
  15. PKG_ABI_VERSION:=$(firstword $(subst .,$(space),$(PKG_VERSION)))
  16. PKG_MAINTAINER:=Tony Ambardar <itugrok@yahoo.com>
  17. PKG_CPE_ID:=cpe:/a:libbpf_project:libbpf
  18. PKG_BUILD_FLAGS:=no-mips16
  19. PKG_BUILD_PARALLEL:=1
  20. PKG_INSTALL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. include $(INCLUDE_DIR)/nls.mk
  23. define Package/libbpf
  24. SECTION:=libs
  25. CATEGORY:=Libraries
  26. TITLE:=libbpf - eBPF helper library
  27. LICENSE:=LGPL-2.1 OR BSD-2-Clause
  28. ABI_VERSION:=$(PKG_ABI_VERSION)
  29. URL:=http://www.kernel.org
  30. DEPENDS:=+libelf
  31. endef
  32. define Package/libbpf/description
  33. libbpf is a library for loading eBPF programs and reading and manipulating eBPF objects from user-space.
  34. endef
  35. MAKE_VARS = \
  36. EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  37. LDFLAGS="$(TARGET_LDFLAGS)"
  38. MAKE_FLAGS += \
  39. $(if $(findstring c,$(LIBRECMC_VERBOSE)),V=1,V='') \
  40. LIBSUBDIR=lib
  41. MAKE_PATH = src
  42. define Build/InstallDev/libbpf
  43. $(INSTALL_DIR) $(1)/usr/include/bpf
  44. $(CP) $(PKG_INSTALL_DIR)/usr/include/bpf/*.h $(1)/usr/include/bpf/
  45. $(INSTALL_DIR) $(1)/usr/lib
  46. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbpf.{a,so*} \
  47. $(1)/usr/lib/
  48. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  49. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libbpf.pc \
  50. $(1)/usr/lib/pkgconfig/
  51. $(SED) 's,/usr/include,$$$${prefix}/include,g' \
  52. $(1)/usr/lib/pkgconfig/libbpf.pc
  53. $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' \
  54. $(1)/usr/lib/pkgconfig/libbpf.pc
  55. endef
  56. Build/InstallDev=$(Build/InstallDev/libbpf)
  57. define Package/libbpf/install
  58. $(INSTALL_DIR) $(1)/usr/lib
  59. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbpf.so.* $(1)/usr/lib/
  60. endef
  61. $(eval $(call BuildPackage,libbpf))