summaryrefslogtreecommitdiff
path: root/admin/emake
diff options
context:
space:
mode:
authorGregory Heytings <gregory@heytings.org>2022-09-16 23:32:31 +0000
committerGregory Heytings <gregory@heytings.org>2022-09-17 01:34:30 +0200
commit637cf3ba4955449bc2510da385d39c21f2e0fc42 (patch)
tree53f80517807a4cfbff58d18693a8b8ad85e38587 /admin/emake
parentfe7c015b20b5bca07aa178d28b9fd5cc66ad16f9 (diff)
downloademacs-637cf3ba4955449bc2510da385d39c21f2e0fc42.tar.gz
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.
Diffstat (limited to 'admin/emake')
-rwxr-xr-xadmin/emake30
1 files changed, 26 insertions, 4 deletions
diff --git a/admin/emake b/admin/emake
index 8b2114b3f8c..db4363a25bf 100755
--- a/admin/emake
+++ b/admin/emake
@@ -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 | \