Makefile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #
  2. # Copyright (C) 2021 OpenWrt.org
  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. include $(INCLUDE_DIR)/kernel.mk
  9. PKG_NAME:=qosify
  10. PKG_SOURCE_URL=$(PROJECT_GIT)/project/qosify.git
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_DATE:=2023-03-07
  13. PKG_SOURCE_VERSION:=9a47ea4b683dd845ec94534fcd82d3117c9ab313
  14. PKG_MIRROR_HASH:=0df1dc6e9645691f1ce0c3c039afedbcd8d4635dad36923ce47174e8d5b4ce43
  15. PKG_RELEASE:=1
  16. PKG_LICENSE:=GPL-2.0
  17. PKG_MAINTAINER:=Felix Fietkau <[email protected]>
  18. PKG_BUILD_DEPENDS:=bpf-headers
  19. PKG_FLAGS:=nonshared
  20. include $(INCLUDE_DIR)/package.mk
  21. include $(INCLUDE_DIR)/cmake.mk
  22. include $(INCLUDE_DIR)/bpf.mk
  23. include $(INCLUDE_DIR)/nls.mk
  24. define Package/qosify
  25. SECTION:=utils
  26. CATEGORY:=Base system
  27. TITLE:=A simple QoS solution based eBPF + CAKE
  28. DEPENDS:=+libbpf +libubox +libubus +libnl-tiny +kmod-sched-cake +kmod-sched-bpf +kmod-ifb +tc $(BPF_DEPENDS)
  29. endef
  30. TARGET_CFLAGS += \
  31. -Wno-error=deprecated-declarations \
  32. -I$(STAGING_DIR)/usr/include/libnl-tiny \
  33. -I$(STAGING_DIR)/usr/include
  34. CMAKE_OPTIONS += \
  35. -DLIBNL_LIBS=-lnl-tiny
  36. define Build/Compile
  37. $(call CompileBPF,$(PKG_BUILD_DIR)/qosify-bpf.c)
  38. $(Build/Compile/Default)
  39. endef
  40. define Package/qosify/conffiles
  41. /etc/config/qosify
  42. /etc/qosify/00-defaults.conf
  43. endef
  44. define Package/qosify/install
  45. $(INSTALL_DIR) \
  46. $(1)/lib/bpf \
  47. $(1)/usr/sbin \
  48. $(1)/etc/init.d \
  49. $(1)/etc/config \
  50. $(1)/etc/qosify \
  51. $(1)/etc/hotplug.d/net \
  52. $(1)/etc/hotplug.d/iface
  53. $(INSTALL_DATA) $(PKG_BUILD_DIR)/qosify-bpf.o $(1)/lib/bpf
  54. $(INSTALL_BIN) \
  55. $(PKG_INSTALL_DIR)/usr/bin/qosify \
  56. ./files/qosify-status \
  57. $(1)/usr/sbin/
  58. $(INSTALL_BIN) ./files/qosify.init $(1)/etc/init.d/qosify
  59. $(INSTALL_DATA) ./files/qosify-defaults.conf $(1)/etc/qosify/00-defaults.conf
  60. $(INSTALL_DATA) ./files/qosify.conf $(1)/etc/config/qosify
  61. $(INSTALL_DATA) ./files/qosify.hotplug $(1)/etc/hotplug.d/net/10-qosify
  62. $(INSTALL_DATA) ./files/qosify.hotplug $(1)/etc/hotplug.d/iface/10-qosify
  63. endef
  64. $(eval $(call BuildPackage,qosify))