fix rt2x00 build
[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 DESCRIPTION:=Ralink GPL Drivers for rt2x00 cards
21 VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(LINUX_RELEASE)
22 endef
23
24 define 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)
31 endef
32
33 define 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)
40 endef
41
42 define 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)
49 endef
50
51 define 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)
58 endef
59
60 define 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)
67 endef
68
69 define 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)
76 endef
77
78 define 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)
85 endef
86
87 define KernelPackage/rt61-pci/install
88 mkdir -p $(1)/lib/firmware
89 $(CP) -L $(PKG_BUILD_DIR)/rt2?61*.bin $(1)/lib/firmware
90 endef
91
92 define 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)
99 endef
100
101 define KernelPackage/rt73-usb/install
102 mkdir -p $(1)/lib/firmware
103 $(CP) -L $(PKG_BUILD_DIR)/rt73.bin $(1)/lib/firmware
104 endef
105
106 define 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
113 endef
114
115 define 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)"
127 endef
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))
This page took 0.055946 seconds and 5 git commands to generate.