clean up mac80211 related kernel version deps
[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 endef
31
32 define KernelPackage/rt2x00-lib
33 $(call KernelPackage/rt2x00/Default)
34 DEPENDS+= @PCI_SUPPORT||USB_SUPPORT +kmod-mac80211
35 TITLE+= (LIB)
36 FILES:=$(PKG_BUILD_DIR)/rt2x00lib.$(LINUX_KMOD_SUFFIX)
37 AUTOLOAD:=$(call AutoLoad,25,blkcipher ecb arc4 rt2x00lib)
38 endef
39
40 define KernelPackage/rt2x00-pci
41 $(call KernelPackage/rt2x00/Default)
42 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-lib +kmod-eeprom-93cx6
43 TITLE+= (PCI)
44 FILES:=$(PKG_BUILD_DIR)/rt2x00pci.$(LINUX_KMOD_SUFFIX)
45 AUTOLOAD:=$(call AutoLoad,26,rt2x00pci)
46 endef
47
48 define KernelPackage/rt2x00-usb
49 $(call KernelPackage/rt2x00/Default)
50 DEPENDS+= @USB_SUPPORT +kmod-rt2x00-lib +kmod-usb-core
51 TITLE+= (USB)
52 FILES:=$(PKG_BUILD_DIR)/rt2x00usb.$(LINUX_KMOD_SUFFIX)
53 AUTOLOAD:=$(call AutoLoad,26,rt2x00usb)
54 endef
55
56 define KernelPackage/rt2400-pci
57 $(call KernelPackage/rt2x00/Default)
58 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
59 TITLE+= (RT2400 PCI)
60 FILES:=$(PKG_BUILD_DIR)/rt2400pci.$(LINUX_KMOD_SUFFIX)
61 AUTOLOAD:=$(call AutoLoad,27,rt2400pci)
62 endef
63
64 define KernelPackage/rt2500-pci
65 $(call KernelPackage/rt2x00/Default)
66 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
67 TITLE+= (RT2500 PCI)
68 FILES:=$(PKG_BUILD_DIR)/rt2500pci.$(LINUX_KMOD_SUFFIX)
69 AUTOLOAD:=$(call AutoLoad,27,rt2500pci)
70 endef
71
72 define KernelPackage/rt2500-usb
73 $(call KernelPackage/rt2x00/Default)
74 DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb +kmod-crc-itu-t
75 TITLE+= (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 KernelPackage/rt2x00/Default)
82 DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci +kmod-crc-itu-t
83 TITLE+= (RT2x61 PCI)
84 FILES:=$(PKG_BUILD_DIR)/rt61pci.$(LINUX_KMOD_SUFFIX)
85 AUTOLOAD:=$(call AutoLoad,27,rt61pci)
86 endef
87
88 define KernelPackage/rt73-usb
89 $(call KernelPackage/rt2x00/Default)
90 DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
91 TITLE+= (RT73 USB)
92 FILES:=$(PKG_BUILD_DIR)/rt73usb.$(LINUX_KMOD_SUFFIX)
93 AUTOLOAD:=$(call AutoLoad,27,rt73usb)
94 endef
95
96 $(STAMP_PREPARED): $(DL_DIR)/$(PKG_FW6X_NAME) $(DL_DIR)/$(PKG_FW7X_NAME)
97
98 $(DL_DIR)/$(PKG_FW6X_NAME):
99 $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_FW6X_NAME)" "$(PKG_FW6X_MD5SUM)" $(PKG_FW6X_URL)
100
101 $(DL_DIR)/$(PKG_FW7X_NAME):
102 $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_FW7X_NAME)" "$(PKG_FW7X_MD5SUM)" $(PKG_FW7X_URL)
103
104 PKG_EXTRA_KCONFIG:= \
105 CONFIG_RT2X00=y \
106 CONFIG_RT2X00_DEBUG=y \
107
108 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-pci),)
109 PKG_EXTRA_KCONFIG+= CONFIG_RT2X00PCI=y
110 endif
111 ifneq ($(CONFIG_PACKAGE_kmod-rt2x00-usb),)
112 PKG_EXTRA_KCONFIG+= CONFIG_RT2X00USB=y
113 endif
114 ifneq ($(CONFIG_PACKAGE_kmod-rt2400-pci),)
115 PKG_EXTRA_KCONFIG+= CONFIG_RT2400PCI=y
116 endif
117 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-pci),)
118 PKG_EXTRA_KCONFIG+= CONFIG_RT2500PCI=y
119 endif
120 ifneq ($(CONFIG_PACKAGE_kmod-rt2500-usb),)
121 PKG_EXTRA_KCONFIG+= CONFIG_RT2500USB=y
122 endif
123 ifneq ($(CONFIG_PACKAGE_kmod-rt61-pci),)
124 PKG_EXTRA_KCONFIG+= CONFIG_RT61PCI=y
125 endif
126 ifneq ($(CONFIG_PACKAGE_kmod-rt73-usb),)
127 PKG_EXTRA_KCONFIG+= CONFIG_RT73USB=y
128 endif
129
130 PKG_EXTRA_CFLAGS:= \
131 -I$(STAGING_DIR)/usr/include/mac80211 \
132 $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(PKG_EXTRA_KCONFIG)))) \
133 $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(PKG_EXTRA_KCONFIG)))) \
134
135 define Build/Prepare
136 $(call Build/Prepare/Default)
137 $(CP) -r src/* $(PKG_BUILD_DIR)/
138 unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_FW6X_NAME)
139 unzip -jod $(PKG_BUILD_DIR) $(DL_DIR)/$(PKG_FW7X_NAME)
140 endef
141
142 define Build/Configure
143 touch $(PKG_BUILD_DIR)/rt2x00_config.h
144 endef
145
146 define Build/Compile
147 $(MAKE) -C "$(LINUX_DIR)" \
148 ARCH="$(LINUX_KARCH)" \
149 CROSS_COMPILE="$(TARGET_CROSS)" \
150 SUBDIRS="$(PKG_BUILD_DIR)" \
151 $(PKG_EXTRA_KCONFIG) \
152 EXTRA_CFLAGS="$(PKG_EXTRA_CFLAGS)" \
153 V="$(V)" \
154 modules
155 endef
156
157 define KernelPackage/rt61-pci/install
158 $(INSTALL_DIR) $(1)/lib/firmware
159 $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt2?61*.bin $(1)/lib/firmware/
160 endef
161
162 define KernelPackage/rt73-usb/install
163 $(INSTALL_DIR) $(1)/lib/firmware
164 $(INSTALL_DATA) $(PKG_BUILD_DIR)/rt73.bin $(1)/lib/firmware/
165 endef
166
167 $(eval $(call KernelPackage,rt2x00-lib))
168 $(eval $(call KernelPackage,rt2x00-pci))
169 $(eval $(call KernelPackage,rt2x00-usb))
170 $(eval $(call KernelPackage,rt2400-pci))
171 $(eval $(call KernelPackage,rt2500-pci))
172 $(eval $(call KernelPackage,rt2500-usb))
173 $(eval $(call KernelPackage,rt61-pci))
174 $(eval $(call KernelPackage,rt73-usb))
This page took 0.053619 seconds and 5 git commands to generate.