#!/usr/bin/env bash

rm htc_9271.fw
rm htc_7010.fw

# MAKE=gmake
MAKE=make

echo "*** AR9271 ***"
( cd target_firmware/magpie_fw_dev/build/k2_1_0/image/k2_ram	\
    && source builds_fusion_vista.ram				\
    && ${MAKE} clean ; ${MAKE} && ${MAKE} build && ${MAKE} build )
cp target_firmware/magpie_fw_dev/build/k2_1_0/image/k2_ram/htc_9271.fw .

echo "*** AR7010 ***"
( cd target_firmware/magpie_fw_dev/build/magpie_1_1/image/magpie_ram	\
    && source merlin_fusion.ram					\
    && ${MAKE} clean ; ${MAKE} && ${MAKE} build && ${MAKE} build )

cp target_firmware/magpie_fw_dev/build/magpie_1_1/image/magpie_ram/htc_7010.fw .

echo "*** Done! ***"
