treewide: unify OpenWrt hosted source via @OPENWRT
[openwrt/openwrt.git] / package / kernel / broadcom-wl / Makefile
1 #
2 # Copyright (C) 2006-2014 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=broadcom-wl
12 PKG_VERSION:=5.10.56.27.3
13 PKG_RELEASE:=10
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(ARCH).tar.bz2
16 PKG_SOURCE_URL:=@OPENWRT
17
18 ifeq ($(ARCH),mipsel)
19 PKG_HASH:=26a8c370f48fc129d0731cfd751c36cae1419b0bc8ca35781126744e60eae009
20 endif
21 ifeq ($(ARCH),mips)
22 PKG_HASH:=ca6a86ca3e3e9c85b6dbb665b35bcbf338c37829c1b2f1994487d55664886045
23 endif
24
25 PKG_EXTMOD_SUBDIRS:=driver driver-mini glue
26
27 PKG_USE_MIPS16:=0
28 PKG_FLAGS:=nonshared
29
30 include $(INCLUDE_DIR)/package.mk
31
32 define Package/broadcom-wl/Default
33 SECTION:=kernel
34 CATEGORY:=Kernel modules
35 DEPENDS:=@(PACKAGE_kmod-brcm-wl||PACKAGE_kmod-brcm-wl-mini)
36 SUBMENU:=Proprietary BCM43xx WiFi driver
37 SUBMENUDEP:=(TARGET_bcm47xx||TARGET_bcm63xx)
38 endef
39
40 define KernelPackage/brcm-wl/Default
41 $(call Package/broadcom-wl/Default)
42 SECTION:=kernel
43 DEPENDS:=@(TARGET_bcm47xx||TARGET_bcm63xx) +wireless-tools
44 TITLE:=Kernel driver for BCM43xx chipsets
45 FILES:=$(PKG_BUILD_DIR)/driver$(1)/wl.ko $(PKG_BUILD_DIR)/glue/wl_glue.ko
46 AUTOLOAD:=$(call AutoProbe,wl)
47 endef
48
49 define KernelPackage/brcm-wl/Default/description
50 This package contains the proprietary wireless driver for the Broadcom
51 BCM43xx chipset.
52 endef
53
54 define KernelPackage/brcm-wl
55 $(call KernelPackage/brcm-wl/Default,)
56 TITLE+= (normal version)
57 endef
58
59 define KernelPackage/brcm-wl/description
60 $(call KernelPackage/brcm-wl/Default/description)
61 endef
62
63 define KernelPackage/brcm-wl-mini
64 $(call KernelPackage/brcm-wl/Default,-mini)
65 TITLE+= (Legacy version)
66 endef
67
68 define KernelPackage/brcm-wl-mini/description
69 $(call KernelPackage/brcm-wl/Default/description)
70 endef
71
72 define Package/wlc
73 $(call Package/broadcom-wl/Default)
74 TITLE:=wl driver setup utility
75 endef
76
77 define Package/wlc/description
78 This package contains an utility for initializing the proprietary Broadcom
79 wl driver.
80 endef
81
82 define Package/wl
83 $(call Package/broadcom-wl/Default)
84 TITLE:=Proprietary Broadcom wl driver config utility
85 endef
86
87 define Package/wl/description
88 This package contains the proprietary utility (wl) for configuring the
89 proprietary Broadcom wl driver.
90 endef
91
92 define Package/nas
93 $(call Package/broadcom-wl/Default)
94 TITLE:=Proprietary Broadcom WPA/WPA2 authenticator
95 endef
96
97 define Package/nas/description
98 This package contains the proprietary WPA/WPA2 authenticator (nas) for the
99 proprietary Broadcom wl driver.
100 endef
101
102 MAKE_KMOD := $(MAKE) -C "$(LINUX_DIR)" \
103 $(KERNEL_MAKE_FLAGS) \
104 PATH="$(TARGET_PATH)" \
105 M="$(PKG_BUILD_DIR)/kmod" \
106
107 define Build/Prepare
108 $(call Build/Prepare/Default)
109 $(CP) $(PKG_BUILD_DIR)/driver $(PKG_BUILD_DIR)/driver-mini
110 $(CP) ./src/glue $(PKG_BUILD_DIR)/glue
111 endef
112
113 define Build/Compile
114 # Compile glue driver
115 $(MAKE_KMOD) -C "$(LINUX_DIR)" \
116 M="$(PKG_BUILD_DIR)/glue" \
117 modules
118
119 # Compile the kernel part
120 $(MAKE_KMOD) \
121 M="$(PKG_BUILD_DIR)/driver" \
122 MODFLAGS="-DMODULE -mlong-calls" \
123 KBUILD_EXTRA_SYMBOLS="$(PKG_BUILD_DIR)/glue/Module.symvers" \
124 modules
125
126 $(MAKE_KMOD) \
127 M="$(PKG_BUILD_DIR)/driver-mini" \
128 MODFLAGS="-DMODULE -mlong-calls" \
129 BUILD_TYPE="wl_apsta_mini" \
130 KBUILD_EXTRA_SYMBOLS="$(PKG_BUILD_DIR)/glue/Module.symvers" \
131 modules
132
133 # Compile libshared
134 $(MAKE) -C $(PKG_BUILD_DIR)/shared \
135 $(TARGET_CONFIGURE_OPTS) \
136 CFLAGS="$(TARGET_CFLAGS) -I. -I$(PKG_BUILD_DIR)/driver/include" \
137 all
138
139 $(TARGET_CC) -o $(PKG_BUILD_DIR)/wlc \
140 -I$(PKG_BUILD_DIR)/shared -I$(PKG_BUILD_DIR)/driver/include \
141 ./src/wlc.c $(PKG_BUILD_DIR)/shared/libshared.a
142
143 $(TARGET_CC) -o $(PKG_BUILD_DIR)/nas \
144 $(PKG_BUILD_DIR)/nas_exe.o \
145 $(PKG_BUILD_DIR)/shared/libshared.a
146
147 $(TARGET_CC) -o $(PKG_BUILD_DIR)/wl \
148 $(PKG_BUILD_DIR)/wl_exe.o \
149 $(PKG_BUILD_DIR)/shared/libshared.a
150 endef
151
152 define Build/InstallDev
153 $(INSTALL_DIR) $(1)/usr/lib
154 $(CP) $(PKG_BUILD_DIR)/shared/libshared.a $(1)/usr/lib/
155 endef
156
157 define Package/wlc/install
158 $(CP) ./files/* $(1)/
159 $(INSTALL_DIR) $(1)/sbin
160 $(INSTALL_BIN) $(PKG_BUILD_DIR)/wlc $(1)/sbin/
161 endef
162
163 define Package/wlc/postinst
164 #!/bin/sh
165 [ -n "$${IPKG_INSTROOT}" ] || /etc/init.d/wlunbind enable || true
166 endef
167
168 define Package/wl/install
169 $(INSTALL_DIR) $(1)/usr/sbin
170 $(INSTALL_BIN) $(PKG_BUILD_DIR)/wl $(1)/usr/sbin/
171 endef
172
173 define Package/nas/install
174 $(INSTALL_DIR) $(1)/usr/sbin
175 $(INSTALL_BIN) $(PKG_BUILD_DIR)/nas $(1)/usr/sbin/
176 $(LN) nas $(1)/usr/sbin/nas4not
177 $(LN) nas $(1)/usr/sbin/nas4wds
178 endef
179
180 $(eval $(call KernelPackage,brcm-wl))
181 $(eval $(call KernelPackage,brcm-wl-mini))
182 $(eval $(call BuildPackage,wlc))
183 $(eval $(call BuildPackage,wl))
184 $(eval $(call BuildPackage,nas))