source: trunk/package/broadcom-wl/Makefile @ 30709

Last change on this file since 30709 was 30709, checked in by jow, 5 years ago

[package] broadcom-wl: remove an erroneous BUG() call in the glue driver

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