From 44c77960afcf11f99d93083135853e3db3da1681 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Fri, 9 Jan 2026 13:22:20 -0700 Subject: [PATCH] os-test-bins: pre-compile tests using makefiles, so they can be run using makefiles on redox --- recipes/tests/os-test-bins/recipe.toml | 30 ++++++++++---------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/recipes/tests/os-test-bins/recipe.toml b/recipes/tests/os-test-bins/recipe.toml index 96edb9d30..c62cb519b 100644 --- a/recipes/tests/os-test-bins/recipe.toml +++ b/recipes/tests/os-test-bins/recipe.toml @@ -5,24 +5,16 @@ same_as = "../os-test" template = "custom" script = """ DYNAMIC_INIT -SRC=${COOKBOOK_SOURCE} -DST=${COOKBOOK_STAGE}/root/os-test -if [ -z "$TESTBIN" ]; then -pushd ${SRC} -for file in */*/*.c; do - filename="${file%.*}" - mkdir -p $(dirname $DST/$filename) - # adding "true" because compilation can fail - ${CC} ${CFLAGS} ${LDFLAGS} "$SRC/$file" -o "$DST/$filename" -Wall || true - echo "./$filename" >> $DST/run.sh -done -popd -else - mkdir -p $(dirname $DST/$TESTBIN) - ${CC} ${CFLAGS} ${LDFLAGS} "$SRC/$TESTBIN.c" -o "$DST/$TESTBIN" -Wall -fi -if [ -n "TESTBIN" ]; then -"${COOKBOOK_REDOXER}" write-exec "$DST/$TESTBIN" -fi +# Copy source to /usr/share/os-test +mkdir -p "${COOKBOOK_STAGE}/usr/share/os-test" +cd "${COOKBOOK_STAGE}/usr/share/os-test" +rsync -a "${COOKBOOK_SOURCE}/" "./" + +# Pre-compile tests for Redox +make OS=Redox CC="${CC_WRAPPER} ${GNU_TARGET}-gcc" \ + CFLAGS= CPPFLAGS= \ + LDFLAGS= EXTRA_LDFLAGS= \ + CC_FOR_BUILD="${CC_WRAPPER} cc" CFLAGS_FOR_BUILD= CPPFLAGS_FOR_BUILD= \ + LDFLAGS_FOR_BUILD= -j ${COOKBOOK_MAKE_JOBS} all """