source: trunk/package/madwifi/Makefile @ 8803

Last change on this file since 8803 was 8803, checked in by nico, 9 years ago

don't assume PCI support, cleanup

  • 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: 4.1 KB
Line 
1#
2# Copyright (C) 2006 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
13PKG_VERSION:=r2568-20070710
14PKG_BRANCH:=madwifi-ng
15PKG_RELEASE:=2
16
17PKG_SOURCE:=$(PKG_BRANCH)-$(PKG_VERSION).tar.gz
18PKG_SOURCE_URL:=http://snapshots.madwifi.org/$(PKG_BRANCH)
19PKG_MD5SUM:=fe5d41acd085d2c46934be3f8839e694
20
21PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_BRANCH)-$(PKG_VERSION)
22
23include $(INCLUDE_DIR)/package.mk
24
25ifeq ($(ARCH),mips)
26  HAL_TARGET:=mips-be-elf
27endif
28ifeq ($(ARCH),mipsel)
29  HAL_TARGET:=mips-le-elf
30endif
31ifeq ($(ARCH),i386)
32  HAL_TARGET:=i386-elf
33endif
34ifeq ($(ARCH),armeb)
35  HAL_TARGET:=xscale-be-elf
36endif
37ifeq ($(ARCH),arm)
38  HAL_TARGET:=xscale-le-elf
39endif
40ifeq ($(ARCH),powerpc)
41  HAL_TARGET:=powerpc-be-elf
42endif
43
44ifneq ($(CONFIG_TARGET_atheros),)
45  BUS:=AHB
46  HAL_TARGET:=ap51
47else
48  ifneq ($(CONFIG_PCI_SUPPORT),)
49    BUS:=PCI
50  endif
51endif
52
53RATE_CONTROL:=minstrel
54
55MADWIFI_FILES:= \
56        $(PKG_BUILD_DIR)/net80211/wlan.$(LINUX_KMOD_SUFFIX) \
57        $(PKG_BUILD_DIR)/net80211/wlan_scan_ap.$(LINUX_KMOD_SUFFIX) \
58        $(PKG_BUILD_DIR)/net80211/wlan_scan_sta.$(LINUX_KMOD_SUFFIX) \
59        $(PKG_BUILD_DIR)/ath_hal/ath_hal.$(LINUX_KMOD_SUFFIX) \
60        $(PKG_BUILD_DIR)/ath_rate/$(RATE_CONTROL)/ath_rate_$(RATE_CONTROL).$(LINUX_KMOD_SUFFIX) \
61        $(PKG_BUILD_DIR)/net80211/wlan_acl.$(LINUX_KMOD_SUFFIX) \
62        $(PKG_BUILD_DIR)/net80211/wlan_ccmp.$(LINUX_KMOD_SUFFIX) \
63        $(PKG_BUILD_DIR)/net80211/wlan_tkip.$(LINUX_KMOD_SUFFIX) \
64        $(PKG_BUILD_DIR)/net80211/wlan_wep.$(LINUX_KMOD_SUFFIX) \
65        $(PKG_BUILD_DIR)/net80211/wlan_xauth.$(LINUX_KMOD_SUFFIX) \
66
67MADWIFI_AUTOLOAD:= \
68        wlan \
69        wlan_scan_ap \
70        wlan_scan_sta \
71        ath_hal \
72        ath_rate_$(RATE_CONTROL) \
73        wlan_acl \
74        wlan_ccmp \
75        wlan_tkip \
76        wlan_wep \
77        wlan_xauth \
78
79ifeq ($(findstring AHB,$(BUS)),AHB)
80        MADWIFI_FILES+= $(PKG_BUILD_DIR)/ath/ath_ahb.$(LINUX_KMOD_SUFFIX)
81        MADWIFI_AUTOLOAD+= ath_ahb
82endif
83ifeq ($(findstring PCI,$(BUS)),PCI)
84        MADWIFI_FILES+= $(PKG_BUILD_DIR)/ath/ath_pci.$(LINUX_KMOD_SUFFIX)
85        MADWIFI_AUTOLOAD+= ath_pci
86endif
87
88define KernelPackage/madwifi
89  SUBMENU:=Wireless Drivers
90  TITLE:=Driver for Atheros wireless chipsets
91  URL:=http://madwifi.org/
92  DEPENDS:=+wireless-tools @PCI_SUPPORT||TARGET_atheros @!TARGET_avr32 @!TARGET_etrax
93  FILES:=$(MADWIFI_FILES)
94  AUTOLOAD:=$(call AutoLoad,50,$(MADWIFI_AUTOLOAD))
95endef
96
97define KernelPackage/madwifi/description
98 This package contains a driver for Atheros 802.11a/b/g chipsets.
99endef
100
101MAKE_ARGS:= \
102        PATH="$(TARGET_PATH)" \
103        ARCH="$(LINUX_KARCH)" \
104        CROSS_COMPILE="$(TARGET_CROSS)" \
105        TARGET="$(HAL_TARGET)" \
106        TOOLPREFIX="$(KERNEL_CROSS)" \
107        TOOLPATH="$(KERNEL_CROSS)" \
108        KERNELPATH="$(LINUX_DIR)" \
109        LDOPTS="--no-warn-mismatch " \
110        ATH_RATE="ath_rate/$(RATE_CONTROL)" \
111        WARNINGS="" \
112        DOMULTI=1
113
114MAKE_VARS:= \
115        COPTS="-DCONFIG_ATHEROS_RATE_DEFAULT='\"$(RATE_CONTROL)\"'" \
116
117ifeq ($(findstring AHB,$(BUS)),AHB)
118  define Build/Compile/ahb
119        $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) BUS="AHB" modules
120        $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) CFLAGS="$(TARGET_CFLAGS)" tools
121  endef
122endif
123
124ifeq ($(findstring PCI,$(BUS)),PCI)
125  define Build/Compile/pci
126        $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) BUS="PCI" modules
127        $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) CFLAGS="$(TARGET_CFLAGS)" tools
128  endef
129endif
130
131define Build/Configure
132        $(SED) 's,-E[LB] ,,g' $(PKG_BUILD_DIR)/hal/public/*.inc
133endef
134
135define Build/Compile
136        $(call Build/Compile/ahb)
137        $(call Build/Compile/pci)
138endef
139
140define Build/InstallDev
141        mkdir -p $(STAGING_DIR)/usr/include/madwifi
142        $(CP) $(PKG_BUILD_DIR)/include $(STAGING_DIR)/usr/include/madwifi/
143        mkdir -p $(STAGING_DIR)/usr/include/madwifi/net80211
144        $(CP) $(PKG_BUILD_DIR)/net80211/*.h $(STAGING_DIR)/usr/include/madwifi/net80211/
145endef
146
147define Build/UninstallDev
148        rm -rf  $(STAGING_DIR)/usr/include/madwifi
149endef
150
151define KernelPackage/madwifi/install
152        $(INSTALL_DIR) $(1)/lib/wifi
153        $(INSTALL_DATA) ./files/lib/wifi/madwifi.sh $(1)/lib/wifi
154        $(INSTALL_DIR) $(1)/usr/sbin
155        $(CP) $(PKG_BUILD_DIR)/tools/{madwifi_multi,80211stats,athchans,athctrl,athkey,athstats,wlanconfig} $(1)/usr/sbin/
156endef
157
158$(eval $(call KernelPackage,madwifi))
Note: See TracBrowser for help on using the repository browser.