add a default for PKG_BUILD_DIR and PKG_INSTALL_DIR (will use KERNEL_BUILD_DIR if...
[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$
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=broadcom-wl
13 PKG_VERSION:=4.80.53.0
14 PKG_RELEASE:=1
15 WLC_VERSION:=0.1
16
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
18 PKG_SOURCE_URL:=http://downloads.openwrt.org/sources
19 PKG_MD5SUM:=a7d8dde3ce474c361143b83e1d9890b1
20 PKG_CAT:=bzcat
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/broadcom-wl/Default
25 SECTION:=kernel
26 CATEGORY:=Kernel modules
27 DEPENDS:=@PACKAGE_kmod-brcm-wl||PACKAGE_kmod-brcm-wl-mimo
28 SUBMENU:=Proprietary BCM43xx WiFi driver
29 SUBMENUDEP:=@LINUX_2_4_BRCM
30 endef
31
32 define KernelPackage/brcm-wl/Default
33 $(call Package/broadcom-wl/Default)
34 SECTION:=kernel
35 DEPENDS:=@LINUX_2_4_BRCM
36 TITLE:=Kernel driver for BCM43xx chipsets
37 DESCRIPTION:=\
38 This package contains the proprietary wireless driver for the Broadcom \\\
39 BCM43xx chipset
40 VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(PKG_RELEASE)
41 FILES:=$(PKG_BUILD_DIR)/kmod/wl$(1).o
42 AUTOLOAD:=$(call AutoLoad,30,wl$(1))
43 endef
44
45 define KernelPackage/brcm-wl
46 $(call KernelPackage/brcm-wl/Default,)
47 TITLE+= (normal version)
48 DESCRIPTION+= (normal version).
49 endef
50
51 define KernelPackage/brcm-wl-mimo
52 $(call KernelPackage/brcm-wl/Default,_mimo)
53 TITLE+= (MIMO version)
54 DESCRIPTION+= (MIMO version).
55 endef
56
57 define Package/wlc
58 $(call Package/broadcom-wl/Default)
59 TITLE:=wl driver setup utility
60 DESCRIPTION:=\
61 This package contains an utility for initializing the proprietary Broadcom \\\
62 wl driver.
63 endef
64
65 define Package/wl
66 $(call Package/broadcom-wl/Default)
67 TITLE:=Proprietary Broadcom wl driver config utility
68 DESCRIPTION:=\
69 This package contains the proprietary utility (wl) for configuring the \\\
70 proprietary Broadcom wl driver.
71 endef
72
73 define Package/nas
74 $(call Package/broadcom-wl/Default)
75 DEPENDS+=+nvram
76 TITLE:=Proprietary Broadcom WPA/WPA2 authenticator
77 DESCRIPTION:=\
78 This package contains the proprietary WPA/WPA2 authenticator (nas) for the \\\
79 proprietary Broadcom wl driver.
80 endef
81
82
83 define install_template
84 $(INSTALL_DIR) $(1)/lib/modules/$(LINUX_VERSION)
85 $(INSTALL_DATA) $(PKG_BUILD_DIR)/kmod/wl$(2).o.patch $(1)/lib/modules/$(LINUX_VERSION)/
86 endef
87
88 define KernelPackage/brcm-wl/install
89 $(call install_template,$(1),)
90 endef
91
92 define KernelPackage/brcm-wl_mimo/install
93 $(call install_template,$(1),_mimo)
94 endef
95
96 MAKEFLAGS_KMOD:= -C "$(LINUX_DIR)" \
97 CROSS_COMPILE="$(TARGET_CROSS)" \
98 ARCH="$(LINUX_KARCH)" \
99 PATH="$(TARGET_PATH)" \
100 SUBDIRS="$(PKG_BUILD_DIR)/kmod"
101
102 define Build/Prepare
103 $(call Build/Prepare/Default)
104 $(CP) src/* $(PKG_BUILD_DIR)/
105 endef
106
107 define Build/Compile
108 # Compile the kernel part
109 $(MAKE) $(MAKEFLAGS_KMOD) \
110 modules
111 $(MAKE) $(MAKEFLAGS_KMOD) MOD_NAME="_mimo" \
112 modules
113
114 # Compile wlc
115 $(MAKE) -C $(PKG_BUILD_DIR)/wlc \
116 $(TARGET_CONFIGURE_OPTS) \
117 CFLAGS="-I$(PKG_BUILD_DIR)/wlc/include $(TARGET_CFLAGS)" \
118 all
119 endef
120
121 define Package/wlc/install
122 $(CP) ./files/* $(1)/
123 $(INSTALL_DIR) $(1)/sbin
124 $(INSTALL_BIN) $(PKG_BUILD_DIR)/wlc/wlc $(1)/sbin/
125 endef
126
127 define Package/wl/install
128 $(INSTALL_DIR) $(1)/usr/sbin
129 $(INSTALL_BIN) $(PKG_BUILD_DIR)/wl $(1)/usr/sbin/
130 endef
131
132 define Package/nas/install
133 $(INSTALL_DIR) $(1)/usr/lib
134 $(INSTALL_BIN) $(PKG_BUILD_DIR)/libbcmcrypto.so $(1)/usr/lib/
135 $(INSTALL_DIR) $(1)/usr/sbin
136 $(INSTALL_BIN) $(PKG_BUILD_DIR)/nas $(1)/usr/sbin/
137 ln -sf nas $(1)/usr/sbin/nas4not
138 ln -sf nas $(1)/usr/sbin/nas4wds
139 endef
140
141 $(eval $(call KernelPackage,brcm-wl))
142 $(eval $(call KernelPackage,brcm-wl-mimo))
143 $(eval $(call BuildPackage,wlc))
144 $(eval $(call BuildPackage,wl))
145 $(eval $(call BuildPackage,nas))
This page took 0.049174 seconds and 5 git commands to generate.