380ec4ad611e4fcadc45e27816025fa399302dfd
[openwrt.git] / package / madwifi / Makefile
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
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=madwifi
13 PKG_VERSION:=0.9.0
14 PKG_RELEASE:=1
15 PKG_MD5SUM:=9b558d1df84cab2b0006c595feee0fba
16
17 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
19 PKG_CAT:=bzcat
20
21 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22
23 ifeq ($(ARCH),mips)
24 HAL_TARGET:=mips-be-elf
25 endif
26 ifeq ($(ARCH),mipsel)
27 HAL_TARGET:=mips-le-elf
28 endif
29 ifeq ($(ARCH),i386)
30 HAL_TARGET:=i386-elf
31 endif
32 ifeq ($(ARCH),armeb)
33 HAL_TARGET:=xscale-be-elf
34 endif
35
36 BUS := PCI
37 ifneq ($(CONFIG_LINUX_2_4_AR531X),)
38 BUS := AHB
39 endif
40 ifneq ($(CONFIG_LINUX_2_6_ARUBA),)
41 BUS := PCI AHB # no suitable HAL for AHB yet.
42 endif
43
44 BUS_MODULES:=
45 ifeq ($(findstring AHB,$(BUS)),AHB)
46 BUS_MODULES+=$(PKG_BUILD_DIR)/ath/ath_ahb.$(LINUX_KMOD_SUFFIX)
47 endif
48 ifeq ($(findstring PCI,$(BUS)),PCI)
49 BUS_MODULES+=$(PKG_BUILD_DIR)/ath/ath_pci.$(LINUX_KMOD_SUFFIX)
50 endif
51
52 MADWIFI_MAKEOPTS= -C $(PKG_BUILD_DIR) \
53 ARCH="$(LINUX_KARCH)" \
54 CROSS_COMPILE="$(TARGET_CROSS)" \
55 CC="$(TARGET_CC)" \
56 TARGET="$(HAL_TARGET)" \
57 TOOLPREFIX="$(KERNEL_CROSS)" \
58 TOOLPATH="$(KERNEL_CROSS)" \
59 KERNELPATH="$(LINUX_DIR)" \
60 LDOPTS="" \
61 DOMULTI=1
62
63 include $(INCLUDE_DIR)/package.mk
64
65 ifeq ($(findstring AHB,$(BUS)),AHB)
66 define Build/Compile/ahb
67 $(MAKE) $(MADWIFI_MAKEOPTS) BUS="AHB" all
68 endef
69 endif
70
71 ifeq ($(findstring PCI,$(BUS)),PCI)
72 define Build/Compile/pci
73 $(MAKE) $(MADWIFI_MAKEOPTS) BUS="PCI" all
74 endef
75 endif
76
77 define Build/Compile
78 $(call Build/Compile/ahb)
79 $(call Build/Compile/pci)
80 endef
81
82 define Build/InstallDev
83 mkdir -p $(STAGING_DIR)/usr/include/madwifi
84 $(CP) $(PKG_BUILD_DIR)/include $(STAGING_DIR)/usr/include/madwifi/
85 mkdir -p $(STAGING_DIR)/usr/include/madwifi/net80211
86 $(CP) $(PKG_BUILD_DIR)/net80211/*.h $(STAGING_DIR)/usr/include/madwifi/net80211/
87 endef
88
89 define Build/UninstallDev
90 rm -rf $(STAGING_DIR)/usr/include/madwifi
91 endef
92
93 define Package/kmod-madwifi
94 SECTION:=drivers
95 CATEGORY:=Drivers
96 DEFAULT:=y if LINUX_2_6_BRCM || LINUX_2_6_ARUBA || LINUX_2_4_AR531X || LINUX_2_6_XSCALE, m if ALL
97 TITLE:=Driver for Atheros wireless chipsets
98 DESCRIPTION:=Driver for Atheros 802.11a/b/g chipsets
99 URL:=http://madwifi.org/
100 VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE)
101 endef
102
103 define Package/kmod-madwifi/install
104 mkdir -p $(1)/etc/modules.d
105 mkdir -p $(1)/etc/init.d
106 mkdir -p $(1)/lib/modules/$(LINUX_VERSION)
107 mkdir -p $(1)/usr/sbin
108 install -m0644 ./files/madwifi.modules $(1)/etc/modules.d/20-madwifi
109 ifeq ($(findstring AHB,$(BUS)),AHB)
110 echo ath_ahb >> $(1)/etc/modules.d/20-madwifi
111 endif
112 ifeq ($(findstring PCI,$(BUS)),PCI)
113 echo ath_pci >> $(1)/etc/modules.d/20-madwifi
114 endif
115 install -m0755 ./files/madwifi.init $(1)/etc/init.d/S20madwifi
116 $(CP) \
117 $(PKG_BUILD_DIR)/ath_hal/ath_hal.$(LINUX_KMOD_SUFFIX) \
118 $(BUS_MODULES) \
119 $(PKG_BUILD_DIR)/ath_rate/sample/ath_rate_sample.$(LINUX_KMOD_SUFFIX) \
120 $(PKG_BUILD_DIR)/net80211/*.$(LINUX_KMOD_SUFFIX) \
121 $(1)/lib/modules/$(LINUX_VERSION)/
122 $(CP) $(PKG_BUILD_DIR)/tools/{madwifi_multi,80211debug,80211stats,athchans,athctrl,athdebug,athkey,athstats,wlanconfig} $(1)/usr/sbin/
123 endef
124
125 $(eval $(call BuildPackage,kmod-madwifi))
This page took 0.058857 seconds and 3 git commands to generate.