6d0000967d7b0de4211e49060b445ff19c377c45
[openwrt/svn-archive/archive.git] / package / kernel / mt76 / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=mt76
4 PKG_VERSION:=2016-02-28
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:=675868d4e84f0f4be2449c40902b229b79ecf926
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/MT7603 wireless driver
25 DEPENDS:=+kmod-mac80211 +@DRIVER_11N_SUPPORT @PCI_SUPPORT
26 FILES:=\
27 $(PKG_BUILD_DIR)/mt76.ko \
28 $(PKG_BUILD_DIR)/mt76x2e.ko \
29 $(PKG_BUILD_DIR)/mt7603e.ko
30 AUTOLOAD:=$(call AutoLoad,50,mac80211 mt76 mt76x2e mt7603e)
31 endef
32
33 NOSTDINC_FLAGS = \
34 -I$(PKG_BUILD_DIR) \
35 -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
36 -I$(STAGING_DIR)/usr/include/mac80211-backport \
37 -I$(STAGING_DIR)/usr/include/mac80211/uapi \
38 -I$(STAGING_DIR)/usr/include/mac80211 \
39 -include backport/autoconf.h \
40 -include backport/backport.h
41
42 ifdef CONFIG_PACKAGE_MAC80211_MESH
43 NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH
44 endif
45
46 define Build/Compile
47 +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
48 ARCH="$(LINUX_KARCH)" \
49 CROSS_COMPILE="$(TARGET_CROSS)" \
50 SUBDIRS="$(PKG_BUILD_DIR)" \
51 NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
52 modules
53 endef
54
55 define KernelPackage/mt76/install
56 $(INSTALL_DIR) $(1)/lib/firmware
57 cp \
58 $(PKG_BUILD_DIR)/firmware/mt7603_e1.bin \
59 $(PKG_BUILD_DIR)/firmware/mt7603_e2.bin \
60 $(PKG_BUILD_DIR)/firmware/mt7662_rom_patch.bin \
61 $(PKG_BUILD_DIR)/firmware/mt7662.bin \
62 $(1)/lib/firmware
63 endef
64
65 $(eval $(call KernelPackage,mt76))