aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform/ext/target/stm/common/stm32l5xx/boards/scripts/armclang/preprocess.sh9
-rw-r--r--platform/ext/target/stm/common/stm32l5xx/boards/scripts/gcc/preprocess.sh8
-rw-r--r--platform/ext/target/stm/common/stm32l5xx/boards/scripts/iar/preprocess.sh8
-rw-r--r--platform/ext/target/stm/common/stm32l5xx/boards/scripts/postbuild.sh7
4 files changed, 26 insertions, 6 deletions
diff --git a/platform/ext/target/stm/common/stm32l5xx/boards/scripts/armclang/preprocess.sh b/platform/ext/target/stm/common/stm32l5xx/boards/scripts/armclang/preprocess.sh
index a243bc2d8b..52aedc59ae 100644
--- a/platform/ext/target/stm/common/stm32l5xx/boards/scripts/armclang/preprocess.sh
+++ b/platform/ext/target/stm/common/stm32l5xx/boards/scripts/armclang/preprocess.sh
@@ -14,7 +14,14 @@
# arg1 is the build directory
# arg2 is the file to preprocess
# arg3 is output file beeing preprocessed
+# arg4 is optional, it fixes compiler full path if present
+
function preprocess
(
-armclang --target=arm-arm-none-eabi -march=armv8-m.main -E -P -xc -I$1 $2 -o $3
+local compiler=armclang
+if [ $# -eq 4 ]; then
+ compiler=$4
+fi
+
+$compiler --target=arm-arm-none-eabi -march=armv8-m.main -E -P -xc -I$1 $2 -o $3
)
diff --git a/platform/ext/target/stm/common/stm32l5xx/boards/scripts/gcc/preprocess.sh b/platform/ext/target/stm/common/stm32l5xx/boards/scripts/gcc/preprocess.sh
index 24d8b89db3..789d835258 100644
--- a/platform/ext/target/stm/common/stm32l5xx/boards/scripts/gcc/preprocess.sh
+++ b/platform/ext/target/stm/common/stm32l5xx/boards/scripts/gcc/preprocess.sh
@@ -16,9 +16,13 @@
# arg1 is the build directory
# arg2 is the file to preprocess
# arg3 is output file beeing preprocessed
-# arg4 is the GCC compiler full path
+# arg4 is optional, it fixes the GCC compiler full path if present
function preprocess
(
-$4 -E -P -xc -I$1 -o$3 $2
+local compiler=arm-none-eabi-gcc
+if [ $# -eq 4 ]; then
+ compiler=$4
+fi
+$compiler -E -P -xc -I$1 -o$3 $2
)
diff --git a/platform/ext/target/stm/common/stm32l5xx/boards/scripts/iar/preprocess.sh b/platform/ext/target/stm/common/stm32l5xx/boards/scripts/iar/preprocess.sh
index c1ca468937..351607c782 100644
--- a/platform/ext/target/stm/common/stm32l5xx/boards/scripts/iar/preprocess.sh
+++ b/platform/ext/target/stm/common/stm32l5xx/boards/scripts/iar/preprocess.sh
@@ -14,7 +14,13 @@
# arg1 is the build directory
# arg2 is the file to preprocess
# arg3 is output file beeing preprocessed
+# arg4 is optional, it fixes compiler full path if present
+
function preprocess
(
-iccarm --cpu=Cortex-M33 -I$1 $2 --silent --preprocess=ns $3
+local compiler=iccarm
+if [ $# -eq 4 ]; then
+ compiler=$4
+fi
+$compiler --cpu=Cortex-M33 -I$1 $2 --silent --preprocess=ns $3
) \ No newline at end of file
diff --git a/platform/ext/target/stm/common/stm32l5xx/boards/scripts/postbuild.sh b/platform/ext/target/stm/common/stm32l5xx/boards/scripts/postbuild.sh
index 6a8f856e3b..fa1ab69c14 100644
--- a/platform/ext/target/stm/common/stm32l5xx/boards/scripts/postbuild.sh
+++ b/platform/ext/target/stm/common/stm32l5xx/boards/scripts/postbuild.sh
@@ -14,14 +14,17 @@
# * opensource.org/licenses/BSD-3-Clause
# *
# ******************************************************************************
-
+# arg1 is optional, it fixes compiler full path if present
# Absolute path to this script
SCRIPT=$(readlink -f $0)
# Absolute path this script
projectdir=`dirname $SCRIPT`
source $projectdir/preprocess.sh
# Compiler full name & path is passed as argument
-compiler_full_path=$1
+compiler_full_path=
+if [ $# -eq 1 ]; then
+ compiler_full_path=$1
+fi
# the file to preprocess is generated and present outside of install dir
bl2_file_to_preprocess=$projectdir/image_macros_to_preprocess_bl2.c
preprocess_bl2_file=$projectdir/image_macros_preprocessed_bl2.c