dbuild: refactor getting built file
1. The filename extension is determined by configuration so
that dbuild should use that.
2. When CONFIG_BUILD_PROTECTED is enabled, tinyara_user file
has to be made. Let's use that file.
The same as wifi with CONFIG_APP_BINARY_SEPARATION.
@@ -55,24 +55,35 @@ function FIND_BINFILE()
{
source ${CONFIGFILE}
BOARDNAME=${CONFIG_ARCH_BOARD}
+ if [[ "${CONFIG_RAW_BINARY}" == "y" ]]; then
+ EXTNAME=".bin"
+ elif [[ "${CONFIG_INTELHEX_BINARY}" == "y" ]]; then
+ EXTNAME=".hex"
+ elif [[ "${CONFIG_MOTOROLA_SREC}" == "y" ]]; then
+ EXTNAME=".srec"
+ else
+ EXTNAME=""
+ fi
+ if [[ "${CONFIG_BUILD_PROTECTED}" == "y" ]]; then
+ BINFILE="${BINDIR}/tinyara_user${EXTNAME}"
+ else
if [[ "${CONFIG_ARCH_BOARD}" == "esp32"* ]]; then
- BINFILE="${BINDIR}/tinyara.elf.bin"
+ BINFILE="${BINDIR}/tinyara.elf${EXTNAME}"
elif [[ "${CONFIG_ARCH_BOARD}" == "imxrt"* ]]; then
# This must be same as imxrt10x0-evk_download.sh in build/configs/imxrt
if [[ "${CONFIG_APP_BINARY_SEPARATION}" == "y" ]]; then
- BINFILE="${BINDIR}/tinyara_flash.bin"
- elif [[ "${CONFIG_BUILD_PROTECTED}" == "y" ]]; then
- BINFILE="${BINDIR}/tinyara_prot.hex"
+ BINFILE="${BINDIR}/wifi"
else
- BINFILE="${BINDIR}/tinyara.hex"
+ BINFILE="${BINDIR}/tinyara${EXTNAME}"
fi
elif [[ "${CONFIG_ARCH_BOARD}" == "artik05x" ]]; then
- BINFILE="${BINDIR}/tinyara_head.bin"
+ BINFILE="${BINDIR}/tinyara_head${EXTNAME}"
elif [[ "${CONFIG_ARCH_BOARD}" == "cy4390x" ]]; then
BINFILE="${BINDIR}/tinyara_master_strip"
else
- BINFILE="${BINDIR}/tinyara.bin"
+ BINFILE="${BINDIR}/tinyara${EXTNAME}"
+ fi
fi
}
