Clean up build output on terminals.

If we're not writing out to a terminal, then echo each file out as it is
being compiled. Otherwise, if we are on a terminal, overwrite the previous
line.
This commit is contained in:
Jordan Bancino 2023-01-07 19:14:15 +00:00
parent 56105c8a61
commit 472a6ccbf7

View file

@ -93,7 +93,11 @@ recipe_build() {
objs="$objs $obj"
if [ $(mod_time "$src") -ge $(mod_time "$obj") ]; then
echo "CC $(basename $obj)"
if [ -t 1 ]; then
printf "CC %s\t\t\t\r" "$(basename $obj)"
else
echo "CC $(basename $obj)"
fi
obj_dir=$(dirname "$obj")
mkdir -p "$obj_dir"
if ! $CC $CFLAGS -Iinclude -c -o "$obj" "$src"; then