Makefile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=mt76
  3. PKG_VERSION:=2016-06-17
  4. PKG_RELEASE=1
  5. PKG_LICENSE:=GPLv2
  6. PKG_LICENSE_FILES:=
  7. PKG_SOURCE_URL:=https://github.com/openwrt/mt76
  8. PKG_SOURCE_PROTO:=git
  9. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  10. PKG_SOURCE_VERSION:=f06ed811cda67ab2ed9932c3e87ba03229e75f4e
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
  12. PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  13. PKG_BUILD_PARALLEL:=1
  14. STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
  15. include $(INCLUDE_DIR)/kernel.mk
  16. include $(INCLUDE_DIR)/package.mk
  17. define KernelPackage/mt76
  18. SUBMENU:=Wireless Drivers
  19. TITLE:=MediaTek MT76x2/MT7603 wireless driver
  20. DEPENDS:=+kmod-mac80211 +@DRIVER_11N_SUPPORT @PCI_SUPPORT
  21. FILES:=\
  22. $(PKG_BUILD_DIR)/mt76.ko \
  23. $(PKG_BUILD_DIR)/mt76x2e.ko \
  24. $(PKG_BUILD_DIR)/mt7603e.ko
  25. AUTOLOAD:=$(call AutoLoad,50,mac80211 mt76 mt76x2e mt7603e)
  26. endef
  27. NOSTDINC_FLAGS = \
  28. -I$(PKG_BUILD_DIR) \
  29. -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
  30. -I$(STAGING_DIR)/usr/include/mac80211-backport \
  31. -I$(STAGING_DIR)/usr/include/mac80211/uapi \
  32. -I$(STAGING_DIR)/usr/include/mac80211 \
  33. -include backport/autoconf.h \
  34. -include backport/backport.h
  35. ifdef CONFIG_PACKAGE_MAC80211_MESH
  36. NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH
  37. endif
  38. define Build/Compile
  39. +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
  40. ARCH="$(LINUX_KARCH)" \
  41. CROSS_COMPILE="$(TARGET_CROSS)" \
  42. SUBDIRS="$(PKG_BUILD_DIR)" \
  43. NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
  44. modules
  45. endef
  46. define KernelPackage/mt76/install
  47. $(INSTALL_DIR) $(1)/lib/firmware
  48. cp \
  49. $(if $(CONFIG_TARGET_ramips_mt7628) || $(CONFIG_TARGET_ramips_mt7688), \
  50. $(PKG_BUILD_DIR)/firmware/mt7628_e1.bin \
  51. $(PKG_BUILD_DIR)/firmware/mt7628_e2.bin \
  52. ) \
  53. $(PKG_BUILD_DIR)/firmware/mt7603_e1.bin \
  54. $(PKG_BUILD_DIR)/firmware/mt7603_e2.bin \
  55. $(PKG_BUILD_DIR)/firmware/mt7662_rom_patch.bin \
  56. $(PKG_BUILD_DIR)/firmware/mt7662.bin \
  57. $(1)/lib/firmware
  58. endef
  59. $(eval $(call KernelPackage,mt76))