1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00

Various improvements to admin/emake.

* admin/emake: Return the status code of make when the build fails.
Filter the output of emake *clean.  Add three options --no-color
(useful for emake check for example), --no-check (useful for quicker
builds during development) and --no-fast.
This commit is contained in:
Gregory Heytings 2022-09-16 23:32:31 +00:00
parent fe7c015b20
commit 637cf3ba49

View File

@ -20,7 +20,11 @@ if [ -f /proc/cpuinfo ]; then
sed 's/^[0-9]*/+/')))
fi
make FAST=true -j$cores "$@" 2>&1 | \
[[ "X$1" == "X--no-color" ]] && { NOCOLOR=1; shift; } || NOCOLOR=0
[[ "X$1" == "X--no-check" ]] && { NOCHECK=1; shift; } || NOCHECK=0
[[ "X$1" == "X--no-fast" ]] && { FASTOPT=""; shift; } || FASTOPT="FAST=true"
make $FASTOPT -j$cores "$@" 2>&1 | \
sed -u 's# \.\./\.\./# #
s# \.\./# #
s#^Configuring local git # Configuring local git #
@ -30,6 +34,7 @@ s#^Configured for # Configured for #
s#^./temacs.*# \\& #
s#^make.*Error# \\& #
s#^Dumping under the name.*# \\& #
:a;/\\$/N;s/\\\n//;ta
' | \
grep -E --line-buffered -v "^make|\
^Loading|\
@ -82,16 +87,33 @@ The GNU allocators don't work|\
^\^\(\(|\
^ANCIENT=yes make|\
^touch -t|\
^'build-aux/git-hooks\
^'build-aux/git-hooks|\
^GNUmakefile:[0-9]*: There seems to be no |\
^GNUmakefile:[0-9]*: Running |\
^GNUmakefile:[0-9]*: No Makefile|\
^rm -f |\
^rm -rf|\
^find \. |\
^rm -fr deps|\
^if test -f \./\.gdbinit|\
^true|\
^for file in |\
^rmdir|\
^\[ \"\.\" = \"\.\" \]\
" | \
while read
do
C=""
[[ "X${REPLY:0:1}" != "X " ]] && C="\033[1;31m"
[[ "X${REPLY:0:3}" == "X " ]] && C="\033[1;31m"
(($NOCOLOR == 0)) && [[ "X${REPLY:0:1}" != "X " ]] && C="\033[1;31m"
(($NOCOLOR == 0)) && [[ "X${REPLY:0:3}" == "X " ]] && C="\033[1;31m"
[[ "X$C" == "X" ]] && printf "%s\n" "$REPLY" || printf "$C%s\033[0m\n" "$REPLY"
done
# If make failed, exit now with its error code.
((${PIPESTATUS[0]} != 0)) && exit ${PIPESTATUS[0]}
(($NOCHECK == 1)) && exit 0
# Run a "make check" on all test files belonging to files that have
# changed since last time.
make -j$cores check-maybe 2>&1 | \