+MADWIFI_INC = \
+ -I$(PKG_BUILD_DIR) \
+ -I$(PKG_BUILD_DIR)/include \
+ -I$(PKG_BUILD_DIR)/hal \
+ -I$(PKG_BUILD_DIR)/ath \
+ -I$(PKG_BUILD_DIR)/ath_hal \
+ -I$(PKG_BUILD_DIR)/net80211 \
+ -I$(STAGING_DIR)/usr/include/wprobe \
+ -include $(PKG_BUILD_DIR)/include/compat.h
+
+MAKE_ARGS:= \
+ PATH="$(TARGET_PATH)" \
+ ARCH="$(LINUX_KARCH)" \
+ ARCH-y="$(LINUX_KARCH)" \
+ CROSS_COMPILE="$(TARGET_CROSS)" \
+ TARGET="$(HAL_TARGET)" \
+ TOOLPREFIX="$(KERNEL_CROSS)" \
+ TOOLPATH="$(KERNEL_CROSS)" \
+ KERNELPATH="$(LINUX_DIR)" \
+ LDOPTS="--no-warn-mismatch " \
+ ATH_RATE="$(RATE_CONTROL)" \
+ ATH_CAP_SUPERG_COMP="$(COMPRESSION)" \
+ DO_MULTI=1 \
+ SINGLE_MODULE=$(if $(CONFIG_MADWIFI_SINGLE_MODULE),1) \
+ INCS="$(MADWIFI_INC)" \
+ $(if $(CONFIG_MADWIFI_DEBUG),,DEBUG=) WARNINGS="-Wno-unused"
+
+MAKE_VARS:= \
+ COPTS="-DATH_REVERSE_ENGINEERING=1" \
+
+define Build/Prepare/HAL
+ rm -rf $(PKG_BUILD_DIR)/tmp
+ mkdir -p $(PKG_BUILD_DIR)/tmp
+ tar xvzf $(DL_DIR)/$(HAL_FILE) -C $(PKG_BUILD_DIR)/tmp
+ $(CP) $(PKG_BUILD_DIR)/tmp/ath_hal*/* $(PKG_BUILD_DIR)/hal/
+ rm -rf $(PKG_BUILD_DIR)/tmp