fix mac80211 compile
[openwrt/openwrt.git] / package / mac80211 / 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: Makefile 7440 2007-06-02 02:22:01Z nbd $
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=mac80211
13 PKG_RELEASE:=1
14
15 include $(INCLUDE_DIR)/package.mk
16
17 define KernelPackage/mac80211
18 SUBMENU:=Wireless Drivers
19 TITLE:=Linux 802.11 Wireless Networking Stack
20 DEPENDS:=@LINUX_2_6 +kmod-crypto-arc4 +kmod-crypto-aes
21 FILES:= \
22 $(PKG_BUILD_DIR)/mac80211/mac80211.$(LINUX_KMOD_SUFFIX) \
23 $(PKG_BUILD_DIR)/mac80211/rc80211_simple.$(LINUX_KMOD_SUFFIX) \
24 $(PKG_BUILD_DIR)/wireless/cfg80211.$(LINUX_KMOD_SUFFIX)
25 AUTOLOAD:=$(call AutoLoad,20,cfg80211 mac80211 rc80211_simple)
26 endef
27
28 define KernelPackage/mac80211/description
29 Linux 802.11 Wireless Networking Stack
30 endef
31
32 CONFOPTS:=MAC80211 CFG80211 NL80211
33
34 BUILDFLAGS:= \
35 $(foreach opt,$(CONFOPTS),-DCONFIG_$(opt) ) \
36 $(if $(CONFIG_LEDS_TRIGGERS), -DCONFIG_MAC80211_LEDS -DCONFIG_LEDS_TRIGGERS)
37
38 MAKE_OPTS:= \
39 CROSS_COMPILE="$(TARGET_CROSS)" \
40 ARCH="$(LINUX_KARCH)" \
41 EXTRA_CFLAGS="$(BUILDFLAGS)" \
42 $(foreach opt,$(CONFOPTS),CONFIG_$(opt)=m) \
43 CONFIG_NL80211=y \
44 CONFIG_MAC80211_LEDS=$(CONFIG_LEDS_TRIGGERS) \
45 LINUXINCLUDE="-I${CURDIR}/src/include -I$(LINUX_DIR)/include -include linux/autoconf.h" \
46
47 ifneq ($(findstring 2.6.23,$(LINUX_VERSION)),)
48 define Build/Prepare
49 mkdir -p $(PKG_BUILD_DIR)/mac80211
50 $(CP) ./src/mac80211/* $(PKG_BUILD_DIR)/mac80211/
51 mkdir -p $(PKG_BUILD_DIR)/wireless
52 $(CP) ./src/wireless/* $(PKG_BUILD_DIR)/wireless/
53 endef
54
55 define Build/Compile
56 $(MAKE) -C "$(LINUX_DIR)" $(MAKE_OPTS) SUBDIRS="$(PKG_BUILD_DIR)/wireless" modules
57 $(MAKE) -C "$(LINUX_DIR)" $(MAKE_OPTS) SUBDIRS="$(PKG_BUILD_DIR)/mac80211" modules
58 endef
59
60 define Build/InstallDev
61 mkdir -p $(1)/usr/include/mac80211
62 $(CP) ./src/include/* $(1)/usr/include/mac80211/
63 endef
64
65 define Build/UninstallDev
66 rm -rf $(1)/usr/include/mac80211
67 endef
68
69 define KernelPackage/mac80211/install
70 $(INSTALL_DIR) $(1)/lib/wifi
71 $(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
72 endef
73 else
74 override CONFIG_PACKAGE_kmod-mac80211=
75 endif
76
77 $(eval $(call KernelPackage,mac80211))