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