This change adds some basic summary information to the MAKEALL script. The summary information includes how many boards were compiled, how many boards had compile warnings or errors, and which specific boards had compile warnings or errors.
This information is useful when doing compile testing to quickly determine which boards are broken. As a side benefit, no empty $BOARD.ERR files are generated by MAKEALL. Previously, each board had a corresponding $BOARD.ERR file, even if the board compiled cleanly. Signed-off-by: Peter Tyser <pty...@xes-inc.com> --- Changes since v1: - Fix issue where summary was printed multiple times when a list was composed of sublists Changes since v2: - Update script to only use POSIX arithmetic Changes since v3: - Remove unnecessary expansion of variables inside of $(( ... )) MAKEALL | 32 +++++++++++++++++++++++++++++--- 1 files changed, 29 insertions(+), 3 deletions(-) diff --git a/MAKEALL b/MAKEALL index 1d50c34..c8e7add 100755 --- a/MAKEALL +++ b/MAKEALL @@ -1,11 +1,14 @@ #!/bin/sh +# Print statistics when ctrl-c is pressed +trap "print_stats; exit " 2 + # Determine number of CPU cores if no default was set : ${BUILD_NCPUS:="`getconf _NPROCESSORS_ONLN`"} if [ "$BUILD_NCPUS" -gt 1 ] then - JOBS=-j`expr "$BUILD_NCPUS" + 1` + JOBS="-j $((BUILD_NCPUS + 1))" else JOBS="" fi @@ -31,6 +34,11 @@ fi LIST="" +# Keep track of the number of builds and errors +ERR_CNT=0 +ERR_LIST="" +TOTAL_CNT=0 + ######################################################################### ## MPC5xx Systems ######################################################################### @@ -898,8 +906,14 @@ build_target() { ${MAKE} distclean >/dev/null ${MAKE} ${target}_config - ${MAKE} ${JOBS} all 2>&1 >${LOG_DIR}/$target.MAKELOG \ - | tee ${LOG_DIR}/$target.ERR + ERR=$(${MAKE} ${JOBS} all 2>&1 > ${LOG_DIR}/$target.MAKELOG) + if [ "${ERR}" ] ; then + echo "$ERR" | tee ${LOG_DIR}/$target.ERR + ERR_CNT=$((ERR_CNT + 1)) + ERR_LIST="${ERR_LIST} $target" + fi + + TOTAL_CNT=$((TOTAL_CNT + 1)) ${CROSS_COMPILE}size ${BUILD_DIR}/u-boot \ | tee -a ${LOG_DIR}/$target.MAKELOG @@ -907,7 +921,17 @@ build_target() { #----------------------------------------------------------------------- +print_stats() { + echo "" + echo "--------------------- SUMMARY ----------------------------" + echo "Boards compiled: ${TOTAL_CNT}" + if [ ${ERR_CNT} -gt 0 ] ; then + echo "Boards with warnings or errors: ${ERR_CNT} (${ERR_LIST} )" + fi + echo "----------------------------------------------------------" +} +#----------------------------------------------------------------------- for arg in $@ do case "$arg" in @@ -932,3 +956,5 @@ do ;; esac done + +print_stats -- 1.6.2.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot