]> foleosoft.com Git - QAnsel.git/commitdiff
Sun Jan 19 08:04:51 PM EST 2025
authormiha-q <>
Mon, 20 Jan 2025 01:04:51 +0000 (20:04 -0500)
committermiha-q <>
Mon, 20 Jan 2025 01:04:51 +0000 (20:04 -0500)
Makefile
bin/qansel-source-base.zip
build.sh

index a12183e9c57559e64b789d4ef11df3bddd9a814b..ce398c851f15dbd0a557097b13734d73cbcfd24e 100644 (file)
--- 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
index 19d6db2b28cc190b6e71a9b684f04e38abbceeab..f0daa7863ecf7f4e3e8a89cce2c7e29913bf2b5a 100644 (file)
Binary files a/bin/qansel-source-base.zip and b/bin/qansel-source-base.zip differ
index 2952cffd1be0aa8b035d73fd4681bcfbc9d2f48b..8a2af41079982c7d0c0f0ebcfc146813d9e3d9af 100644 (file)
--- 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"