RT1050_FreeRTOS_Hello/build_all.sh

28 lines
692 B
Bash

#!/bin/sh
if [ ! -d "build" ]; then mkdir build; fi
cd build
TARGETS=(
"debug"
"release"
"sdram_debug"
"sdram_release"
"flexspi_nor_debug"
"flexspi_nor_release"
)
for TARGET in "${TARGETS[@]}" ; do
if [ -d "${TARGET}" ]; then rm -rf ${TARGET}; fi
mkdir ${TARGET} && cd ${TARGET}
if [ -d "CMakeFiles" ];then rm -rf CMakeFiles; fi
if [ -f "Makefile" ];then rm -f Makefile; fi
if [ -f "cmake_install.cmake" ];then rm -f cmake_install.cmake; fi
if [ -f "CMakeCache.txt" ];then rm -f CMakeCache.txt; fi
cmake -DCMAKE_TOOLCHAIN_FILE="armgcc.cmake" -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${TARGET} ../.. && make -j1
RET=$?
if [ ! 0 -eq ${RET} ]; then exit ${RET}; fi
cd ..
done