Commit b7613d2f authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

add set -e before WMC tool runs

parent 7ddcb8bc
Loading
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -213,7 +213,8 @@ shopt -u extglob
# patch code before wmc_tool: replace hexadecimal unsigned long constants (0x...UL) by regular integer constant + cast to unsigned long
find $targetdir -name "*.[ch]" -exec sed -i.bak -e "s/\(0x[0-9a-fA-F]*\)UL/\(\(unsigned long\)\1\)/" \{\} \;

# run wmc_tool
# run wmc_tool, exit if the command fails
set -e
"tools/$system/wmc_tool" $wmc_opt -m "$targetdir/apps/encoder.c" "$targetdir/lib_enc/*.c" "$targetdir/lib_com/*.c"  >> wmc_tool_output.txt 2>&1
"tools/$system/wmc_tool" $wmc_opt -m "$targetdir/apps/decoder.c" "$targetdir/lib_dec/*.c" "$targetdir/lib_rend/*.c" >> wmc_tool_output.txt 2>&1
# ISAR post-renderer and lc3plus sources only need to be instrumented in float code
@@ -229,6 +230,7 @@ else
    for bak_file in $targetdir/lib_rend/*.bak; do mv "$bak_file" "${bak_file%.*}"; done      # restore fresh .c files to avoid time-consuming des-instrumentation of files by the WMC tool
    "tools/$system/wmc_tool" $wmc_opt -m "$targetdir/apps/renderer.c" "$targetdir/lib_rend/*.c" >> wmc_tool_output.txt 2>&1
fi
set +e

# automatically enable #define WMOPS in options.h
sed -i.bak -e "s/\/\*[[:space:]]*\(#define[[:space:]]*WMOPS\)[[:space:]]*\*\//\1/g" $targetdir/lib_com/options.h