src.dualinventive.com/jjacobs/dinetrpcll-sniffer/libdipp/common/mk/dist-hex.sh

21 lines
566 B
Bash
Executable File

#!/bin/bash
mkdir -p build/dist
rm -f build/dist/*
for target in Debug Release; do
VERSION=`cat build/$target/include/di/version.h | grep APPLICATION_VERSION | awk '{print $NF}'| sed 's/"//g'`
for i in build/$target/*.hex build/$target/*.map build/$target/*.elf build/$target/*.bin; do
if [[ "$target" == "Debug" ]]; then
TARGET_NAME="`basename $i | cut -d. -f 1`-debug_${VERSION}.`basename $i | cut -d. -f 2`"
else
TARGET_NAME="`basename $i | cut -d. -f 1`_${VERSION}.`basename $i | cut -d. -f 2`"
fi
cp $i build/dist/$TARGET_NAME;
done
done