From 470fe2ca88f208e5ff212b2d9802bcb27a2d1a6a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 14 Jul 2021 16:22:53 +0200 Subject: [PATCH] updated shell scripts --- ..._cmake_debug_cfg.sh => cmake_debug_cfg.sh} | 10 ++++-- ...e_cmake_debug_cfg.sh => make_debug_cfg.sh} | 7 +++- ..._relwithdeb_cfg.sh => make_release_cfg.sh} | 9 +++-- ...make_release_cfg.sh => ninja_debug_cfg.sh} | 11 ++++-- .../RPi/crosscompile/ninja_release_cfg.sh | 35 +++++++++++++++++++ 5 files changed, 63 insertions(+), 9 deletions(-) rename cmake/scripts/RPi/{create_cmake_debug_cfg.sh => cmake_debug_cfg.sh} (69%) rename cmake/scripts/RPi/crosscompile/{create_cmake_debug_cfg.sh => make_debug_cfg.sh} (82%) rename cmake/scripts/RPi/crosscompile/{create_cmake_relwithdeb_cfg.sh => make_release_cfg.sh} (77%) rename cmake/scripts/RPi/crosscompile/{create_cmake_release_cfg.sh => ninja_debug_cfg.sh} (78%) create mode 100755 cmake/scripts/RPi/crosscompile/ninja_release_cfg.sh diff --git a/cmake/scripts/RPi/create_cmake_debug_cfg.sh b/cmake/scripts/RPi/cmake_debug_cfg.sh similarity index 69% rename from cmake/scripts/RPi/create_cmake_debug_cfg.sh rename to cmake/scripts/RPi/cmake_debug_cfg.sh index dcea6cd..2d4f57d 100755 --- a/cmake/scripts/RPi/create_cmake_debug_cfg.sh +++ b/cmake/scripts/RPi/cmake_debug_cfg.sh @@ -17,14 +17,18 @@ fi os_fsfw="linux" tgt_bsp="arm/raspberrypi" build_generator="" -builddir="build-Debug-RPi" +builddir="build-Debug" defines="LINUX_CROSS_COMPILE=OFF" if [ "${OS}" = "Windows_NT" ]; then build_generator="MinGW Makefiles" + python="py" # Could be other OS but this works for now. else build_generator="Unix Makefiles" + python="python3" fi - -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ +echo "Running command (without the leading +):" +set -x # Print command +${python} cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ -l "${builddir}" -d "${defines}" +# set +x diff --git a/cmake/scripts/RPi/crosscompile/create_cmake_debug_cfg.sh b/cmake/scripts/RPi/crosscompile/make_debug_cfg.sh similarity index 82% rename from cmake/scripts/RPi/crosscompile/create_cmake_debug_cfg.sh rename to cmake/scripts/RPi/crosscompile/make_debug_cfg.sh index 447f129..2c3e868 100755 --- a/cmake/scripts/RPi/crosscompile/create_cmake_debug_cfg.sh +++ b/cmake/scripts/RPi/crosscompile/make_debug_cfg.sh @@ -17,14 +17,19 @@ fi os_fsfw="linux" tgt_bsp="arm/raspberrypi" build_generator="" -builddir="build-Debug-RPi" +builddir="build-Debug" defines="LINUX_CROSS_COMPILE=ON" if [ "${OS}" = "Windows_NT" ]; then build_generator="MinGW Makefiles" + python="py" # Could be other OS but this works for now. else build_generator="Unix Makefiles" + python="python3" fi +echo "Running command (without the leading +):" +set -x # Print command python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ -l "${builddir}" -d "${defines}" +# set +x diff --git a/cmake/scripts/RPi/crosscompile/create_cmake_relwithdeb_cfg.sh b/cmake/scripts/RPi/crosscompile/make_release_cfg.sh similarity index 77% rename from cmake/scripts/RPi/crosscompile/create_cmake_relwithdeb_cfg.sh rename to cmake/scripts/RPi/crosscompile/make_release_cfg.sh index e7071fc..470c6f1 100755 --- a/cmake/scripts/RPi/crosscompile/create_cmake_relwithdeb_cfg.sh +++ b/cmake/scripts/RPi/crosscompile/make_release_cfg.sh @@ -17,14 +17,19 @@ fi os_fsfw="linux" tgt_bsp="arm/raspberrypi" build_generator="" -builddir="build-Release-RPi" +builddir="build-Release" defines="LINUX_CROSS_COMPILE=ON" if [ "${OS}" = "Windows_NT" ]; then build_generator="MinGW Makefiles" + python="py" # Could be other OS but this works for now. else build_generator="Unix Makefiles" + python="python3" fi -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ +echo "Running command (without the leading +):" +set -x # Print command +python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "release" -t "${tgt_bsp}" \ -l "${builddir}" -d "${defines}" +# set +x diff --git a/cmake/scripts/RPi/crosscompile/create_cmake_release_cfg.sh b/cmake/scripts/RPi/crosscompile/ninja_debug_cfg.sh similarity index 78% rename from cmake/scripts/RPi/crosscompile/create_cmake_release_cfg.sh rename to cmake/scripts/RPi/crosscompile/ninja_debug_cfg.sh index e7071fc..165b2b6 100755 --- a/cmake/scripts/RPi/crosscompile/create_cmake_release_cfg.sh +++ b/cmake/scripts/RPi/crosscompile/ninja_debug_cfg.sh @@ -17,14 +17,19 @@ fi os_fsfw="linux" tgt_bsp="arm/raspberrypi" build_generator="" -builddir="build-Release-RPi" +builddir="build-Debug" defines="LINUX_CROSS_COMPILE=ON" +build_generator="Ninja" if [ "${OS}" = "Windows_NT" ]; then - build_generator="MinGW Makefiles" + python="py" # Could be other OS but this works for now. else - build_generator="Unix Makefiles" + + python="python3" fi +echo "Running command (without the leading +):" +set -x # Print command python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ -l "${builddir}" -d "${defines}" +# set +x diff --git a/cmake/scripts/RPi/crosscompile/ninja_release_cfg.sh b/cmake/scripts/RPi/crosscompile/ninja_release_cfg.sh new file mode 100755 index 0000000..927a554 --- /dev/null +++ b/cmake/scripts/RPi/crosscompile/ninja_release_cfg.sh @@ -0,0 +1,35 @@ +#!/bin/sh +counter=0 +while [ ${counter} -lt 5 ] +do + cd .. + if [ -f "cmake_build_config.py" ];then + break + fi + counter=$((counter=counter + 1)) +done + +if [ "${counter}" -ge 5 ];then + echo "cmake_build_config.py not found in upper directories!" + exit 1 +fi + +os_fsfw="linux" +tgt_bsp="arm/raspberrypi" +build_generator="" +builddir="build-Release" +defines="LINUX_CROSS_COMPILE=ON" +build_generator="Ninja" +if [ "${OS}" = "Windows_NT" ]; then + python="py" +# Could be other OS but this works for now. +else + + python="python3" +fi + +echo "Running command (without the leading +):" +set -x # Print command +python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "release" -t "${tgt_bsp}" \ + -l "${builddir}" -d "${defines}" +# set +x