standardize Makefile, change section from base to utils
[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.17.0
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:=3183ddb60e3e882b41df1776c89b614c
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 SUBMENUDEP:=@LINUX_2_4_BRCM
32 TITLE:=Kernel driver (normal version)
33 DESCRIPTION:=Proprietary Wireless driver for the Broadcom BCM43xx chipset
34 VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(PKG_RELEASE)
35 endef
36
37 define Package/kmod-brcm-wl-mimo
38 $(call Package/kmod-brcm-wl)
39 DEFAULT:=m if ALL
40 TITLE:=Kernel driver (MIMO version)
41 DESCRIPTION:=Proprietary Wireless driver for the Broadcom BCM43xx chipset (MIMO version)
42 endef
43
44 define Package/wlc
45 $(call Package/kmod-brcm-wl-mimo)
46 DEFAULT:=y
47 DEPENDS:=kmod-brcm-wl
48 TITLE:=Setup utility
49 DESCRIPTION:=Utility for initializing the Broadcom wl driver
50 VERSION:=$(WLC_VERSION)-$(PKG_RELEASE)
51 endef
52
53 define Package/wl
54 $(call Package/wlc)
55 TITLE:=Utility for changing the driver's parameters
56 DESCRIPTION:=Utility for changing the Broadcom wl driver's parameters
57 VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
58 endef
59
60 define Package/nas
61 $(call Package/wl)
62 DEPENDS:=@PACKAGE_kmod-brcm-wl||PACKAGE_kmod-brcm-wl-mimo +nvram
63 DEFAULT:=m
64 TITLE:=Proprietary WPA/WPA2 authenticator
65 DESCRIPTION:=Proprietary WPA/WPA2 authenticator for the Broadcom wl driver
66 endef
67
68 define Build/Prepare
69 $(call Build/Prepare/Default)
70 $(CP) src/* $(PKG_BUILD_DIR)/
71 endef
72
73 MAKEFLAGS_KMOD = -C "$(LINUX_DIR)" \
74 CROSS_COMPILE="$(TARGET_CROSS)" \
75 ARCH="$(LINUX_KARCH)" \
76 PATH="$(TARGET_PATH)" \
77 SUBDIRS="$(PKG_BUILD_DIR)/kmod"
78
79
80 define Build/Compile
81 # Compile the kernel part
82 $(MAKE) $(MAKEFLAGS_KMOD) \
83 modules
84 $(MAKE) $(MAKEFLAGS_KMOD) MOD_NAME="_mimo" \
85 modules
86
87 # Compile wlc
88 $(MAKE) -C $(PKG_BUILD_DIR)/wlc \
89 $(TARGET_CONFIGURE_OPTS) \
90 CFLAGS="-I$(PKG_BUILD_DIR)/wlc/include $(TARGET_CFLAGS)" \
91 all
92 endef
93
94 define wl_template
95 install -d -m0755 $(1)/etc/modules.d
96 echo "wl$(2)" > $(1)/etc/modules.d/20-wl$(2)
97 install -d -m0755 $(1)/lib/modules/$(LINUX_VERSION)
98 install -m0644 $(PKG_BUILD_DIR)/kmod/wl$(2).o $(PKG_BUILD_DIR)/kmod/wl$(2).o.patch $(1)/lib/modules/$(LINUX_VERSION)/
99 endef
100
101 define Package/kmod-brcm-wl/install
102 $(call wl_template,$(1))
103 endef
104
105 define Package/kmod-brcm-wl-mimo/install
106 $(call wl_template,$(1),_mimo)
107 endef
108
109 define Package/wlc/install
110 $(CP) ./files/* $(1)/
111 install -d -m0755 $(1)/sbin
112 install -m0755 $(PKG_BUILD_DIR)/wlc/wlc $(1)/sbin/
113 endef
114
115 define Package/wl/install
116 install -d -m0755 $(1)/usr/sbin
117 install -m0755 $(PKG_BUILD_DIR)/wl $(1)/usr/sbin/
118 endef
119
120 define Package/nas/install
121 install -d -m0755 $(1)/usr/lib
122 install -m0755 $(PKG_BUILD_DIR)/libbcmcrypto.so $(1)/usr/lib/
123 install -d -m0755 $(1)/usr/sbin
124 install -m0755 $(PKG_BUILD_DIR)/nas $(1)/usr/sbin/
125 ln -sf nas $(1)/usr/sbin/nas4not
126 ln -sf nas $(1)/usr/sbin/nas4wds
127 endef
128
129 $(eval $(call BuildPackage,kmod-brcm-wl))
130 $(eval $(call BuildPackage,kmod-brcm-wl-mimo))
131 $(eval $(call BuildPackage,wlc))
132 $(eval $(call BuildPackage,wl))
133 $(eval $(call BuildPackage,nas))
This page took 0.062299 seconds and 5 git commands to generate.