madwifi: add support for drop-in hal replacements
authorFelix Fietkau <nbd@openwrt.org>
Thu, 20 Mar 2008 06:57:01 +0000 (06:57 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 20 Mar 2008 06:57:01 +0000 (06:57 +0000)
SVN-Revision: 10629

package/madwifi/Makefile

index 43ffb340946ef93716eb38041f58ddce985c2144..918424db2d9755ebd2ed058fb81e15abb0810a29 100644 (file)
@@ -134,6 +134,18 @@ MAKE_ARGS:= \
 MAKE_VARS:= \
        COPTS="-DCONFIG_ATHEROS_RATE_DEFAULT='\"$(RATE_CONTROL)\"'" \
 
+HALFILE:=$(lastword $(sort $(wildcard ./ath_hal-*.tgz)))
+ifneq ($(HALFILE),)
+  define Build/Prepare
+       $(call Build/Prepare/Default)
+       rm -rf $(PKG_BUILD_DIR)/tmp
+       mkdir -p $(PKG_BUILD_DIR)/tmp
+       tar xvzf $(HALFILE) -C $(PKG_BUILD_DIR)/tmp
+       $(CP) $(PKG_BUILD_DIR)/tmp/ath_hal*/* $(PKG_BUILD_DIR)/hal/
+       rm -rf $(PKG_BUILD_DIR)/tmp
+  endef
+endif
+
 ifeq ($(findstring AHB,$(BUS)),AHB)
   define Build/Compile/ahb
        $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS) BUS="AHB" modules