source: trunk/package/rt2x00/Makefile @ 8476

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

fix rt2x00 build

File size: 3.7 KB
Line 
1#
2# Copyright (C) 2007 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:=rt2x00
13PKG_VERSION:=cvs-20070712
14
15include $(INCLUDE_DIR)/package.mk
16
17define Package/rt2x00/Default
18  SUBMENU:=Wireless Drivers
19  TITLE:=Ralink GPL Drivers
20  DESCRIPTION:=Ralink GPL Drivers for rt2x00 cards
21  VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(LINUX_RELEASE)
22endef
23
24define KernelPackage/rt2x00-lib
25  $(call Package/rt2x00/Default)
26  DEPENDS:=+kmod-mac80211 +kmod-crypto
27  TITLE+= (LIB)
28  DESCRIPTION+= (LIB)
29  FILES:=$(PKG_BUILD_DIR)/rt2x00lib.$(LINUX_KMOD_SUFFIX)
30  AUTOLOAD:=$(call AutoLoad,25,ecb arc4 rt2x00lib)
31endef
32
33define KernelPackage/rt2x00-pci
34  $(call Package/rt2x00/Default)
35  DEPENDS:=@PCI_SUPPORT +kmod-rt2x00-lib
36  TITLE+= (PCI)
37  DESCRIPTION+= (PCI)
38  FILES:=$(PKG_BUILD_DIR)/rt2x00pci.$(LINUX_KMOD_SUFFIX)
39  AUTOLOAD:=$(call AutoLoad,26,rt2x00pci)
40endef
41
42define KernelPackage/rt2x00-usb
43  $(call Package/rt2x00/Default)
44  DEPENDS:=@USB_SUPPORT +kmod-rt2x00-lib +kmod-usb-core
45  TITLE+= (USB)
46  DESCRIPTION+= (USB)
47  FILES:=$(PKG_BUILD_DIR)/rt2x00usb.$(LINUX_KMOD_SUFFIX)
48  AUTOLOAD:=$(call AutoLoad,26,rt2x00usb)
49endef
50
51define KernelPackage/rt2400-pci
52  $(call Package/rt2x00/Default)
53  DEPENDS:=+kmod-rt2x00-pci
54  TITLE+= (RT2400 PCI)
55  DESCRIPTION+= (RT2400 PCI)
56  FILES:=$(PKG_BUILD_DIR)/rt2400pci.$(LINUX_KMOD_SUFFIX)
57  AUTOLOAD:=$(call AutoLoad,27,rt2400pci)
58endef
59
60define KernelPackage/rt2500-pci
61  $(call Package/rt2x00/Default)
62  DEPENDS:=+kmod-rt2x00-pci
63  TITLE+= (RT2500 PCI)
64  DESCRIPTION+= (RT2500 PCI)
65  FILES:=$(PKG_BUILD_DIR)/rt2500pci.$(LINUX_KMOD_SUFFIX)
66  AUTOLOAD:=$(call AutoLoad,27,rt2500pci)
67endef
68
69define KernelPackage/rt2500-usb
70  $(call Package/rt2x00/Default)
71  DEPENDS:=+kmod-rt2x00-usb
72  TITLE+= (RT2500 USB)
73  DESCRIPTION+= (RT2500 USB)
74  FILES:=$(PKG_BUILD_DIR)/rt2500usb.$(LINUX_KMOD_SUFFIX)
75  AUTOLOAD:=$(call AutoLoad,27,rt2500usb)
76endef
77
78define KernelPackage/rt61-pci
79  $(call Package/rt2x00/Default)
80  DEPENDS:=+kmod-rt2x00-pci
81  TITLE+= (RT2x61 PCI)
82  DESCRIPTION+= (RT2x61 PCI)
83  FILES:=$(PKG_BUILD_DIR)/rt61pci.$(LINUX_KMOD_SUFFIX)
84  AUTOLOAD:=$(call AutoLoad,27,rt61pci)
85endef
86
87define KernelPackage/rt61-pci/install
88        mkdir -p $(1)/lib/firmware
89        $(CP) -L $(PKG_BUILD_DIR)/rt2?61*.bin $(1)/lib/firmware
90endef
91
92define KernelPackage/rt73-usb
93  $(call Package/rt2x00/Default)
94  DEPENDS:=+kmod-rt2x00-usb
95  TITLE+= (RT73 USB)
96  DESCRIPTION+= (RT73 USB)
97  FILES:=$(PKG_BUILD_DIR)/rt73usb.$(LINUX_KMOD_SUFFIX)
98  AUTOLOAD:=$(call AutoLoad,27,rt73usb)
99endef
100
101define KernelPackage/rt73-usb/install
102        mkdir -p $(1)/lib/firmware
103        $(CP) -L $(PKG_BUILD_DIR)/rt73.bin $(1)/lib/firmware
104endef
105
106define Build/Prepare
107        $(call Build/Prepare/Default)
108        $(CP) -r src/* $(PKG_BUILD_DIR)/
109        wget -N -P $(DL_DIR) http://www.ralinktech.com.tw/data/RT61_Firmware_V1.2.zip
110        wget -N -P $(DL_DIR) http://www.ralinktech.com.tw/data/RT71W_Firmware_V1.8.zip
111        unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/RT61_Firmware_V1.2.zip
112        unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/RT71W_Firmware_V1.8.zip
113endef
114
115define Build/Compile
116        $(MAKE) -C "$(PKG_BUILD_DIR)" \
117                KERNDIR="$(LINUX_DIR)" \
118                config_header
119
120        $(MAKE) -C "$(LINUX_DIR)" \
121                CROSS_COMPILE="$(TARGET_CROSS)" \
122                ARCH="$(LINUX_KARCH)" V="$(V)" \
123                SUBDIRS="$(PKG_BUILD_DIR)" \
124                KERNELVERSION="$(KERNEL)" \
125                KERNEL_SOURCES="$(LINUX_DIR)" \
126                KDIR="$(LINUX_DIR)"
127endef
128
129$(eval $(call KernelPackage,rt2x00-lib))
130$(eval $(call KernelPackage,rt2x00-pci))
131$(eval $(call KernelPackage,rt2x00-usb))
132$(eval $(call KernelPackage,rt2400-pci))
133$(eval $(call KernelPackage,rt2500-pci))
134$(eval $(call KernelPackage,rt2500-usb))
135$(eval $(call KernelPackage,rt61-pci))
136$(eval $(call KernelPackage,rt73-usb))
Note: See TracBrowser for help on using the repository browser.