Makefile 4.5 KB

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