+ COPTS="-DCONFIG_ATHEROS_RATE_DEFAULT='\"$(RATE_CONTROL)\"' -DATH_REVERSE_ENGINEERING=1" \
+
+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
+ # patch cflags
+ $(SED) 's, -E[LB],,' \
+ -e 's, -mips2,,' \
+ -e 's, -mapcs-32,,' \
+ $(PKG_BUILD_DIR)/hal/public/*.inc
+ $(SED) 's,march=armv4,march=armv5te,' \
+ $(PKG_BUILD_DIR)/hal/public/xscale*.inc
+ endef
+endif