fix more downloading crap
[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 PKG_FW6X_NAME:=RT61_Firmware_V1.2.zip
16 PKG_FW6X_URL:=http://www.ralinktech.com.tw/data/
17 PKG_FW6X_MD5SUM:=d4c690c93b470bc9a681297c2adc6281
18
19 PKG_FW7X_NAME:=RT71W_Firmware_V1.8.zip
20 PKG_FW7X_URL:=http://www.ralinktech.com.tw/data/
21 PKG_FW7X_MD5SUM:=1e7a5dc574e0268574fcda3fd5cf52f7
22
23 include $(INCLUDE_DIR)/package.mk
24
25 # XXX: remove @!TARGET_* later when we have PCI & USB support properly detected on all targets
26 define KernelPackage/rt2x00/Default
27 SUBMENU:=Wireless Drivers
28 TITLE:=Ralink Drivers for RT2x00 cards
29 DEPENDS:=@LINUX_2_6 @!TARGET_atheros @!TARGET_uml
30 KCONFIG:=CONFIG_MAC80211
31 endef
32
33 define KernelPackage/rt2x00-lib
34 $(call KernelPackage/rt2x00/Default)
35 DEPENDS+= @PCI_SUPPORT||USB_SUPPORT +kmod-mac80211
36 TITLE+= (LIB)
37 FILES:=$(PKG_BUILD_DIR)/rt2x00lib.$(LINUX_KMOD_SUFFIX)
38 AUTOLOAD:=$(call AutoLoad,25,blkcipher ecb arc4 rt2x00lib)
39 endef
40
41 define KernelPackage/rt2x00-pci
42 $(call KernelPackage/rt2x00/Default)
43 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-lib +kmod-eeprom-93cx6
44 TITLE+= (PCI)
45 FILES:=$(PKG_BUILD_DIR)/rt2x00pci.$(LINUX_KMOD_SUFFIX)
46 AUTOLOAD:=$(call AutoLoad,26,rt2x00pci)
47 endef
48
49 define KernelPackage/rt2x00-usb
50 $(call KernelPackage/rt2x00/Default)
51 DEPENDS+= @USB_SUPPORT +kmod-rt2x00-lib +kmod-usb-core
52 TITLE+= (USB)
53 FILES:=$(PKG_BUILD_DIR)/rt2x00usb.$(LINUX_KMOD_SUFFIX)
54 AUTOLOAD:=$(call AutoLoad,26,rt2x00usb)
55 endef
56
57 define KernelPackage/rt2400-pci
58 $(call KernelPackage/rt2x00/Default)
59 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
60 TITLE+= (RT2400 PCI)
61 FILES:=$(PKG_BUILD_DIR)/rt2400pci.$(LINUX_KMOD_SUFFIX)
62 AUTOLOAD:=$(call AutoLoad,27,rt2400pci)
63 endef
64
65 define KernelPackage/rt2500-pci
66 $(call KernelPackage/rt2x00/Default)
67 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
68 TITLE+= (RT2500 PCI)
69 FILES:=$(PKG_BUILD_DIR)/rt2500pci.$(LINUX_KMOD_SUFFIX)
70 AUTOLOAD:=$(call AutoLoad,27,rt2500pci)
71 endef
72
73 define KernelPackage/rt2500-usb
74 $(call KernelPackage/rt2x00/Default)
75 DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb +kmod-crc-itu-t
76 TITLE+= (RT2500 USB)
77 FILES:=$(PKG_BUILD_DIR)/rt2500usb.$(LINUX_KMOD_SUFFIX)
78 AUTOLOAD:=$(call AutoLoad,27,rt2500usb)
79 endef
80
81 define KernelPackage/rt61-pci
82 $(call KernelPackage/rt2x00/Default)
83 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci +kmod-crc-itu-t
84 TITLE+= (RT2x61 PCI)
85 FILES:=$(PKG_BUILD_DIR)/rt61pci.$(LINUX_KMOD_SUFFIX)
86 AUTOLOAD:=$(call AutoLoad,27,rt61pci)
87 endef
88
89 define KernelPackage/rt73-usb
90 $(call KernelPackage/rt2x00/Default)
91 DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
92 TITLE+= (RT73 USB)
93 FILES:=$(PKG_BUILD_DIR)/rt73usb.$(LINUX_KMOD_SUFFIX)
94 AUTOLOAD:=$(call AutoLoad,27,rt73usb)
95 endef
96
97 $(STAMP_PREPARED): $(DL_DIR)/$(PKG_FW6X_NAME) $(DL_DIR)/$(PKG_FW7X_NAME)
98
99 $(DL_DIR)/$(PKG_FW6X_NAME):
100 $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_FW6X_NAME)" "$(PKG_FW6X_MD5SUM)" $(PKG_FW6X_URL)
101
102 $(DL_DIR)/$(PKG_FW7X_NAME):
103 $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_FW7X_NAME)" "$(PKG_FW7X_MD5SUM)" $(PKG_FW7X_URL)
104
105 # only try to build if the kernel is recent enough (has in-kernel mac80211)
106 ifndef ($(CONFIG_MAC80211),)
107
108 PKG_EXTRA_KCONFIG:= \
109 CONFIG_RT2X00=y \
110 CONFIG_RT2X00_DEBUG=y \
111
112 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-pci),)
113 PKG_EXTRA_KCONFIG+= CONFIG_RT2X00PCI=y
114 endif
115 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-usb),)
116 PKG_EXTRA_KCONFIG+= CONFIG_RT2X00USB=y
117 endif
118 ifneq ($(CONFIG_PACKAGE_kmod-rt2400-pci),)
119 PKG_EXTRA_KCONFIG+= CONFIG_RT2400PCI=y
120 endif
121 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-pci),)
122 PKG_EXTRA_KCONFIG+= CONFIG_RT2500PCI=y
123 endif
124 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-usb),)
125 PKG_EXTRA_KCONFIG+= CONFIG_RT2500USB=y
126 endif
127 ifneq ($(CONFIG_PACKAGE_kmod-rt61-pci),)
128 PKG_EXTRA_KCONFIG+= CONFIG_RT61PCI=y
129 endif
130 ifneq ($(CONFIG_PACKAGE_kmod-rt73-usb),)
131 PKG_EXTRA_KCONFIG+= CONFIG_RT73USB=y
132 endif
133
134 PKG_EXTRA_CFLAGS:= \
135 -I$(STAGING_DIR)/usr/include/mac80211 \
136 $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(PKG_EXTRA_KCONFIG)))) \
137 $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(PKG_EXTRA_KCONFIG)))) \
138
139 define Build/Compile/it
140 $(MAKE) -C "$(LINUX_DIR)" \
141 ARCH="$(LINUX_KARCH)" \
142 CROSS_COMPILE="$(TARGET_CROSS)" \
143 SUBDIRS="$(PKG_BUILD_DIR)" \
144 $(PKG_EXTRA_KCONFIG) \
145 EXTRA_CFLAGS="$(PKG_EXTRA_CFLAGS)" \
146 V="$(V)" \
147 modules
148 endef
149
150 endif
151
152 define Build/Prepare
153 $(call Build/Prepare/Default)
154 $(CP) -r src/* $(PKG_BUILD_DIR)/
155 unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_FW6X_NAME)
156 unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_FW7X_NAME)
157 endef
158
159 define Build/Configure
160 touch $(PKG_BUILD_DIR)/rt2x00_config.h
161 endef
162
163 define Build/Compile
164 $(call Build/Compile/it)
165 endef
166
167 define KernelPackage/rt61-pci/install
168 $(INSTALL_DIR) $(1)/lib/firmware
169 $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt2?61*.bin $(1)/lib/firmware/
170 endef
171
172 define KernelPackage/rt73-usb/install
173 $(INSTALL_DIR) $(1)/lib/firmware
174 $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt73.bin $(1)/lib/firmware/
175 endef
176
177 $(eval $(call KernelPackage,rt2x00-lib))
178 $(eval $(call KernelPackage,rt2x00-pci))
179 $(eval $(call KernelPackage,rt2x00-usb))
180 $(eval $(call KernelPackage,rt2400-pci))
181 $(eval $(call KernelPackage,rt2500-pci))
182 $(eval $(call KernelPackage,rt2500-usb))
183 $(eval $(call KernelPackage,rt61-pci))
184 $(eval $(call KernelPackage,rt73-usb))
This page took 0.057151 seconds and 5 git commands to generate.