source: trunk/package/madwifi/Makefile @ 5624

Last change on this file since 5624 was 5624, checked in by nbd, 9 years ago

replace lots of manual install commands with INSTALL_* variables

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 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:=0.9.2
14PKG_RELEASE:=1
15
16PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17PKG_SOURCE_URL:=@SF/$(PKG_NAME)
18PKG_MD5SUM:=a75baacbe07085ddc5cb28e1fb43edbb
19PKG_CAT:=bzcat
20
21PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22
23include $(INCLUDE_DIR)/package.mk
24
25RATE_CONTROL:=sample
26
27ifeq ($(ARCH),mips)
28  HAL_TARGET:=mips-be-elf
29endif
30ifeq ($(ARCH),mipsel)
31  HAL_TARGET:=mips-le-elf
32endif
33ifeq ($(ARCH),i386)
34  HAL_TARGET:=i386-elf
35endif
36ifeq ($(ARCH),armeb)
37  HAL_TARGET:=xscale-be-elf
38endif
39ifeq ($(ARCH),powerpc)
40  HAL_TARGET:=powerpc-be-elf
41endif
42
43BUS:=PCI
44ifneq ($(CONFIG_LINUX_2_4_AR531X),)
45  BUS:=AHB
46endif
47ifneq ($(CONFIG_LINUX_2_6_ARUBA),)
48  BUS:=PCI AHB  # no suitable HAL for AHB yet.
49endif
50
51BUS_MODULES:=
52ifeq ($(findstring AHB,$(BUS)),AHB)
53  BUS_MODULES+=$(PKG_BUILD_DIR)/ath/ath_ahb.$(LINUX_KMOD_SUFFIX)
54endif
55ifeq ($(findstring PCI,$(BUS)),PCI)
56  BUS_MODULES+=$(PKG_BUILD_DIR)/ath/ath_pci.$(LINUX_KMOD_SUFFIX)
57endif
58
59MADWIFI_AUTOLOAD:= \
60        wlan \
61        wlan_scan_ap \
62        wlan_scan_sta \
63        ath_hal \
64        ath_rate_$(RATE_CONTROL) \
65        wlan_acl \
66        wlan_ccmp \
67        wlan_tkip \
68        wlan_wep \
69        wlan_xauth
70
71ifeq ($(findstring AHB,$(BUS)),AHB)
72        MADWIFI_AUTOLOAD += ath_ahb
73endif
74ifeq ($(findstring PCI,$(BUS)),PCI)
75        MADWIFI_AUTOLOAD += ath_pci
76endif
77
78define KernelPackage/madwifi
79  SUBMENU:=Wireless Drivers
80  TITLE:=Driver for Atheros wireless chipsets
81  DEPENDS:=+wireless-tools
82  DESCRIPTION:=\
83        This package contains a driver for Atheros 802.11a/b/g chipsets.
84  URL:=http://madwifi.org/
85  VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE)
86  FILES:= \
87                $(PKG_BUILD_DIR)/ath/ath_hal.$(LINUX_KMOD_SUFFIX) \
88                $(BUS_MODULES) \
89                $(PKG_BUILD_DIR)/ath_rate/$(RATE_CONTROL)/ath_rate_$(RATE_CONTROL).$(LINUX_KMOD_SUFFIX) \
90                $(PKG_BUILD_DIR)/net80211/wlan*.$(LINUX_KMOD_SUFFIX)
91  AUTOLOAD:=$(call AutoLoad,50,$(MADWIFI_AUTOLOAD))
92endef
93
94MADWIFI_MAKEOPTS= -C $(PKG_BUILD_DIR) \
95                PATH="$(TARGET_PATH)" \
96                ARCH="$(LINUX_KARCH)" \
97                CROSS_COMPILE="$(TARGET_CROSS)" \
98                TARGET="$(HAL_TARGET)" \
99                TOOLPREFIX="$(KERNEL_CROSS)" \
100                TOOLPATH="$(KERNEL_CROSS)" \
101                KERNELPATH="$(LINUX_DIR)" \
102                LDOPTS=" " \
103                ATH_RATE="ath_rate/$(RATE_CONTROL)" \
104                DOMULTI=1
105
106ifeq ($(findstring AHB,$(BUS)),AHB)
107  define Build/Compile/ahb
108        $(MAKE) $(MADWIFI_MAKEOPTS) BUS="AHB" modules
109  endef
110endif
111
112ifeq ($(findstring PCI,$(BUS)),PCI)
113  define Build/Compile/pci
114        $(MAKE) $(MADWIFI_MAKEOPTS) BUS="PCI" modules
115  endef
116endif
117
118define Build/Compile
119        $(call Build/Compile/ahb)
120        $(call Build/Compile/pci)
121        $(MAKE) $(MADWIFI_MAKEOPTS) \
122                CFLAGS="$(TARGET_CFLAGS)" \
123                tools
124endef
125
126define Build/InstallDev
127        mkdir -p $(STAGING_DIR)/usr/include/madwifi
128        $(CP) $(PKG_BUILD_DIR)/include $(STAGING_DIR)/usr/include/madwifi/
129        mkdir -p $(STAGING_DIR)/usr/include/madwifi/net80211
130        $(CP) $(PKG_BUILD_DIR)/net80211/*.h $(STAGING_DIR)/usr/include/madwifi/net80211/
131endef
132
133define Build/UninstallDev
134        rm -rf  $(STAGING_DIR)/usr/include/madwifi
135endef
136
137define KernelPackage/madwifi/install
138        mkdir -p $(1)/etc/init.d
139        mkdir -p $(1)/lib/modules/$(LINUX_VERSION)
140        mkdir -p $(1)/usr/sbin
141        $(INSTALL_BIN) ./files/madwifi.init $(1)/etc/init.d/madwifi
142        $(CP) $(PKG_BUILD_DIR)/tools/{madwifi_multi,80211debug,80211stats,athchans,athctrl,athdebug,athkey,athstats,wlanconfig} $(1)/usr/sbin/
143endef
144
145$(eval $(call KernelPackage,madwifi))
Note: See TracBrowser for help on using the repository browser.