# HG changeset patch # User Mike Becker # Date 1766150029 -3600 # Node ID 17ae707281399ab24e8ce76072d5caf4408051a2 # Parent ac24ad6c8595d080273a57e53536d7e0eb859faa check-all.sh now also works when nothing has been configured so far diff -r ac24ad6c8595 -r 17ae70728139 check-all.sh --- a/check-all.sh Fri Dec 19 14:06:21 2025 +0100 +++ b/check-all.sh Fri Dec 19 14:13:49 2025 +0100 @@ -1,12 +1,20 @@ #!/bin/sh +# determine number of processors +nproc=`nproc` + # backup config -cp config.mk config.mk.bak +if [ -f config.mk ]; then + cp config.mk config.mk.bak + restore=1 +else + restore=0 +fi perform_check() { make clean > /dev/null - if ! make check -j`nproc` > /dev/null ; then + if ! make check -j$nproc > /dev/null ; then echo "fail." else echo "ok." @@ -17,7 +25,7 @@ { make clean > /dev/null # we cannot mute the warnings, so throw away everything - if ! make check-cxx -j`nproc` > /dev/null 2> /dev/null ; then + if ! make check-cxx -j$nproc > /dev/null 2> /dev/null ; then echo "fail." else echo "ok." @@ -46,7 +54,11 @@ CC=gcc CFLAGS=-std=c23 ./configure --debug > /dev/null perform_check -# clean build files and restore config +# clean build files and rebuild with restored config make clean > /dev/null -mv config.mk.bak config.mk -make check -j`nproc` +if [ $restore -eq 1 ]; then + mv config.mk.bak config.mk + make -j$nproc > /dev/null +else + rm config.mk +fi