Makefile 4.5 KB

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