Makefile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=mt76
  3. PKG_VERSION:=2016-03-03
  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:=310d420178c86e253a172413da30ecf479b64251
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
  12. PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
  13. PKG_BUILD_PARALLEL:=1
  14. include $(INCLUDE_DIR)/kernel.mk
  15. include $(INCLUDE_DIR)/package.mk
  16. define KernelPackage/mt76
  17. SUBMENU:=Wireless Drivers
  18. TITLE:=MediaTek MT76x2 wireless driver
  19. DEPENDS:=+kmod-mac80211 +@DRIVER_11N_SUPPORT @PCI_SUPPORT
  20. FILES:=\
  21. $(PKG_BUILD_DIR)/mt76.ko \
  22. $(PKG_BUILD_DIR)/mt76x2e.ko
  23. AUTOLOAD:=$(call AutoLoad,50,mac80211 mt76 mt76x2e)
  24. endef
  25. NOSTDINC_FLAGS = \
  26. -I$(PKG_BUILD_DIR) \
  27. -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
  28. -I$(STAGING_DIR)/usr/include/mac80211-backport \
  29. -I$(STAGING_DIR)/usr/include/mac80211/uapi \
  30. -I$(STAGING_DIR)/usr/include/mac80211 \
  31. -include backport/autoconf.h \
  32. -include backport/backport.h
  33. ifdef CONFIG_PACKAGE_MAC80211_MESH
  34. NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH
  35. endif
  36. define Build/Compile
  37. +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
  38. ARCH="$(LINUX_KARCH)" \
  39. CROSS_COMPILE="$(TARGET_CROSS)" \
  40. SUBDIRS="$(PKG_BUILD_DIR)" \
  41. NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
  42. modules
  43. endef
  44. define KernelPackage/mt76/install
  45. $(INSTALL_DIR) $(1)/lib/firmware
  46. cp \
  47. $(PKG_BUILD_DIR)/firmware/mt7662_rom_patch.bin \
  48. $(PKG_BUILD_DIR)/firmware/mt7662.bin \
  49. $(1)/lib/firmware
  50. endef
  51. $(eval $(call KernelPackage,mt76))