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

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

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

  • Property svn:copyright set to Copyright (C) 2006 OpenWrt.org
  • Property svn:eol-style set to native
File size: 6.6 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),kirkwood)
80  HAL_TARGET:=xscale-le-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi)
81endif
82ifeq ($(BOARD),orion)
83  HAL_TARGET:=xscale-le-elf$(if $(CONFIG_EABI_SUPPORT),gnueabi)
84endif
85ifeq ($(ARCH),powerpc)
86  HAL_TARGET:=powerpc-be-elf
87endif
88ifneq ($(CONFIG_TARGET_atheros),)
89  HAL_TARGET:=wisoc
90endif
91
92ifdef CONFIG_MADWIFI_RCA_MINSTREL
93  RATE_CONTROL:=minstrel
94endif
95
96ifdef CONFIG_MADWIFI_RCA_ONOE
97  RATE_CONTROL:=onoe
98endif
99
100ifdef CONFIG_MADWIFI_RCA_AMRR
101  RATE_CONTROL:=amrr
102endif
103
104ifdef CONFIG_MADWIFI_RCA_SAMPLERATE
105  RATE_CONTROL:=sample
106endif
107
108ifneq ($(CONFIG_MADWIFI_SINGLE_MODULE),)
109MADWIFI_FILES:= $(PKG_BUILD_DIR)/ath_hal/ath_hal.$(LINUX_KMOD_SUFFIX)
110else
111MADWIFI_FILES:= \
112        $(PKG_BUILD_DIR)/net80211/wlan.$(LINUX_KMOD_SUFFIX) \
113        $(PKG_BUILD_DIR)/net80211/wlan_scan_ap.$(LINUX_KMOD_SUFFIX) \
114        $(PKG_BUILD_DIR)/net80211/wlan_scan_sta.$(LINUX_KMOD_SUFFIX) \
115        $(PKG_BUILD_DIR)/ath_hal/ath_hal.$(LINUX_KMOD_SUFFIX) \
116        $(PKG_BUILD_DIR)/ath_rate/$(RATE_CONTROL)/ath_rate_$(RATE_CONTROL).$(LINUX_KMOD_SUFFIX) \
117        $(PKG_BUILD_DIR)/net80211/wlan_acl.$(LINUX_KMOD_SUFFIX) \
118        $(PKG_BUILD_DIR)/net80211/wlan_ccmp.$(LINUX_KMOD_SUFFIX) \
119        $(PKG_BUILD_DIR)/net80211/wlan_tkip.$(LINUX_KMOD_SUFFIX) \
120        $(PKG_BUILD_DIR)/net80211/wlan_wep.$(LINUX_KMOD_SUFFIX) \
121        $(PKG_BUILD_DIR)/net80211/wlan_xauth.$(LINUX_KMOD_SUFFIX)
122endif
123
124ifneq ($(CONFIG_MADWIFI_SINGLE_MODULE),)
125  MADWIFI_AUTOLOAD:= ath_hal
126else
127  MADWIFI_AUTOLOAD:= \
128        wlan \
129        wlan_scan_ap \
130        wlan_scan_sta \
131        ath_hal \
132        ath_rate_$(RATE_CONTROL) \
133        wlan_acl \
134        wlan_ccmp \
135        wlan_tkip \
136        wlan_wep \
137        wlan_xauth
138endif
139
140ifeq ($(findstring AHB,$(BUS)),AHB)
141  MADWIFI_FILES+= $(PKG_BUILD_DIR)/ath/ath_ahb.$(LINUX_KMOD_SUFFIX)
142  MADWIFI_AUTOLOAD+= ath_ahb
143endif
144ifeq ($(findstring PCI,$(BUS)),PCI)
145  MADWIFI_FILES+= $(PKG_BUILD_DIR)/ath/ath_pci.$(LINUX_KMOD_SUFFIX)
146  MADWIFI_AUTOLOAD+= ath_pci
147endif
148
149MADWIFI_APPLETS:=80211stats athchans athkey athstats wlanconfig ath_info madwifi_multi
150ifdef CONFIG_MADWIFI_DEBUG
151  MADWIFI_APPLETS += athdebug 80211debug
152endif
153
154define KernelPackage/madwifi
155  SUBMENU:=Wireless Drivers
156  TITLE:=Driver for Atheros wireless chipsets
157  URL:=http://madwifi-project.org/
158  MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
159  DEPENDS:=+wireless-tools @LINUX_2_6 @PCI_SUPPORT @(!(TARGET_avr32||TARGET_cobalt||TARGET_ep93xx||TARGET_octeon)||BROKEN)
160  FILES:=$(MADWIFI_FILES)
161  AUTOLOAD:=$(call AutoLoad,50,$(MADWIFI_AUTOLOAD))
162  MENU:=1
163endef
164
165define KernelPackage/madwifi/description
166 This package contains a driver for Atheros 802.11a/b/g chipsets.
167endef
168
169define KernelPackage/madwifi/config
170        source "$(SOURCE)/Config.in"
171endef
172
173MADWIFI_INC = \
174        -I$(PKG_BUILD_DIR) \
175        -I$(PKG_BUILD_DIR)/include \
176        -I$(PKG_BUILD_DIR)/hal \
177        -I$(PKG_BUILD_DIR)/ath \
178        -I$(PKG_BUILD_DIR)/ath_hal \
179        -I$(PKG_BUILD_DIR)/net80211 \
180        -I$(STAGING_DIR)/usr/include/wprobe \
181        -include $(PKG_BUILD_DIR)/include/compat.h
182
183MAKE_ARGS:= \
184        PATH="$(TARGET_PATH)" \
185        ARCH="$(LINUX_KARCH)" \
186        ARCH-y="$(LINUX_KARCH)" \
187        CROSS_COMPILE="$(TARGET_CROSS)" \
188        TARGET="$(HAL_TARGET)" \
189        TOOLPREFIX="$(KERNEL_CROSS)" \
190        TOOLPATH="$(KERNEL_CROSS)" \
191        KERNELPATH="$(LINUX_DIR)" \
192        LDOPTS="--no-warn-mismatch " \
193        ATH_RATE="$(RATE_CONTROL)" \
194        ATH_CAP_SUPERG_COMP="$(COMPRESSION)" \
195        DO_MULTI=1 \
196        SINGLE_MODULE=$(if $(CONFIG_MADWIFI_SINGLE_MODULE),1) \
197        INCS="$(MADWIFI_INC)" \
198        $(if $(CONFIG_MADWIFI_DEBUG),,DEBUG=) WARNINGS="-Wno-unused"
199
200MAKE_VARS:= \
201        COPTS="-DATH_REVERSE_ENGINEERING=1" \
202
203define Build/Prepare/HAL
204        rm -rf $(PKG_BUILD_DIR)/tmp
205        mkdir -p $(PKG_BUILD_DIR)/tmp
206        tar xvzf $(DL_DIR)/$(HAL_FILE) -C $(PKG_BUILD_DIR)/tmp
207        $(CP) $(PKG_BUILD_DIR)/tmp/ath_hal*/* $(PKG_BUILD_DIR)/hal/
208        rm -rf $(PKG_BUILD_DIR)/tmp
209endef
210
211define Build/Prepare
212        $(call Build/Prepare/Default)
213        $(call Build/Prepare/HAL)
214        # patch cflags
215        $(SED) 's, -E[LB],,' \
216                -e 's, -mips2,,' \
217                -e 's, -mapcs-32,,' \
218                -e 's, -mlong-calls,,' \
219                $(PKG_BUILD_DIR)/hal/public/*.inc
220        $(SED) 's,march=armv4,march=armv5te,' \
221                $(PKG_BUILD_DIR)/hal/public/xscale*.inc
222endef
223
224ifeq ($(findstring AHB,$(BUS)),AHB)
225  define Build/Compile/ahb
226        $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) BUS="AHB" modules
227        $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) CFLAGS="$(TARGET_CFLAGS)" tools
228  endef
229endif
230
231ifeq ($(findstring PCI,$(BUS)),PCI)
232  define Build/Compile/pci
233        $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) BUS="PCI" modules
234        $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) CFLAGS="$(TARGET_CFLAGS)" tools
235  endef
236endif
237
238define Build/Configure
239        $(SED) 's,-E[LB] ,,g' $(PKG_BUILD_DIR)/hal/public/*.inc
240endef
241
242define Build/Compile
243        $(call Build/Compile/ahb)
244        $(call Build/Compile/pci)
245endef
246
247define Build/InstallDev
248        mkdir -p $(1)/usr/include/madwifi
249        $(CP) $(PKG_BUILD_DIR)/include $(1)/usr/include/madwifi/
250        mkdir -p $(1)/usr/include/madwifi/net80211
251        $(CP) $(PKG_BUILD_DIR)/net80211/*.h $(1)/usr/include/madwifi/net80211/
252endef
253
254define KernelPackage/madwifi/install
255        $(INSTALL_DIR) $(1)/usr/sbin
256        $(CP) ./files/* $(1)/
257        $(CP) $(foreach applet,$(MADWIFI_APPLETS),$(PKG_BUILD_DIR)/tools/$(applet)) $(1)/usr/sbin/
258endef
259
260$(eval $(call KernelPackage,madwifi))
Note: See TracBrowser for help on using the repository browser.