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