From: miha-q <> Date: Mon, 20 Jan 2025 01:04:51 +0000 (-0500) Subject: Sun Jan 19 08:04:51 PM EST 2025 X-Git-Url: http://www.foleosoft.com/?a=commitdiff_plain;h=7ef78c23891ffcdb6176336923bc4e332bbb41c4;p=QAnsel.git Sun Jan 19 08:04:51 PM EST 2025 --- diff --git a/Makefile b/Makefile index a12183e..ce398c8 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ all: bash build.sh -# echo "Please use build.sh script." -commit: - git add src/ examples/ Makefile build.sh - git commit -m "`date`" - git push +simple: + bash build.sh simple + +source: + bash build.sh src requirements: sudo apt install libsdl2-dev diff --git a/bin/qansel-source-base.zip b/bin/qansel-source-base.zip index 19d6db2..f0daa78 100644 Binary files a/bin/qansel-source-base.zip and b/bin/qansel-source-base.zip differ diff --git a/build.sh b/build.sh index 2952cff..8a2af41 100644 --- a/build.sh +++ b/build.sh @@ -1,5 +1,19 @@ #!/bin/sh +if [ "$1" = "src" ] +then + name="qansel-source-base" + mv src $name + find \ + -wholename ./Makefile \ + -o -wholename ./build.sh \ + -o -name *.c \ + -o -name *.h \ + | zip -@ bin/$name.zip + mv $name src + exit +fi + echo "Verifying build commands exist..." for i in echo cat grep sed xxd gcc rm printf uname do @@ -24,19 +38,16 @@ EOF cd .. fi -cat src/kernel.c | grep -vi '{gpu_only}' | sed -e 's/__global //' -e 's/__kernel //' > src/kernel_cpu.c -cat src/kernel.c | grep -vi '{cpu_only}' > src/.kernel.tmp.1 -tmp="$(cat src/.kernel.tmp.1)" -printf "%s\0" "$tmp" > src/.kernel.tmp.2 -xxd -i src/.kernel.tmp.2 | sed -e 's/src__kernel_tmp_2/kernel_gpu/' -e 's/unsigned/static unsigned/' > src/kernel_gpu.c -rm src/.kernel.tmp* 2>/dev/null +cat src/kernel.c | grep -vi '{gpu_only}' > src/kernel_cpu.c +echo 'static unsigned char kernel_gpu[] = {' > src/kernel_gpu.c +cat src/kernel.c | grep -vi '{cpu_only}' | xxd -i >> src/kernel_gpu.c +echo ', 0x00 };' >> src/kernel_gpu.c if [ ! "$COPY_BUILD" = "" ] then rm "src/kernel.c" fi - if [ "$1" = "cl" ] then exit @@ -77,7 +88,7 @@ EOF bcmd="gcc $i.c -c -o ../obj/$i.o $cflags" echo "$bcmd" $($bcmd) - fcmd="$fcmd $i.o" + fcmd="$fcmd $i.o" if [ ! "$COPY_BUILD" = "" ] then rm "$i.c"