Makefile 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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. include $(TOPDIR)/rules.mk
  9. include $(INCLUDE_DIR)/kernel.mk
  10. PKG_NAME:=broadcom-wl
  11. PKG_VERSION:=4.150.10.5.2
  12. PKG_RELEASE:=1
  13. WLC_VERSION:=0.1
  14. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  15. PKG_SOURCE_URL:=http://downloads.openwrt.org/sources
  16. PKG_MD5SUM:=904a808dd98da076814fb7cb4b66a695
  17. WL_WEXT=1
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/broadcom-wl/Default
  20. SECTION:=kernel
  21. CATEGORY:=Kernel modules
  22. DEPENDS:=@PACKAGE_kmod-brcm-wl||PACKAGE_kmod-brcm-wl-mimo
  23. SUBMENU:=Proprietary BCM43xx WiFi driver
  24. SUBMENUDEP:=@TARGET_brcm_2_4
  25. endef
  26. define KernelPackage/brcm-wl/Default
  27. $(call Package/broadcom-wl/Default)
  28. SECTION:=kernel
  29. DEPENDS:=@TARGET_brcm_2_4 +wireless-tools
  30. TITLE:=Kernel driver for BCM43xx chipsets
  31. FILES:=$(PKG_BUILD_DIR)/driver/wl$(1).o
  32. AUTOLOAD:=$(call AutoLoad,30,wl$(1))
  33. endef
  34. define KernelPackage/brcm-wl/Default/description
  35. This package contains the proprietary wireless driver for the Broadcom
  36. BCM43xx chipset.
  37. endef
  38. define KernelPackage/brcm-wl
  39. $(call KernelPackage/brcm-wl/Default,)
  40. TITLE+= (normal version)
  41. endef
  42. define KernelPackage/brcm-wl/description
  43. $(call KernelPackage/brcm-wl/Default/description)
  44. endef
  45. define KernelPackage/brcm-wl-mimo
  46. $(call KernelPackage/brcm-wl/Default,_mimo)
  47. TITLE+= (MIMO version)
  48. endef
  49. define KernelPackage/brcm-wl-mimo/description
  50. $(call KernelPackage/brcm-wl/Default/description)
  51. endef
  52. define KernelPackage/wlcompat/Default
  53. $(call KernelPackage/brcm-wl/Default,)
  54. TITLE:=Kernel driver for BCM43xx chipsets
  55. FILES:=$(PKG_BUILD_DIR)/wlcompat/wlcompat$(1).o
  56. endef
  57. define KernelPackage/wlcompat
  58. $(call KernelPackage/wlcompat/Default,)
  59. AUTOLOAD:=$(call AutoLoad,50,wlcompat)
  60. endef
  61. define KernelPackage/wlcompat/description
  62. This package contains a wrapper module, that provides Wireless Extension
  63. support for the proprietary Broadcom wl module.
  64. endef
  65. define KernelPackage/wlcompat-debug
  66. $(call KernelPackage/wlcompat/Default,-debug)
  67. TITLE+= (debug)
  68. AUTOLOAD:=
  69. endef
  70. define KernelPackage/wlcompat-debug/description
  71. $(call KernelPackage/wlcompat/description)
  72. This is the debugging version.
  73. endef
  74. define Package/wlc
  75. $(call Package/broadcom-wl/Default)
  76. TITLE:=wl driver setup utility
  77. endef
  78. define Package/wlc/description
  79. This package contains an utility for initializing the proprietary Broadcom
  80. wl driver.
  81. endef
  82. define Package/wl
  83. $(call Package/broadcom-wl/Default)
  84. DEPENDS+= +nvram
  85. TITLE:=Proprietary Broadcom wl driver config utility
  86. endef
  87. define Package/wl/description
  88. This package contains the proprietary utility (wl) for configuring the
  89. proprietary Broadcom wl driver.
  90. endef
  91. define Package/nas
  92. $(call Package/broadcom-wl/Default)
  93. DEPENDS+= +nvram
  94. TITLE:=Proprietary Broadcom WPA/WPA2 authenticator
  95. endef
  96. define Package/nas/description
  97. This package contains the proprietary WPA/WPA2 authenticator (nas) for the
  98. proprietary Broadcom wl driver.
  99. endef
  100. MAKE_KMOD := $(MAKE) -C "$(LINUX_DIR)" \
  101. CROSS_COMPILE="$(TARGET_CROSS)" \
  102. ARCH="$(LINUX_KARCH)" \
  103. PATH="$(TARGET_PATH)" \
  104. SUBDIRS="$(PKG_BUILD_DIR)/kmod"
  105. define Build/Prepare
  106. $(call Build/Prepare/Default)
  107. $(CP) src/* $(PKG_BUILD_DIR)/
  108. endef
  109. define Build/Compile
  110. # Compile the kernel part
  111. $(MAKE_KMOD) \
  112. SUBDIRS="$(PKG_BUILD_DIR)/driver" \
  113. modules
  114. $(MAKE_KMOD) \
  115. SUBDIRS="$(PKG_BUILD_DIR)/driver" \
  116. MOD_NAME="_mimo" \
  117. modules
  118. $(MAKE_KMOD) \
  119. SUBDIRS="$(PKG_BUILD_DIR)/wlcompat" \
  120. $(if $(WL_WEXT),WL_WEXT=1) \
  121. modules
  122. $(MAKE_KMOD) \
  123. SUBDIRS="$(PKG_BUILD_DIR)/wlcompat" \
  124. DEBUG=1 \
  125. $(if $(WL_WEXT),WL_WEXT=1) \
  126. modules
  127. # Compile wlc
  128. $(MAKE) -C $(PKG_BUILD_DIR)/wlc \
  129. $(TARGET_CONFIGURE_OPTS) \
  130. CFLAGS="$(TARGET_CFLAGS)" \
  131. all
  132. # Compile libshared
  133. $(MAKE) -C $(PKG_BUILD_DIR)/router/shared \
  134. $(TARGET_CONFIGURE_OPTS) \
  135. CFLAGS="$(TARGET_CFLAGS) -I. -I$(PKG_BUILD_DIR)/include -Dlinux=1" \
  136. all
  137. $(TARGET_CC) -o $(PKG_BUILD_DIR)/nas $(PKG_BUILD_DIR)/nas_exe.o -L$(STAGING_DIR)/usr/lib -lnvram $(PKG_BUILD_DIR)/router/shared/libshared.a
  138. $(TARGET_CC) -o $(PKG_BUILD_DIR)/wl $(PKG_BUILD_DIR)/wl_exe.o
  139. endef
  140. define Build/InstallDev
  141. $(INSTALL_DIR) $(1)/usr/lib
  142. $(CP) $(PKG_BUILD_DIR)/router/shared/libshared.a $(1)/usr/lib/
  143. endef
  144. define Package/wlc/install
  145. $(CP) ./files/* $(1)/
  146. $(INSTALL_DIR) $(1)/sbin
  147. $(INSTALL_BIN) $(PKG_BUILD_DIR)/wlc/wlc $(1)/sbin/
  148. endef
  149. define Package/wl/install
  150. $(INSTALL_DIR) $(1)/usr/sbin
  151. $(INSTALL_BIN) $(PKG_BUILD_DIR)/wl $(1)/usr/sbin/
  152. endef
  153. define Package/nas/install
  154. $(INSTALL_DIR) $(1)/usr/sbin
  155. $(INSTALL_BIN) $(PKG_BUILD_DIR)/nas $(1)/usr/sbin/
  156. ln -sf nas $(1)/usr/sbin/nas4not
  157. ln -sf nas $(1)/usr/sbin/nas4wds
  158. endef
  159. $(eval $(call KernelPackage,brcm-wl))
  160. $(eval $(call KernelPackage,brcm-wl-mimo))
  161. $(eval $(call KernelPackage,wlcompat))
  162. $(eval $(call KernelPackage,wlcompat-debug))
  163. $(eval $(call BuildPackage,wlc))
  164. $(eval $(call BuildPackage,wl))
  165. $(eval $(call BuildPackage,nas))