packages: clean up the package folder
[openwrt.git] / package / kernel / acx-mac80211 / Makefile
1 #
2 # Copyright (C) 2007-2012 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 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=acx-mac80211
12 PKG_REV:=v2012-09-23-WIP
13 PKG_VERSION:=20121004
14 PKG_RELEASE:=1
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17 PKG_SOURCE_URL:=git://acx100.git.sourceforge.net/gitroot/acx100/acx-mac80211
18 PKG_SOURCE_PROTO:=git
19 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
20 PKG_SOURCE_VERSION:=$(PKG_REV)
21 PKG_MIRROR_MD5SUM:=8d6bc84239059fd938ff4d989579f622
22 PKG_BUILD_DEPENDS:=mac80211
23
24 PKG_CONFIG_DEPENDS:= \
25         CONFIG_PACKAGE_MAC80211_DEBUGFS \
26         CONFIG_PACKAGE_MAC80211_MESH \
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define KernelPackage/acx-mac80211
31   SUBMENU:=Wireless Drivers
32   TITLE:=ACX1xx mac80211 driver
33   DEPENDS:=@(PCI_SUPPORT||TARGET_ar7) @mipsel +kmod-mac80211
34   FILES:=$(PKG_BUILD_DIR)/acx-mac80211.ko
35   AUTOLOAD:=$(call AutoLoad,50,acx-mac80211)
36   MAINTAINER:=Florian Fainelli <florian@openwrt.org>
37   MENU:=1
38 endef
39
40 define KernelPackage/acx-mac80211/config
41         menu "Configuration"
42                 depends on PACKAGE_kmod-acx-mac80211
43
44         config ACX_ID_0D
45                 bool "ACX1xx Radio ID 0D firmware"
46                 help
47                   Download and install firmware for:
48                     ACX1xx cards with Radio ID 0D into /lib/firmware.
49
50         config ACX_ID_11
51                 bool "ACX1xx Radio ID 11 firmware"
52                 help
53                   Download and install firmware for:
54                     ACX1xx cards with Radio ID 11 into /lib/firmware.
55
56         config ACX_ID_15
57                 bool "ACX1xx Radio ID 15 firmware"
58                 help
59                   Download and install firmware for:
60                     ACX1xx cards with Radio ID 15 into /lib/firmware.
61
62         config ACX_ID_16
63                 bool "ACX1xx Radio ID 16 firmware"
64                 default y
65                 help
66                   Download and install firmware for:
67                     ACX1xx cards with Radio ID 16 into /lib/firmware.
68
69         choice
70                 prompt "ACX111 firmware version"
71                 depends on ACX_ID_16
72                 default ACX_DEFAULT if !TARGET_adm5120
73                 default ACX_1_2_1_34 if TARGET_adm5120
74                 help
75                   This option allows you to select the version of the acx firmware.
76
77         config ACX_DEFAULT
78                 bool "Default"
79                 help
80                   Default firmware for ACX111 devices.
81
82                   If unsure, select this.
83
84         config ACX_1_2_1_34
85                 bool "1.2.1_34"
86                 help
87                   1.2.1_34 firmware for ACX111 devices. Works with Zyxel P-334WT.
88
89                   If unsure, select the "default" firmware.
90
91         endchoice
92
93         config ACX_ID_17
94                 bool "ACX1xx Radio ID 17 firmware"
95                 help
96                   Download and install firmware for:
97                     ACX1xx cards with Radio ID 17 into /lib/firmware.
98
99         config ACX_ID_19
100                 bool "ACX1xx Radio ID 19 firmware"
101                 default y
102                 help
103                   Download and install firmware for:
104                     ACX1xx cards with Radio ID 19 into /lib/firmware.
105
106         config ACX_ID_1B
107                 bool "ACX1xx Radio ID 1B firmware"
108                 help
109                   Download and install firmware for:
110                     ACX1xx cards with Radio ID 1b into /lib/firmware.
111
112         endmenu
113 endef
114
115 define KernelPackage/acx-mac80211/description
116         Driver for acx111 cards (mac80211 version)
117 endef
118
119 define Download/tiacx100
120         FILE:=tiacx100
121         URL:=http://acx100.erley.org/fw/acx100_1.9.8.b/
122         MD5SUM:=24a54fd30f7658fcbffc825b0dd7aa5b
123 endef
124
125 define Download/tiacx100r0d
126         FILE:=tiacx100r0D
127         URL:=http://acx100.erley.org/fw/acx100_1.9.8.b/
128         MD5SUM:=1c7413e7b0be4ef7d1e424a132e17fab
129 endef
130
131 define Download/tiacx100r11
132         FILE:=tiacx100r11
133         URL:=http://acx100.erley.org/fw/acx100_1.9.8.b/
134         MD5SUM:=a150750ad33c512edc4afee5270b37cb
135 endef
136
137 define Download/tiacx100r15
138         FILE:=tiacx100r15
139         URL:=http://acx100.erley.org/fw/acx100_1.9.8.b/
140         MD5SUM:=c99d01d4fcf0d6cc00441aff60690be4
141 endef
142
143 define Download/tiacx111c16
144         FILE:=tiacx111c16
145         URL:=http://acx100.erley.org/fw/acx111_2.3.1.31/
146         MD5SUM:=7026826460376f6b174f9225bd7781b9
147 endef
148
149 define Download/tiacx111c16_1
150         FILE:=tiacx111c16_1.2.1_34
151         URL:=http://sites.google.com/site/atorkhov/files/
152         MD5SUM:=fcd07de4b25e1d2aaf3b78b27c5b7ee9
153 endef
154
155 define Download/tiacx111c17
156         FILE:=tiacx111c17
157         URL:=http://acx100.erley.org/fw/acx111_2.3.1.31/
158         MD5SUM:=95552544ca6d2b4e8c6aeb80b8ae7fdf
159 endef
160
161 define Download/tiacx111c19
162         FILE:=tiacx111c19
163         URL:=http://acx100.erley.org/fw/acx111_2.3.1.31/
164         MD5SUM:=a1fa9681e297b4e36e257090fc12265a
165 endef
166
167 define Download/tiacx111usbc1b
168         FILE:=tiacx111usbc1B
169         URL:=http://acx100.erley.org/fw/acx111_2.4.0.70-USB/
170         MD5SUM:=c4edecd912b2417779d0b65e3a7dc86d
171 endef
172
173 PKG_EXTRA_KCONFIG:= \
174         CONFIG_ACX_MAC80211=m \
175         CONFIG_ACX_MAC80211_PCI=m \
176
177 PKG_EXTRA_CFLAGS:= \
178         $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(PKG_EXTRA_KCONFIG)))) \
179         $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(PKG_EXTRA_KCONFIG)))) \
180         $(if $(CONFIG_LEDS_TRIGGERS), -DCONFIG_MAC80211_LEDS -DCONFIG_LEDS_TRIGGERS) \
181         $(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS), -DCONFIG_CFG80211_DEBUGFS -DCONFIG_MAC80211_DEBUGFS) \
182         $(if $(CONFIG_PACKAGE_MAC80211_MESH), -DCONFIG_MAC80211_MESH) \
183         -DBACKPORTED_KERNEL_NAME=\\\"$(PKG_SOURCE)\\\" \
184         -DBACKPORTED_KERNEL_VERSION=\\\"$(PKG_SOURCE_VERSION)\\\" \
185         -DBACKPORTS_VERSION=\\\"unknown\\\" \
186
187 define Build/Compile
188         $(MAKE) -C "$(LINUX_DIR)" \
189                 ARCH="$(LINUX_KARCH)" \
190                 CROSS_COMPILE="$(TARGET_CROSS)" \
191                 SUBDIRS="$(PKG_BUILD_DIR)" \
192                 $(PKG_EXTRA_KCONFIG) \
193                 EXTRA_CFLAGS="$(PKG_EXTRA_CFLAGS) -DCONFIG_ACX_MAC80211_VERSION=\"KERNEL_VERSION(3,10,0)\"" \
194                 LINUXINCLUDE="-I$(STAGING_DIR)/usr/include/mac80211-backport/uapi -I$(STAGING_DIR)/usr/include/mac80211-backport \
195                         -I$(STAGING_DIR)/usr/include/mac80211/uapi -I$(STAGING_DIR)/usr/include/mac80211 \
196                         -I$(LINUX_DIR)/include -I$(LINUX_DIR)/include/$(LINUX_UAPI_DIR) \
197                         -I$(LINUX_DIR)/include/generated/uapi/ -Iarch/$(LINUX_KARCH)/include \
198                         -Iarch/$(LINUX_KARCH)/include/$(LINUX_UAPI_DIR) \
199                         -include generated/autoconf.h \
200                         -include backport/backport.h " \
201                 V="$(V)" \
202                 modules
203 endef
204
205 define Build/Configure
206 endef
207
208 define KernelPackage/acx-mac80211/install
209         $(INSTALL_DIR) $(1)/lib/firmware
210
211 ifneq ($(CONFIG_ACX_ID_0D)$(CONFIG_ACX_ID_11)$(CONFIG_ACX_ID_15),)
212         $(INSTALL_DATA) $(DL_DIR)/tiacx100 $(1)/lib/firmware/
213 endif
214
215 ifneq ($(CONFIG_ACX_ID_0D),)
216         $(INSTALL_DATA) $(DL_DIR)/tiacx100r0D $(1)/lib/firmware/
217 endif
218
219 ifneq ($(CONFIG_ACX_ID_11),)
220         $(INSTALL_DATA) $(DL_DIR)/tiacx100r11 $(1)/lib/firmware/
221 endif
222
223 ifneq ($(CONFIG_ACX_ID_15),)
224         $(INSTALL_DATA) $(DL_DIR)/tiacx100r15 $(1)/lib/firmware/
225 endif
226
227 ifneq ($(CONFIG_ACX_DEFAULT),)
228         $(INSTALL_DATA) $(DL_DIR)/tiacx111c16 $(1)/lib/firmware/
229 endif
230
231 ifneq ($(CONFIG_ACX_1_2_1_34),)
232         $(INSTALL_DATA) $(DL_DIR)/tiacx111c16_1.2.1_34 $(1)/lib/firmware/tiacx111c16
233 endif
234
235 ifneq ($(CONFIG_ACX_ID_17),)
236         $(INSTALL_DATA) $(DL_DIR)/tiacx111c17 $(1)/lib/firmware/
237 endif
238
239 ifneq ($(CONFIG_ACX_ID_19),)
240         $(INSTALL_DATA) $(DL_DIR)/tiacx111c19 $(1)/lib/firmware/
241 endif
242
243 ifneq ($(CONFIG_ACX_ID_1B),)
244         $(INSTALL_DATA) $(DL_DIR)/tiacx111usbc1B $(1)/lib/firmware/
245 endif
246
247 endef
248
249 $(eval $(call KernelPackage,acx-mac80211))
250 $(eval $(call Download,tiacx100))
251 $(eval $(call Download,tiacx100r0d))
252 $(eval $(call Download,tiacx100r11))
253 $(eval $(call Download,tiacx100r15))
254 $(eval $(call Download,tiacx111c16))
255 $(eval $(call Download,tiacx111c16_1))
256 $(eval $(call Download,tiacx111c17))
257 $(eval $(call Download,tiacx111c19))
258 $(eval $(call Download,tiacx111usbc1b))