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