summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Heyl <edheyl@google.com>2014-07-18 18:38:24 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-07-18 18:38:24 +0000
commitfad4676b67944acd14d2241ac666bbc5e69b6d54 (patch)
tree93331e54419d4d4d4d957a182112f1a7cc1f70f8
parent9384878820ec7c881fdf054e8a0a88b2d1b94f64 (diff)
parent6190a0c3b33ea43639a7e748182fbac62560a09d (diff)
downloadbuild-fad4676b67944acd14d2241ac666bbc5e69b6d54.zip
build-fad4676b67944acd14d2241ac666bbc5e69b6d54.tar.gz
build-fad4676b67944acd14d2241ac666bbc5e69b6d54.tar.bz2
am 6190a0c3: back port cc6be0a3: wrap make. do not merge
* commit '6190a0c3b33ea43639a7e748182fbac62560a09d': back port cc6be0a3: wrap make. do not merge
-rw-r--r--envsetup.sh32
1 files changed, 30 insertions, 2 deletions
diff --git a/envsetup.sh b/envsetup.sh
index 482bb19..af86dd0 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -36,7 +36,7 @@ function get_abs_build_var()
return
fi
(\cd $T; CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
- make --no-print-directory -f build/core/config.mk dumpvar-abs-$1)
+ command make --no-print-directory -f build/core/config.mk dumpvar-abs-$1)
}
# Get the exact value of a build variable.
@@ -48,7 +48,7 @@ function get_build_var()
return
fi
(\cd $T; CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
- make --no-print-directory -f build/core/config.mk dumpvar-$1)
+ command make --no-print-directory -f build/core/config.mk dumpvar-$1)
}
# check to see if the supplied product is one we can build
@@ -1454,6 +1454,34 @@ function pez {
return $retval
}
+function make()
+{
+ local start_time=$(date +"%s")
+ command make "$@"
+ local ret=$?
+ local end_time=$(date +"%s")
+ local tdiff=$(($end_time-$start_time))
+ local hours=$(($tdiff / 3600 ))
+ local mins=$((($tdiff % 3600) / 60))
+ local secs=$(($tdiff % 60))
+ echo
+ if [ $ret -eq 0 ] ; then
+ echo -n -e "#### make completed successfully "
+ else
+ echo -n -e "#### make failed to build some targets "
+ fi
+ if [ $hours -gt 0 ] ; then
+ printf "(%02g:%02g:%02g (hh:mm:ss))" $hours $mins $secs
+ elif [ $mins -gt 0 ] ; then
+ printf "(%02g:%02g (mm:ss))" $mins $secs
+ elif [ $secs -gt 0 ] ; then
+ printf "(%s seconds)" $secs
+ fi
+ echo -e " ####"
+ echo
+ return $ret
+}
+
if [ "x$SHELL" != "x/bin/bash" ]; then
case `ps -o command -p $$` in
*bash*)