提交 f2352877 编写于 作者: P Peter Tyser 提交者: Wolfgang Denk

MAKEALL: Fix return value

Previously MAKEALL would always return a value of 0, even if 1 or more
boards did not compile.  This change causes MAKEALL to return 0 if all
boards were able to build, otherwise 1.

This change also requires changing the script interpreter from sh to
bash to support bash's PIPESTATUS variable.
Signed-off-by: NPeter Tyser <ptyser@xes-inc.com>
上级 fbc1c8f6
#!/bin/sh #!/bin/bash
# Print statistics when we exit # Print statistics when we exit
trap exit 1 2 3 15 trap exit 1 2 3 15
...@@ -39,6 +39,7 @@ LIST="" ...@@ -39,6 +39,7 @@ LIST=""
ERR_CNT=0 ERR_CNT=0
ERR_LIST="" ERR_LIST=""
TOTAL_CNT=0 TOTAL_CNT=0
RC=0
######################################################################### #########################################################################
## MPC5xx Systems ## MPC5xx Systems
...@@ -936,6 +937,12 @@ build_target() { ...@@ -936,6 +937,12 @@ build_target() {
${MAKE} ${JOBS} all 2>&1 >${LOG_DIR}/$target.MAKELOG \ ${MAKE} ${JOBS} all 2>&1 >${LOG_DIR}/$target.MAKELOG \
| tee ${LOG_DIR}/$target.ERR | tee ${LOG_DIR}/$target.ERR
# Check for 'make' errors
if [ ${PIPESTATUS[0]} -ne 0 ] ; then
RC=1
fi
if [ -s ${LOG_DIR}/$target.ERR ] ; then if [ -s ${LOG_DIR}/$target.ERR ] ; then
ERR_CNT=$((ERR_CNT + 1)) ERR_CNT=$((ERR_CNT + 1))
ERR_LIST="${ERR_LIST} $target" ERR_LIST="${ERR_LIST} $target"
...@@ -959,6 +966,8 @@ print_stats() { ...@@ -959,6 +966,8 @@ print_stats() {
echo "Boards with warnings or errors: ${ERR_CNT} (${ERR_LIST} )" echo "Boards with warnings or errors: ${ERR_CNT} (${ERR_LIST} )"
fi fi
echo "----------------------------------------------------------" echo "----------------------------------------------------------"
exit $RC
} }
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册