source: branches/backfire/package/madwifi/Makefile @ 29301

Last change on this file since 29301 was 29301, checked in by nico, 4 years ago

[backfire] cleanup: remove refs to unsupported "gemini" target

  • Property svn:copyright set to Copyright (C) 2006 OpenWrt.org
  • Property svn:eol-style set to native
File size: 6.7 KB
Line 
1#
2# Copyright (C) 2006-2009 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9include $(INCLUDE_DIR)/kernel.mk
10
11PKG_NAME:=madwifi
12
13PKG_REV:=3314
14PKG_VERSION:=r$(PKG_REV)
15PKG_RELEASE:=5
16
17PKG_SOURCE_PROTO:=svn
18PKG_SOURCE_VERSION:=$(PKG_REV)
19PKG_SOURCE_SUBDIR:=$(if $(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION)
20PKG_SOURCE_URL:=http://madwifi-project.org/svn/madwifi/$(if $(PKG_BRANCH),branches/$(PKG_BRANCH),trunk)
21PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
22
23PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION)
24
25HAL_VERSION:=20090508
26HAL_FILE:=ath_hal-$(HAL_VERSION).tgz
27HAL_MD5SUM:=4ab7ae8bdb96c0be388c98bf8f92d5ca
28
29PKG_BUILD_DEPENDS:=wprobe
30
31include $(INCLUDE_DIR)/package.mk
32
33ifdef CONFIG_MADWIFI_COMPRESSION
34  COMPRESSION:=1
35else
36  COMPRESSION:=0
37endif
38
39define Download/hal
40  FILE:=$(HAL_FILE)
41  URL:=http://mirror2.openwrt.org/sources
42  MD5SUM:=$(HAL_MD5SUM)
43endef
44$(eval $(call Download,hal))
45
46
47ifneq ($(CONFIG_TARGET_atheros),)
48  BUS:=AHB
49else
50  ifneq ($(CONFIG_PCI_SUPPORT),)
51    BUS:=PCI
52  endif
53endif
54
55ifneq ($(CONFIG_CPU_MIPS32_R2),)
56  ifeq ($(ARCH),mips)
57    HAL_TARGET:=mips32r2-be-elf
58  endif
59  ifeq ($(ARCH),mipsel)
60    HAL_TARGET:=mips32r2-le-elf
61  endif
62else
63  ifeq ($(ARCH),mips)
64    HAL_TARGET:=mips32-be-elf
65  endif
66  ifeq ($(ARCH),mipsel)
67    HAL_TARGET:=mips32-le-elf
68  endif
69endif
70ifeq ($(ARCH),i386)
71  HAL_TARGET:=i386-elf
72endif
73ifeq ($(ARCH),i686)
74  HAL_TARGET:=i386-elf
75endif
76ifeq ($(BOARD),ixp4xx)
77  HAL_TARGET:=xscale-be-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi)
78endif
79ifeq ($(BOARD),iop32x)
80  HAL_TARGET:=xscale-le-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi)
81endif
82ifeq ($(BOARD),kirkwood)
83  HAL_TARGET:=xscale-le-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi)
84endif
85ifeq ($(BOARD),orion)
86  HAL_TARGET:=xscale-le-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi)
87endif
88ifeq ($(ARCH),powerpc)
89  HAL_TARGET:=powerpc-be-elf
90endif
91ifneq ($(CONFIG_TARGET_atheros),)
92  HAL_TARGET:=wisoc
93endif
94
95ifdef CONFIG_MADWIFI_RCA_MINSTREL
96  RATE_CONTROL:=minstrel
97endif
98
99ifdef CONFIG_MADWIFI_RCA_ONOE
100  RATE_CONTROL:=onoe
101endif
102
103ifdef CONFIG_MADWIFI_RCA_AMRR
104  RATE_CONTROL:=amrr
105endif
106
107ifdef CONFIG_MADWIFI_RCA_SAMPLERATE
108  RATE_CONTROL:=sample
109endif
110
111ifneq ($(CONFIG_MADWIFI_SINGLE_MODULE),)
112MADWIFI_FILES:= $(PKG_BUILD_DIR)/ath_hal/ath_hal.$(LINUX_KMOD_SUFFIX)
113else
114MADWIFI_FILES:= \
115        $(PKG_BUILD_DIR)/net80211/wlan.$(LINUX_KMOD_SUFFIX) \
116        $(PKG_BUILD_DIR)/net80211/wlan_scan_ap.$(LINUX_KMOD_SUFFIX) \
117        $(PKG_BUILD_DIR)/net80211/wlan_scan_sta.$(LINUX_KMOD_SUFFIX) \
118        $(PKG_BUILD_DIR)/ath_hal/ath_hal.$(LINUX_KMOD_SUFFIX) \
119        $(PKG_BUILD_DIR)/ath_rate/$(RATE_CONTROL)/ath_rate_$(RATE_CONTROL).$(LINUX_KMOD_SUFFIX) \
120        $(PKG_BUILD_DIR)/net80211/wlan_acl.$(LINUX_KMOD_SUFFIX) \
121        $(PKG_BUILD_DIR)/net80211/wlan_ccmp.$(LINUX_KMOD_SUFFIX) \
122        $(PKG_BUILD_DIR)/net80211/wlan_tkip.$(LINUX_KMOD_SUFFIX) \
123        $(PKG_BUILD_DIR)/net80211/wlan_wep.$(LINUX_KMOD_SUFFIX) \
124        $(PKG_BUILD_DIR)/net80211/wlan_xauth.$(LINUX_KMOD_SUFFIX)
125endif
126
127ifneq ($(CONFIG_MADWIFI_SINGLE_MODULE),)
128  MADWIFI_AUTOLOAD:= ath_hal
129else
130  MADWIFI_AUTOLOAD:= \
131        wlan \
132        wlan_scan_ap \
133        wlan_scan_sta \
134        ath_hal \
135        ath_rate_$(RATE_CONTROL) \
136        wlan_acl \
137        wlan_ccmp \
138        wlan_tkip \
139        wlan_wep \
140        wlan_xauth
141endif
142
143ifeq ($(findstring AHB,$(BUS)),AHB)
144  MADWIFI_FILES+= $(PKG_BUILD_DIR)/ath/ath_ahb.$(LINUX_KMOD_SUFFIX)
145  MADWIFI_AUTOLOAD+= ath_ahb
146endif
147ifeq ($(findstring PCI,$(BUS)),PCI)
148  MADWIFI_FILES+= $(PKG_BUILD_DIR)/ath/ath_pci.$(LINUX_KMOD_SUFFIX)
149  MADWIFI_AUTOLOAD+= ath_pci
150endif
151
152MADWIFI_APPLETS:=80211stats athchans athkey athstats wlanconfig ath_info madwifi_multi
153ifdef CONFIG_MADWIFI_DEBUG
154  MADWIFI_APPLETS += athdebug 80211debug
155endif
156
157define KernelPackage/madwifi
158  SUBMENU:=Wireless Drivers
159  TITLE:=Driver for Atheros wireless chipsets
160  URL:=http://madwifi-project.org/
161  MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
162  DEPENDS:=+wireless-tools @LINUX_2_6 @PCI_SUPPORT @(!(TARGET_avr32||TARGET_cobalt||TARGET_ep93xx||TARGET_octeon||TARGET_pxcab||TARGET_sibyte)||BROKEN)
163  FILES:=$(MADWIFI_FILES)
164  AUTOLOAD:=$(call AutoLoad,50,$(MADWIFI_AUTOLOAD))
165  MENU:=1
166endef
167
168define KernelPackage/madwifi/description
169 This package contains a driver for Atheros 802.11a/b/g chipsets.
170endef
171
172define KernelPackage/madwifi/config
173        source "$(SOURCE)/Config.in"
174endef
175
176MADWIFI_INC = \
177        -I$(PKG_BUILD_DIR) \
178        -I$(PKG_BUILD_DIR)/include \
179        -I$(PKG_BUILD_DIR)/hal \
180        -I$(PKG_BUILD_DIR)/ath \
181        -I$(PKG_BUILD_DIR)/ath_hal \
182        -I$(PKG_BUILD_DIR)/net80211 \
183        -I$(STAGING_DIR)/usr/include/wprobe \
184        -include $(PKG_BUILD_DIR)/include/compat.h
185
186MAKE_ARGS:= \
187        PATH="$(TARGET_PATH)" \
188        ARCH="$(LINUX_KARCH)" \
189        ARCH-y="$(LINUX_KARCH)" \
190        CROSS_COMPILE="$(TARGET_CROSS)" \
191        TARGET="$(HAL_TARGET)" \
192        TOOLPREFIX="$(KERNEL_CROSS)" \
193        TOOLPATH="$(KERNEL_CROSS)" \
194        KERNELPATH="$(LINUX_DIR)" \
195        LDOPTS="--no-warn-mismatch " \
196        ATH_RATE="$(RATE_CONTROL)" \
197        ATH_CAP_SUPERG_COMP="$(COMPRESSION)" \
198        DO_MULTI=1 \
199        SINGLE_MODULE=$(if $(CONFIG_MADWIFI_SINGLE_MODULE),1) \
200        INCS="$(MADWIFI_INC)" \
201        $(if $(CONFIG_MADWIFI_DEBUG),,DEBUG=) WARNINGS="-Wno-unused"
202
203MAKE_VARS:= \
204        COPTS="-DATH_REVERSE_ENGINEERING=1" \
205
206define Build/Prepare/HAL
207        rm -rf $(PKG_BUILD_DIR)/tmp
208        mkdir -p $(PKG_BUILD_DIR)/tmp
209        tar xvzf $(DL_DIR)/$(HAL_FILE) -C $(PKG_BUILD_DIR)/tmp
210        $(CP) $(PKG_BUILD_DIR)/tmp/ath_hal*/* $(PKG_BUILD_DIR)/hal/
211        rm -rf $(PKG_BUILD_DIR)/tmp
212endef
213
214define Build/Prepare
215        $(call Build/Prepare/Default)
216        $(call Build/Prepare/HAL)
217        # patch cflags
218        $(SED) 's, -E[LB],,' \
219                -e 's, -mips2,,' \
220                -e 's, -mapcs-32,,' \
221                -e 's, -mlong-calls,,' \
222                $(PKG_BUILD_DIR)/hal/public/*.inc
223        $(SED) 's,march=armv4,march=armv5te,' \
224                $(PKG_BUILD_DIR)/hal/public/xscale*.inc
225endef
226
227ifeq ($(findstring AHB,$(BUS)),AHB)
228  define Build/Compile/ahb
229        $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) BUS="AHB" modules
230        $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) CFLAGS="$(TARGET_CFLAGS)" tools
231  endef
232endif
233
234ifeq ($(findstring PCI,$(BUS)),PCI)
235  define Build/Compile/pci
236        $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) BUS="PCI" modules
237        $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) CFLAGS="$(TARGET_CFLAGS)" tools
238  endef
239endif
240
241define Build/Configure
242        $(SED) 's,-E[LB] ,,g' $(PKG_BUILD_DIR)/hal/public/*.inc
243endef
244
245define Build/Compile
246        $(call Build/Compile/ahb)
247        $(call Build/Compile/pci)
248endef
249
250define Build/InstallDev
251        mkdir -p $(1)/usr/include/madwifi
252        $(CP) $(PKG_BUILD_DIR)/include $(1)/usr/include/madwifi/
253        mkdir -p $(1)/usr/include/madwifi/net80211
254        $(CP) $(PKG_BUILD_DIR)/net80211/*.h $(1)/usr/include/madwifi/net80211/
255endef
256
257define KernelPackage/madwifi/install
258        $(INSTALL_DIR) $(1)/usr/sbin
259        $(CP) ./files/* $(1)/
260        $(CP) $(foreach applet,$(MADWIFI_APPLETS),$(PKG_BUILD_DIR)/tools/$(applet)) $(1)/usr/sbin/
261endef
262
263$(eval $(call KernelPackage,madwifi))
Note: See TracBrowser for help on using the repository browser.