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