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