9e32f3e9a4cf1425fa41dae5785213b0504a2f27
[openwrt/openwrt.git] / package / kernel / mwlwifi / Makefile
1 #
2 # Copyright (C) 2014-2016 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=mwlwifi
11 PKG_RELEASE=1
12
13 PKG_LICENSE:=ISC
14 PKG_LICENSE_FILES:=
15
16 PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi
17 PKG_SOURCE_PROTO:=git
18 PKG_SOURCE_DATE:=2018-01-18
19 PKG_SOURCE_VERSION:=a149180fecec4fbaafb3f52ae46e33bd66501441
20 PKG_MIRROR_HASH:=e5a791182208eea4602692e5453dc67bfe87f080b6f03b1c6d1657b546f93b31
21
22 PKG_MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
23 PKG_BUILD_PARALLEL:=1
24
25 include $(INCLUDE_DIR)/kernel.mk
26 include $(INCLUDE_DIR)/package.mk
27
28 define KernelPackage/mwlwifi
29 SUBMENU:=Wireless Drivers
30 TITLE:=Marvell 88W8864/88W8897/88W8964 wireless driver
31 DEPENDS:=+kmod-mac80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT @PCI_SUPPORT @TARGET_mvebu
32 FILES:=$(PKG_BUILD_DIR)/mwlwifi.ko
33 AUTOLOAD:=$(call AutoLoad,50,mwlwifi)
34 endef
35
36 NOSTDINC_FLAGS = \
37 -I$(PKG_BUILD_DIR) \
38 -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
39 -I$(STAGING_DIR)/usr/include/mac80211-backport \
40 -I$(STAGING_DIR)/usr/include/mac80211/uapi \
41 -I$(STAGING_DIR)/usr/include/mac80211 \
42 -include backport/backport.h
43
44 define Build/Compile
45 +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
46 $(KERNEL_MAKE_FLAGS) \
47 SUBDIRS="$(PKG_BUILD_DIR)" \
48 NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
49 modules
50 endef
51
52 define Package/mwlwifi-firmware-default
53 SECTION:=firmware
54 CATEGORY:=Firmware
55 TITLE:=Marvell $(1) firmware
56 DEPENDS:=+kmod-mwlwifi @TARGET_mvebu
57 endef
58
59 define Package/mwlwifi-firmware/install
60 $(INSTALL_DIR) $(1)/lib/firmware
61 $(INSTALL_DIR) $(1)/lib/firmware/mwlwifi
62 $(CP) $(PKG_BUILD_DIR)/bin/firmware/$(2) $(1)/lib/firmware/mwlwifi/
63 $(CP) $(PKG_BUILD_DIR)/bin/firmware/Marvell_license.txt $(1)/lib/firmware/mwlwifi/$(2).Marvell_license.txt
64 endef
65
66 define Package/mwlwifi-firmware-88w8864
67 $(call Package/mwlwifi-firmware-default,88W8864)
68 endef
69
70 define Package/mwlwifi-firmware-88w8864/install
71 $(call Package/mwlwifi-firmware/install,$(1),88W8864.bin)
72 endef
73
74 define Package/mwlwifi-firmware-88w8897
75 $(call Package/mwlwifi-firmware-default,88W8897)
76 endef
77
78 define Package/mwlwifi-firmware-88w8897/install
79 $(call Package/mwlwifi-firmware/install,$(1),88W8897.bin)
80 endef
81
82 define Package/mwlwifi-firmware-88w8964
83 $(call Package/mwlwifi-firmware-default,88W8964)
84 endef
85
86 define Package/mwlwifi-firmware-88w8964/install
87 $(call Package/mwlwifi-firmware/install,$(1),88W8964.bin)
88 endef
89
90 $(eval $(call KernelPackage,mwlwifi))
91 $(eval $(call BuildPackage,mwlwifi-firmware-88w8864))
92 $(eval $(call BuildPackage,mwlwifi-firmware-88w8897))
93 $(eval $(call BuildPackage,mwlwifi-firmware-88w8964))