Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #
  2. # Copyright (C) 2012 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:=trelay
  10. PKG_VERSION:=0.1
  11. PKG_RELEASE:=1
  12. include $(INCLUDE_DIR)/package.mk
  13. define KernelPackage/trelay
  14. SUBMENU:=Network Support
  15. TITLE:=Trivial Ethernet Relay
  16. FILES:=$(PKG_BUILD_DIR)/trelay.ko
  17. AUTOLOAD:=$(call AutoLoad,50,trelay)
  18. endef
  19. define KernelPackage/trelay/description
  20. trelay relays ethernet packets between two devices (similar to a bridge), but
  21. without any MAC address checks. This makes it possible to bridge client mode
  22. or ad-hoc mode wifi devices to ethernet VLANs, assuming the remote end uses
  23. the same source MAC address as the device that packets are supposed to exit
  24. from.
  25. endef
  26. include $(INCLUDE_DIR)/kernel-defaults.mk
  27. define Build/Prepare
  28. mkdir -p $(PKG_BUILD_DIR)
  29. cp src/Makefile src/trelay.c $(PKG_BUILD_DIR)/
  30. endef
  31. define Build/Compile
  32. $(MAKE) $(KERNEL_MAKEOPTS) SUBDIRS="$(PKG_BUILD_DIR)" modules
  33. endef
  34. define KernelPackage/trelay/conffiles
  35. /etc/config/trelay
  36. endef
  37. define KernelPackage/trelay/install
  38. $(INSTALL_DIR) $(1)/etc/hotplug.d/net $(1)/etc/init.d $(1)/etc/config
  39. $(INSTALL_DATA) ./files/trelay.hotplug $(1)/etc/hotplug.d/net/50-trelay
  40. $(INSTALL_BIN) ./files/trelay.init $(1)/etc/init.d/trelay
  41. $(INSTALL_DATA) ./files/trelay.config $(1)/etc/config/trelay
  42. endef
  43. $(eval $(call KernelPackage,trelay))