Makefile 1016 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=ucode-mod-bpf
  3. PKG_RELEASE:=1
  4. PKG_LICENSE:=ISC
  5. PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  6. include $(INCLUDE_DIR)/package.mk
  7. include $(INCLUDE_DIR)/nls.mk
  8. define Package/ucode-mod-bpf
  9. SECTION:=utils
  10. CATEGORY:=Utilities
  11. TITLE:=ucode eBPF module
  12. DEPENDS:=+libucode +libbpf
  13. endef
  14. define Package/ucode-mod-bpf/description
  15. The bpf plugin provides functionality for loading and interacting with
  16. eBPF modules.
  17. It allows loading full modules and pinned maps/programs and supports
  18. interacting with maps and attaching programs as tc classifiers.
  19. endef
  20. define Package/ucode-mod-bpf/install
  21. $(INSTALL_DIR) $(1)/usr/lib/ucode
  22. $(CP) $(PKG_BUILD_DIR)/bpf.so $(1)/usr/lib/ucode/
  23. endef
  24. define Build/Configure
  25. endef
  26. define Build/Compile
  27. $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) $(FPIC) \
  28. -Wall -ffunction-sections -Wl,--gc-sections -shared -Wl,--no-as-needed -lbpf \
  29. -o $(PKG_BUILD_DIR)/bpf.so $(PKG_BUILD_DIR)/bpf.c
  30. endef
  31. $(eval $(call BuildPackage,ucode-mod-bpf))