+ make -j${NCORES} 2>/dev/null 1>/dev/null
+ ERROR_CODE=$?
+
+
+ # The sed regex is more strict than it needs to be.
+ if (( ERROR_CODE != 0 )); then
+ # Use just one core, so we don't mix outputs
+ IFS='' ERROR_OUTPUT=$(make 2>&1)
+ # Without the grep, ERROR_OUTPUT might contain messages such as:
+ # 2885 translated messages, 2169 fuzzy translations, 1356 untranslated messages.
+ ERROR_OUTPUT=$(echo "${ERROR_OUTPUT}" | grep -i "error: ")
+
+ cppORh=$(echo "${ERROR_OUTPUT}" | head -n 1 | \
+ sed 's/.*\.\(cpp\|h\):[0-9]\+:[0-9]\+: error: .*/\1/')
+ if [ "${cppORh}" = "cpp" ]; then
+ PREFIX='suspicious: '
+ elif [ "${cppORh}" != "h" ]; then
+ echo -e "Warning: the error was not parsed correctly."\
+ "\nThe following string was expected to be"\
+ "'.cpp' or '.h': \n ${cppORh}" >&2
+ echo ERROR_OUTPUT: "${ERROR_OUTPUT}"
+ echo cppORh: "${cppORh}"
+ fi
+ fi
+ return "${ERROR_CODE}"