source: branches/8.09/package/madwifi/Makefile @ 14312

Last change on this file since 14312 was 14312, checked in by agb, 7 years ago

merge r14306, r14307, r14309, and r14311 to 8.09:
[package] broadcom,madwifi,mac80211: move txpower from wifi-iface to wifi-device but retain backward compatiblity

  • Property svn:copyright set to Copyright (C) 2006 OpenWrt.org
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.5 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# $Id$
8
9include $(TOPDIR)/rules.mk
10include $(INCLUDE_DIR)/kernel.mk
11
12PKG_NAME:=madwifi
13
14ifneq ($(CONFIG_MADWIFI_UPSTREAM),)
15  PKG_VERSION:=0.9.4
16  PKG_RELEASE:=2
17
18  PKG_SOURCE:=madwifi-$(PKG_VERSION).tar.gz
19  PKG_SOURCE_URL:=http://downloads.sourceforge.net/madwifi/
20  PKG_MD5SUM:=399d20de8d855a59f20058857c2178ad
21
22  PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/madwifi-$(PKG_VERSION)
23
24  PATCH_DIR=./patches-upstream
25else
26# PKG_BRANCH:=madwifi-dfs
27  PKG_REV:=3314
28  PKG_VERSION:=r$(PKG_REV)
29  PKG_RELEASE:=2
30
31  PKG_SOURCE_PROTO:=svn
32  PKG_SOURCE_VERSION:=$(PKG_REV)
33  PKG_SOURCE_SUBDIR:=$(if $(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION)
34  PKG_SOURCE_URL:=http://svn.madwifi.org/madwifi/$(if $(PKG_BRANCH),branches/$(PKG_BRANCH),trunk)
35  PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
36
37  PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(PKG_BRANCH),$(PKG_BRANCH),madwifi-trunk)-$(PKG_VERSION)
38
39  PATCH_DIR=./patches
40endif
41
42include $(INCLUDE_DIR)/package.mk
43
44ifneq ($(CONFIG_TARGET_atheros),)
45  BUS:=AHB
46else
47  ifneq ($(CONFIG_PCI_SUPPORT),)
48    BUS:=PCI
49  endif
50endif
51
52# XXX: remove this check later when we have PCI support properly detected on all targets
53ifneq ($(CONFIG_TARGET_ar7)$(CONFIG_TARGET_uml),)
54  BUS:=
55endif
56
57ifneq ($(CONFIG_CPU_MIPS32_R2),)
58  ifeq ($(ARCH),mips)
59    HAL_TARGET:=mips32r2-be-elf
60  endif
61  ifeq ($(ARCH),mipsel)
62    HAL_TARGET:=mips32r2-le-elf
63  endif
64else
65  ifeq ($(ARCH),mips)
66    HAL_TARGET:=$(if $(CONFIG_MADWIFI_UPSTREAM),mips-be-elf,mips32-be-elf)
67  endif
68  ifeq ($(ARCH),mipsel)
69    HAL_TARGET:=$(if $(CONFIG_MADWIFI_UPSTREAM),mips-le-elf,mips32-le-elf)
70  endif
71endif
72ifeq ($(ARCH),i386)
73  HAL_TARGET:=i386-elf
74endif
75ifeq ($(ARCH),i686)
76  HAL_TARGET:=i386-elf
77endif
78ifeq ($(BOARD),ixp4xx)
79  HAL_TARGET:=xscale-be-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi)
80endif
81ifeq ($(BOARD),iop32x)
82  HAL_TARGET:=xscale-le-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi)
83endif
84ifeq ($(BOARD),orion)
85  HAL_TARGET:=xscale-le-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi)
86endif
87ifeq ($(ARCH),powerpc)
88  HAL_TARGET:=powerpc-be-elf
89endif
90ifeq ($(BOARD),storm)
91  HAL_TARGET:=armv4-le-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi)
92endif
93ifneq ($(CONFIG_TARGET_atheros),)
94  HAL_TARGET:=wisoc
95endif
96
97ifdef CONFIG_MADWIFI_RCA_MINSTREL
98  RATE_CONTROL:=minstrel
99endif
100
101ifdef CONFIG_MADWIFI_RCA_ONOE
102  RATE_CONTROL:=onoe
103endif
104
105ifdef CONFIG_MADWIFI_RCA_AMRR
106  RATE_CONTROL:=amrr
107endif
108
109ifdef CONFIG_MADWIFI_RCA_SAMPLERATE
110  RATE_CONTROL:=sample
111endif
112
113MADWIFI_FILES:= \
114        $(PKG_BUILD_DIR)/net80211/wlan.$(LINUX_KMOD_SUFFIX) \
115        $(PKG_BUILD_DIR)/net80211/wlan_scan_ap.$(LINUX_KMOD_SUFFIX) \
116        $(PKG_BUILD_DIR)/net80211/wlan_scan_sta.$(LINUX_KMOD_SUFFIX) \
117        $(PKG_BUILD_DIR)/ath_hal/ath_hal.$(LINUX_KMOD_SUFFIX) \
118        $(PKG_BUILD_DIR)/ath_rate/$(RATE_CONTROL)/ath_rate_$(RATE_CONTROL).$(LINUX_KMOD_SUFFIX) \
119        $(PKG_BUILD_DIR)/net80211/wlan_acl.$(LINUX_KMOD_SUFFIX) \
120        $(PKG_BUILD_DIR)/net80211/wlan_ccmp.$(LINUX_KMOD_SUFFIX) \
121        $(PKG_BUILD_DIR)/net80211/wlan_tkip.$(LINUX_KMOD_SUFFIX) \
122        $(PKG_BUILD_DIR)/net80211/wlan_wep.$(LINUX_KMOD_SUFFIX) \
123        $(PKG_BUILD_DIR)/net80211/wlan_xauth.$(LINUX_KMOD_SUFFIX) \
124
125MADWIFI_AUTOLOAD:= \
126        wlan \
127        wlan_scan_ap \
128        wlan_scan_sta \
129        ath_hal \
130        ath_rate_$(RATE_CONTROL) \
131        wlan_acl \
132        wlan_ccmp \
133        wlan_tkip \
134        wlan_wep \
135        wlan_xauth \
136
137ifeq ($(findstring AHB,$(BUS)),AHB)
138  MADWIFI_FILES+= $(PKG_BUILD_DIR)/ath/ath_ahb.$(LINUX_KMOD_SUFFIX)
139  MADWIFI_AUTOLOAD+= ath_ahb
140endif
141ifeq ($(findstring PCI,$(BUS)),PCI)
142  MADWIFI_FILES+= $(PKG_BUILD_DIR)/ath/ath_pci.$(LINUX_KMOD_SUFFIX)
143  MADWIFI_AUTOLOAD+= ath_pci
144endif
145
146MADWIFI_APPLETS:=80211stats athchans athctrl athkey athstats wlanconfig ath_info
147ifdef CONFIG_MADWIFI_DEBUG
148  MADWIFI_APPLETS += athdebug 80211debug
149endif
150ifndef CONFIG_MADWIFI_UPSTREAM
151  MADWIFI_APPLETS += madwifi_multi
152endif
153
154define KernelPackage/madwifi
155  SUBMENU:=Wireless Drivers
156  TITLE:=Driver for Atheros wireless chipsets
157  URL:=http://madwifi.org/
158  DEPENDS:=+wireless-tools @PCI_SUPPORT||TARGET_atheros @!TARGET_ar7 @!TARGET_avr32 @!TARGET_etrax @!TARGET_uml
159  FILES:=$(MADWIFI_FILES)
160  AUTOLOAD:=$(call AutoLoad,50,$(MADWIFI_AUTOLOAD))
161endef
162
163define KernelPackage/madwifi/description
164 This package contains a driver for Atheros 802.11a/b/g chipsets.
165endef
166
167define KernelPackage/madwifi/config
168        source "$(SOURCE)/Config.in"
169endef
170
171MAKE_ARGS:= \
172        PATH="$(TARGET_PATH)" \
173        ARCH="$(LINUX_KARCH)" \
174        CROSS_COMPILE="$(TARGET_CROSS)" \
175        TARGET="$(HAL_TARGET)" \
176        TOOLPREFIX="$(KERNEL_CROSS)" \
177        TOOLPATH="$(KERNEL_CROSS)" \
178        KERNELPATH="$(LINUX_DIR)" \
179        LDOPTS="--no-warn-mismatch " \
180        ATH_RATE="ath_rate/$(RATE_CONTROL)" \
181        DO_MULTI=1 \
182        $(if $(CONFIG_MADWIFI_DEBUG),,DEBUG=) WARNINGS="-Wno-unused"
183
184MAKE_VARS:= \
185        COPTS="-DCONFIG_ATHEROS_RATE_DEFAULT='\"$(RATE_CONTROL)\"' -DATH_REVERSE_ENGINEERING=1" \
186
187ifeq ($(CONFIG_MADWIFI_UPSTREAM),)
188  HALFILE:=$(lastword $(sort $(wildcard ./ath_hal-*.tgz)))
189endif
190
191ifneq ($(HALFILE),)
192  define Build/Prepare/HAL
193        rm -rf $(PKG_BUILD_DIR)/tmp
194        mkdir -p $(PKG_BUILD_DIR)/tmp
195        tar xvzf $(HALFILE) -C $(PKG_BUILD_DIR)/tmp
196        $(CP) $(PKG_BUILD_DIR)/tmp/ath_hal*/* $(PKG_BUILD_DIR)/hal/
197        rm -rf $(PKG_BUILD_DIR)/tmp
198  endef
199endif
200
201define Build/Prepare
202        $(call Build/Prepare/Default)
203        $(call Build/Prepare/HAL)
204        # patch cflags
205        $(SED) 's, -E[LB],,' \
206                -e 's, -mips2,,' \
207                -e 's, -mapcs-32,,' \
208                $(PKG_BUILD_DIR)/hal/public/*.inc
209        $(SED) 's,march=armv4,march=armv5te,' \
210                $(PKG_BUILD_DIR)/hal/public/xscale*.inc
211endef
212
213ifeq ($(findstring AHB,$(BUS)),AHB)
214  define Build/Compile/ahb
215        $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) BUS="AHB" modules
216        $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) CFLAGS="$(TARGET_CFLAGS)" tools
217  endef
218endif
219
220ifeq ($(findstring PCI,$(BUS)),PCI)
221  define Build/Compile/pci
222        $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) BUS="PCI" modules
223        $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) CFLAGS="$(TARGET_CFLAGS)" tools
224  endef
225endif
226
227define Build/Configure
228        $(SED) 's,-E[LB] ,,g' $(PKG_BUILD_DIR)/hal/public/*.inc
229endef
230
231define Build/Compile
232        $(call Build/Compile/ahb)
233        $(call Build/Compile/pci)
234endef
235
236define Build/InstallDev
237        mkdir -p $(1)/usr/include/madwifi
238        $(CP) $(PKG_BUILD_DIR)/include $(1)/usr/include/madwifi/
239        mkdir -p $(1)/usr/include/madwifi/net80211
240        $(CP) $(PKG_BUILD_DIR)/net80211/*.h $(1)/usr/include/madwifi/net80211/
241endef
242
243define KernelPackage/madwifi/install
244        $(INSTALL_DIR) $(1)/usr/sbin
245        $(CP) ./files/* $(1)/
246        $(CP) $(foreach applet,$(MADWIFI_APPLETS),$(PKG_BUILD_DIR)/tools/$(applet)) $(1)/usr/sbin/
247endef
248
249$(eval $(call KernelPackage,madwifi))
Note: See TracBrowser for help on using the repository browser.