summaryrefslogtreecommitdiffstats
path: root/utils/brmake
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-07-01 18:07:00 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-07-01 18:07:00 +0200
commit7ca9fc3170de1a41fbcbc5dfdc2838c75bff72a5 (patch)
tree414aac66ba7b23b1f9e4beca5fa02bd83dd90202 /utils/brmake
parentafdb545b2847d2a922ee202775998d4658900fec (diff)
downloadbuildroot-7ca9fc3170de1a41fbcbc5dfdc2838c75bff72a5.tar.gz
buildroot-7ca9fc3170de1a41fbcbc5dfdc2838c75bff72a5.zip
tools: rename to 'utils'
After some discussion, we found out that "tools" has the four first letters identical to the "toolchain" subfolder, which makes it a bit unpractical with tab-completion. So, this commit renames "tools" to "utils", which is more tab-completion-friendly. This has been discussed with Arnout and Yann. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'utils/brmake')
-rwxr-xr-xutils/brmake37
1 files changed, 37 insertions, 0 deletions
diff --git a/utils/brmake b/utils/brmake
new file mode 100755
index 0000000000..3c6f8485ab
--- /dev/null
+++ b/utils/brmake
@@ -0,0 +1,37 @@
+#!/bin/bash
+# (C) 2016, "Yann E. MORIN" <yann.morin.1998@free.fr>
+# License: WTFPL, https://spdx.org/licenses/WTFPL.html
+
+main() {
+ local found ret start d h m mf
+
+ if ! which unbuffer >/dev/null 2>&1; then
+ printf "you need to install 'unbuffer' (from package expect or expect-dev)\n" >&2
+ exit 1
+ fi
+
+ start=${SECONDS}
+
+ ( exec 2>&1; unbuffer make "${@}"; ) \
+ > >( while read line; do
+ printf "%(%Y-%m-%dT%H:%M:%S)T %s\n" -1 "${line}"
+ done \
+ |tee -a br.log \
+ |grep --colour=never -E '>>>'
+ )
+ ret=${?}
+
+ d=$((SECONDS-start))
+ printf "Done in "
+ h=$((d/3600))
+ d=$((d%3600))
+ [ ${h} -eq 0 ] || { printf "%dh " ${h}; mf="02"; }
+ m=$((d/60))
+ d=$((d%60))
+ [ ${m} -eq 0 ] || { printf "%${mf}dmin " ${m}; sf="02"; }
+ printf "%${sf}ds\n" ${d}
+
+ return ${ret}
+}
+
+main "${@}"
OpenPOWER on IntegriCloud