Makefile 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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. include $(TOPDIR)/rules.mk
  8. include $(INCLUDE_DIR)/kernel.mk
  9. PKG_NAME:=broadcom-wl
  10. PKG_VERSION:=5.10.56.27.3
  11. PKG_RELEASE:=8
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(ARCH).tar.bz2
  13. PKG_SOURCE_URL:=http://downloads.openwrt.org/sources
  14. ifeq ($(ARCH),mipsel)
  15. PKG_HASH:=26a8c370f48fc129d0731cfd751c36cae1419b0bc8ca35781126744e60eae009
  16. endif
  17. ifeq ($(ARCH),mips)
  18. PKG_HASH:=ca6a86ca3e3e9c85b6dbb665b35bcbf338c37829c1b2f1994487d55664886045
  19. endif
  20. PKG_USE_MIPS16:=0
  21. PKG_FLAGS:=nonshared
  22. include $(INCLUDE_DIR)/package.mk
  23. define Package/broadcom-wl/Default
  24. SECTION:=kernel
  25. CATEGORY:=Kernel modules
  26. DEPENDS:=@PACKAGE_kmod-brcm-wl||PACKAGE_kmod-brcm-wl-mini
  27. SUBMENU:=Proprietary BCM43xx WiFi driver
  28. SUBMENUDEP:=@TARGET_brcm47xx||TARGET_brcm63xx
  29. endef
  30. define KernelPackage/brcm-wl/Default
  31. $(call Package/broadcom-wl/Default)
  32. SECTION:=kernel
  33. DEPENDS:=@TARGET_brcm47xx||TARGET_brcm63xx +wireless-tools
  34. TITLE:=Kernel driver for BCM43xx chipsets
  35. FILES:=$(PKG_BUILD_DIR)/driver$(1)/wl.ko $(PKG_BUILD_DIR)/glue/wl_glue.ko
  36. AUTOLOAD:=$(call AutoLoad,30,wl_glue wl)
  37. endef
  38. define KernelPackage/brcm-wl/Default/description
  39. This package contains the proprietary wireless driver for the Broadcom
  40. BCM43xx chipset.
  41. endef
  42. define KernelPackage/brcm-wl
  43. $(call KernelPackage/brcm-wl/Default,)
  44. TITLE+= (normal version)
  45. endef
  46. define KernelPackage/brcm-wl/description
  47. $(call KernelPackage/brcm-wl/Default/description)
  48. endef
  49. define KernelPackage/brcm-wl-mini
  50. $(call KernelPackage/brcm-wl/Default,-mini)
  51. TITLE+= (Legacy version)
  52. endef
  53. define KernelPackage/brcm-wl-mini/description
  54. $(call KernelPackage/brcm-wl/Default/description)
  55. endef
  56. define Package/wlc
  57. $(call Package/broadcom-wl/Default)
  58. TITLE:=wl driver setup utility
  59. endef
  60. define Package/wlc/description
  61. This package contains an utility for initializing the proprietary Broadcom
  62. wl driver.
  63. endef
  64. define Package/wl
  65. $(call Package/broadcom-wl/Default)
  66. TITLE:=Proprietary Broadcom wl driver config utility
  67. endef
  68. define Package/wl/description
  69. This package contains the proprietary utility (wl) for configuring the
  70. proprietary Broadcom wl driver.
  71. endef
  72. define Package/nas
  73. $(call Package/broadcom-wl/Default)
  74. TITLE:=Proprietary Broadcom WPA/WPA2 authenticator
  75. endef
  76. define Package/nas/description
  77. This package contains the proprietary WPA/WPA2 authenticator (nas) for the
  78. proprietary Broadcom wl driver.
  79. endef
  80. MAKE_KMOD := $(MAKE) -C "$(LINUX_DIR)" \
  81. CROSS_COMPILE="$(TARGET_CROSS)" \
  82. ARCH="$(LINUX_KARCH)" \
  83. PATH="$(TARGET_PATH)" \
  84. SUBDIRS="$(PKG_BUILD_DIR)/kmod" \
  85. define Build/Prepare
  86. $(call Build/Prepare/Default)
  87. $(CP) $(PKG_BUILD_DIR)/driver $(PKG_BUILD_DIR)/driver-mini
  88. $(CP) ./src/glue $(PKG_BUILD_DIR)/glue
  89. endef
  90. define Build/Compile
  91. # Compile the kernel part
  92. $(MAKE_KMOD) \
  93. SUBDIRS="$(PKG_BUILD_DIR)/driver" \
  94. MODFLAGS="-DMODULE -mlong-calls" \
  95. modules
  96. $(MAKE_KMOD) \
  97. SUBDIRS="$(PKG_BUILD_DIR)/driver-mini" \
  98. MODFLAGS="-DMODULE -mlong-calls" \
  99. BUILD_TYPE="wl_apsta_mini" \
  100. modules
  101. # Compile glue driver
  102. $(MAKE_KMOD) -C "$(LINUX_DIR)" \
  103. SUBDIRS="$(PKG_BUILD_DIR)/glue" \
  104. modules
  105. # Compile libshared
  106. $(MAKE) -C $(PKG_BUILD_DIR)/shared \
  107. $(TARGET_CONFIGURE_OPTS) \
  108. CFLAGS="$(TARGET_CFLAGS) -I. -I$(PKG_BUILD_DIR)/driver/include" \
  109. all
  110. $(TARGET_CC) -o $(PKG_BUILD_DIR)/wlc \
  111. -I$(PKG_BUILD_DIR)/shared -I$(PKG_BUILD_DIR)/driver/include \
  112. ./src/wlc.c $(PKG_BUILD_DIR)/shared/libshared.a
  113. $(TARGET_CC) -o $(PKG_BUILD_DIR)/nas \
  114. $(PKG_BUILD_DIR)/nas_exe.o \
  115. $(PKG_BUILD_DIR)/shared/libshared.a
  116. $(TARGET_CC) -o $(PKG_BUILD_DIR)/wl \
  117. $(PKG_BUILD_DIR)/wl_exe.o \
  118. $(PKG_BUILD_DIR)/shared/libshared.a
  119. endef
  120. define Build/InstallDev
  121. $(INSTALL_DIR) $(1)/usr/lib
  122. $(CP) $(PKG_BUILD_DIR)/shared/libshared.a $(1)/usr/lib/
  123. endef
  124. define Package/wlc/install
  125. $(CP) ./files/* $(1)/
  126. $(INSTALL_DIR) $(1)/sbin
  127. $(INSTALL_BIN) $(PKG_BUILD_DIR)/wlc $(1)/sbin/
  128. endef
  129. define Package/wlc/postinst
  130. #!/bin/sh
  131. [ -n "$${IPKG_INSTROOT}" ] || /etc/init.d/wlunbind enable || true
  132. endef
  133. define Package/wl/install
  134. $(INSTALL_DIR) $(1)/usr/sbin
  135. $(INSTALL_BIN) $(PKG_BUILD_DIR)/wl $(1)/usr/sbin/
  136. endef
  137. define Package/nas/install
  138. $(INSTALL_DIR) $(1)/usr/sbin
  139. $(INSTALL_BIN) $(PKG_BUILD_DIR)/nas $(1)/usr/sbin/
  140. $(LN) nas $(1)/usr/sbin/nas4not
  141. $(LN) nas $(1)/usr/sbin/nas4wds
  142. endef
  143. $(eval $(call KernelPackage,brcm-wl))
  144. $(eval $(call KernelPackage,brcm-wl-mini))
  145. $(eval $(call BuildPackage,wlc))
  146. $(eval $(call BuildPackage,wl))
  147. $(eval $(call BuildPackage,nas))