Parallelize build jobs according to CPU count

This commit is contained in:
Rangi
2026-07-05 20:58:50 -04:00
committed by Rangi
parent 5d5000011a
commit 189c679e13
9 changed files with 99 additions and 44 deletions
+5 -4
View File
@@ -7,10 +7,11 @@ usage() {
cat <<"EOF"
Downloads source code of Game Boy project repos used as RGBDS test cases.
Options:
-h, --help show this help message
--only-free download only freely licensed codebases
--get-hash print repos' commit hashes instead of downloading them
--get-paths print repos' clone paths instead of downloading them
-h, --help show this help message
--only-free download only freely licensed codebases
--only-nonfree download only non-freely licensed codebases
--get-hash print repos' commit hashes instead of downloading them
--get-paths print repos' clone paths instead of downloading them
EOF
}
+8 -5
View File
@@ -8,13 +8,16 @@ export SOURCE_DATE_EPOCH=609165296
cd "$(dirname "$0")"
if [ ! -f "$1.cfg" ]; then
echo >&2 'External test file '"$1"'.cfg does not exist'
NAME="$1"
shift # Any remaining arguments get forwarded to `make`.
if [ ! -f "$NAME.cfg" ]; then
echo >&2 'External test file '"$NAME"'.cfg does not exist'
exit 1
fi
# Sourcing "$1.cfg" defines `EXT_TEST_*` variables used below.
. "$1.cfg"
# Sourcing "$NAME.cfg" defines `EXT_TEST_*` variables used below.
. "$NAME.cfg"
if ! cd "$EXT_TEST_REPO"; then
echo >&2 'Please fetch test deps before running any external test'
@@ -23,7 +26,7 @@ fi
RGBDS_PATH="RGBDS=../../../"
git clean -fdx # Clean any previous build products so `make` rebuilds everything from scratch.
make -j4 "$EXT_TEST_TARGET" $RGBDS_PATH
make "$@" "$EXT_TEST_TARGET" $RGBDS_PATH
hash="$(sha1sum -b "$EXT_TEST_FILE" | head -c 40)"
if [ "$hash" != "$EXT_TEST_HASH" ]; then