credit where credit is due
[openwrt.git] / package / broadcom-wl / Makefile
1
2 # Copyright (C) 2006 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 2480 2005-11-14 02:07:33Z nbd $
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=broadcom-wl
13 PKG_VERSION:=4.80.9.2
14 PKG_RELEASE:=1
15 WLC_VERSION:=0.1
16
17 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
19 PKG_SOURCE_URL:=http://downloads.openwrt.org/sources
20 PKG_MD5SUM:=7d9fab2c611369bbe075c3924ea77450
21 PKG_CAT:=bzcat
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/kmod-brcm-wl
26   SECTION:=drivers
27   CATEGORY:=Drivers
28   DEPENDS:=@LINUX_2_4_BRCM
29   DEFAULT:=y
30   SUBMENU:=Proprietary BCM43xx WiFi driver
31   TITLE:=Kernel driver (normal version)
32   DESCRIPTION:=Proprietary Wireless driver for the Broadcom BCM43xx chipset
33   VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(PKG_RELEASE)
34 endef
35
36 define Package/kmod-brcm-wl-mimo
37   $(call Package/kmod-brcm-wl)
38   DEFAULT:=m if ALL
39   TITLE:=Kernel driver (MIMO version)
40   DESCRIPTION:=Proprietary Wireless driver for the Broadcom BCM43xx chipset (MIMO version)
41 endef
42
43 define Package/wlc
44   $(call Package/kmod-brcm-wl-mimo)
45   DEFAULT:=y
46   DEPENDS:=kmod-brcm-wl
47   TITLE:=Setup utility
48   DESCRIPTION:=Utility for initializing the Broadcom wl driver
49   VERSION:=$(WLC_VERSION)-$(PKG_RELEASE)
50 endef
51
52 define Package/wl
53   $(call Package/wlc)
54   TITLE:=Utility for changing the driver's parameters
55   DESCRIPTION:=Utility for changing the Broadcom wl driver's parameters
56   VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
57 endef
58
59 define Package/nas
60   $(call Package/wl)
61   DEPENDS:=nvram
62   TITLE:=Proprietary WPA/WPA2 authenticator
63   DESCRIPTION:=Proprietary WPA/WPA2 authenticator for the Broadcom wl driver
64 endef
65
66 define Build/Prepare
67   $(call Build/Prepare/Default)
68         $(CP) src/* $(PKG_BUILD_DIR)/
69 endef
70
71 MAKEFLAGS_KMOD = -C "$(LINUX_DIR)" \
72                 CROSS_COMPILE="$(TARGET_CROSS)" \
73                 ARCH="$(LINUX_KARCH)" \
74                 PATH="$(TARGET_PATH)" \
75                 SUBDIRS="$(PKG_BUILD_DIR)/kmod"
76
77
78 define Build/Compile
79         # Compile the kernel part
80         $(MAKE) $(MAKEFLAGS_KMOD) \
81                 modules
82         $(MAKE) $(MAKEFLAGS_KMOD) MOD_NAME="_mimo" \
83                 modules
84
85         # Compile wlc
86         $(MAKE) -C $(PKG_BUILD_DIR)/wlc \
87                 $(TARGET_CONFIGURE_OPTS) \
88                 CC="$(TARGET_CC)" \
89                 CFLAGS="-I$(PKG_BUILD_DIR)/wlc/include $(TARGET_CFLAGS)" \
90                 all
91 endef
92
93 define wl_template
94         install -d -m0755 $(1)/etc/modules.d
95         echo "wl$(2)" > $(1)/etc/modules.d/20-wl$(2)
96         install -d -m0755 $(1)/lib/modules/$(LINUX_VERSION)
97         install -m0644 $(PKG_BUILD_DIR)/kmod/wl$(2).o $(1)/lib/modules/$(LINUX_VERSION)/
98 endef
99
100 define Package/kmod-brcm-wl/install
101         $(call wl_template,$(1))
102 endef
103
104 define Package/kmod-brcm-wl-mimo/install
105         $(call wl_template,$(1),_mimo)
106 endef
107
108 define Package/wlc/install
109         $(CP) ./files/* $(1)/
110         install -d -m0755 $(1)/sbin
111         install -m0755 $(PKG_BUILD_DIR)/wlc/wlc $(1)/sbin/
112 endef
113
114 define Package/wl/install
115         install -d -m0755 $(1)/usr/sbin
116         install -m0755 $(PKG_BUILD_DIR)/wl $(1)/usr/sbin/
117 endef
118
119 define Package/nas/install
120         install -d -m0755 $(1)/usr/lib
121         install -m0755 $(PKG_BUILD_DIR)/libbcmcrypto.so $(1)/usr/lib/
122         install -d -m0755 $(1)/usr/sbin
123         install -m0755 $(PKG_BUILD_DIR)/nas $(1)/usr/sbin/
124         ln -sf nas $(1)/usr/sbin/nas4not
125         ln -sf nas $(1)/usr/sbin/nas4wds
126 endef
127
128 $(eval $(call BuildPackage,kmod-brcm-wl))
129 $(eval $(call BuildPackage,kmod-brcm-wl-mimo))
130 $(eval $(call BuildPackage,wlc))
131 $(eval $(call BuildPackage,wl))
132 $(eval $(call BuildPackage,nas))