Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. PREFIX:=/usr
  2. DESTDIR:=
  3. PLATFORM:=linux
  4. LUCI_DIR:=$(DESTDIR)$(PREFIX)/lib/lua/luci
  5. UNIT_DIR:=$(DESTDIR)$(PREFIX)/lib/systemd/system
  6. all:
  7. @echo "Run 'make install' to install."
  8. install: install-$(PLATFORM)
  9. .PHONY: install-openwrt
  10. install-openwrt: install-lib
  11. install -m 0755 -d $(DESTDIR)/etc/hotplug.d/iface $(DESTDIR)/etc/config \
  12. $(DESTDIR)/etc/init.d
  13. install -m 0755 platform/openwrt/sqm-hotplug $(DESTDIR)/etc/hotplug.d/iface/11-sqm
  14. install -m 0755 platform/openwrt/sqm-init $(DESTDIR)/etc/init.d/sqm
  15. install -m 0644 platform/openwrt/sqm-uci $(DESTDIR)/etc/config/sqm
  16. install -m 0744 src/run-openwrt.sh $(DESTDIR)$(PREFIX)/lib/sqm/run.sh
  17. install-linux: install-lib
  18. install -m 0755 -d $(UNIT_DIR) $(DESTDIR)$(PREFIX)/lib/tmpfiles.d \
  19. $(DESTDIR)$(PREFIX)/bin
  20. install -m 0644 platform/linux/default.conf $(DESTDIR)/etc/sqm
  21. install -m 0644 platform/linux/sqm@.service $(UNIT_DIR)
  22. install -m 0644 platform/linux/sqm-tmpfiles.conf \
  23. $(DESTDIR)$(PREFIX)/lib/tmpfiles.d/sqm.conf
  24. install -m 0700 -d $(DESTDIR)/run/sqm
  25. install -m 0755 platform/linux/sqm-bin $(DESTDIR)$(PREFIX)/bin/sqm
  26. test -d $(DESTDIR)/etc/network/if-up.d && install -m 0755 platform/linux/sqm-ifup \
  27. $(DESTDIR)/etc/network/if-up.d/sqm || exit 0
  28. .PHONY: install-lib
  29. install-lib:
  30. install -m 0755 -d $(DESTDIR)/etc/sqm $(DESTDIR)$(PREFIX)/lib/sqm
  31. install -m 0644 platform/$(PLATFORM)/sqm.conf $(DESTDIR)/etc/sqm/sqm.conf
  32. install -m 0644 src/functions.sh src/defaults.sh \
  33. src/*.qos src/*.help $(DESTDIR)$(PREFIX)/lib/sqm
  34. install -m 0744 src/start-sqm src/stop-sqm src/update-available-qdiscs \
  35. $(DESTDIR)$(PREFIX)/lib/sqm
  36. .PHONY: install-luci
  37. install-luci:
  38. install -m 0755 -d $(LUCI_DIR)/controller $(LUCI_DIR)/model/cbi
  39. install -m 0644 luci/sqm-controller.lua $(LUCI_DIR)/controller/sqm.lua
  40. install -m 0644 luci/sqm-cbi.lua $(LUCI_DIR)/model/cbi/sqm.lua
  41. install -m 0755 -d $(DESTDIR)/etc/uci-defaults
  42. install -m 0755 luci/uci-defaults-sqm $(DESTDIR)/etc/uci-defaults/luci-sqm