skip a lot of useless junk in madwifi on linux 2.4
[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 ifeq ($(ARCH),powerpc)
36 HAL_TARGET:=powerpc-be-elf
37 endif
38
39 BUS := PCI
40 ifneq ($(CONFIG_LINUX_2_4_AR531X),)
41 BUS := AHB
42 endif
43 ifneq ($(CONFIG_LINUX_2_6_ARUBA),)
44 BUS := PCI AHB # no suitable HAL for AHB yet.
45 endif
46
47 BUS_MODULES:=
48 ifeq ($(findstring AHB,$(BUS)),AHB)
49 BUS_MODULES+=$(PKG_BUILD_DIR)/ath/ath_ahb.$(LINUX_KMOD_SUFFIX)
50 endif
51 ifeq ($(findstring PCI,$(BUS)),PCI)
52 BUS_MODULES+=$(PKG_BUILD_DIR)/ath/ath_pci.$(LINUX_KMOD_SUFFIX)
53 endif
54
55 MADWIFI_MAKEOPTS= -C $(PKG_BUILD_DIR) \
56 ARCH="$(LINUX_KARCH)" \
57 CROSS_COMPILE="$(TARGET_CROSS)" \
58 CC="$(TARGET_CC)" \
59 TARGET="$(HAL_TARGET)" \
60 TOOLPREFIX="$(KERNEL_CROSS)" \
61 TOOLPATH="$(KERNEL_CROSS)" \
62 KERNELPATH="$(LINUX_DIR)" \
63 LDOPTS="" \
64 DOMULTI=1
65
66 include $(INCLUDE_DIR)/package.mk
67
68 ifeq ($(findstring AHB,$(BUS)),AHB)
69 define Build/Compile/ahb
70 $(MAKE) $(MADWIFI_MAKEOPTS) BUS="AHB" all
71 endef
72 endif
73
74 ifeq ($(findstring PCI,$(BUS)),PCI)
75 define Build/Compile/pci
76 $(MAKE) $(MADWIFI_MAKEOPTS) BUS="PCI" all
77 endef
78 endif
79
80 define Build/Compile
81 $(call Build/Compile/ahb)
82 $(call Build/Compile/pci)
83 endef
84
85 define Build/InstallDev
86 mkdir -p $(STAGING_DIR)/usr/include/madwifi
87 $(CP) $(PKG_BUILD_DIR)/include $(STAGING_DIR)/usr/include/madwifi/
88 mkdir -p $(STAGING_DIR)/usr/include/madwifi/net80211
89 $(CP) $(PKG_BUILD_DIR)/net80211/*.h $(STAGING_DIR)/usr/include/madwifi/net80211/
90 endef
91
92 define Build/UninstallDev
93 rm -rf $(STAGING_DIR)/usr/include/madwifi
94 endef
95
96 define Package/kmod-madwifi
97 SECTION:=drivers
98 CATEGORY:=Drivers
99 DEFAULT:=y if LINUX_2_6_BRCM || LINUX_2_6_ARUBA || LINUX_2_4_AR531X || LINUX_2_6_XSCALE, m if ALL
100 TITLE:=Driver for Atheros wireless chipsets
101 DESCRIPTION:=Driver for Atheros 802.11a/b/g chipsets
102 URL:=http://madwifi.org/
103 VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE)
104 endef
105
106 define Package/kmod-madwifi/install
107 mkdir -p $(1)/etc/modules.d
108 mkdir -p $(1)/etc/init.d
109 mkdir -p $(1)/lib/modules/$(LINUX_VERSION)
110 mkdir -p $(1)/usr/sbin
111 install -m0644 ./files/madwifi.modules $(1)/etc/modules.d/20-madwifi
112 ifeq ($(findstring AHB,$(BUS)),AHB)
113 echo ath_ahb >> $(1)/etc/modules.d/20-madwifi
114 endif
115 ifeq ($(findstring PCI,$(BUS)),PCI)
116 echo ath_pci >> $(1)/etc/modules.d/20-madwifi
117 endif
118 install -m0755 ./files/madwifi.init $(1)/etc/init.d/S20madwifi
119 $(CP) \
120 $(PKG_BUILD_DIR)/ath_hal/ath_hal.$(LINUX_KMOD_SUFFIX) \
121 $(BUS_MODULES) \
122 $(PKG_BUILD_DIR)/ath_rate/sample/ath_rate_sample.$(LINUX_KMOD_SUFFIX) \
123 $(PKG_BUILD_DIR)/net80211/wlan*.$(LINUX_KMOD_SUFFIX) \
124 $(1)/lib/modules/$(LINUX_VERSION)/
125 $(CP) $(PKG_BUILD_DIR)/tools/{madwifi_multi,80211debug,80211stats,athchans,athctrl,athdebug,athkey,athstats,wlanconfig} $(1)/usr/sbin/
126 endef
127
128 $(eval $(call BuildPackage,kmod-madwifi))
This page took 0.087776 seconds and 5 git commands to generate.