summaryrefslogtreecommitdiff
path: root/examples/b
diff options
context:
space:
mode:
authorpryazha <pryadeiniv@mail.ru>2025-10-12 15:24:30 +0500
committerpryazha <pryadeiniv@mail.ru>2025-10-12 15:24:30 +0500
commit223b1056273f5d48d1c0bbfee75be7b82374d4eb (patch)
tree2b2003aad9c26af7006c5a5c7e2baf1a63ad89e7 /examples/b
parent7e73843ac5873833c707687cd0ada0a3034e600c (diff)
change identation, maybe will change back, add own gl functions loading, and glx example
Diffstat (limited to 'examples/b')
-rwxr-xr-xexamples/b53
1 files changed, 53 insertions, 0 deletions
diff --git a/examples/b b/examples/b
new file mode 100755
index 0000000..9c29028
--- /dev/null
+++ b/examples/b
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+echorun()
+{
+ echo $1
+ $1
+}
+
+compile()
+{
+ echorun "$cc $cflags $include $lflags -o $dir/$1 $dir/$1.c $libs"
+}
+
+cur=`pwd`
+dir=`realpath $0`
+dir=`dirname $dir`
+
+echorun "cd $dir"
+
+if [ "$1" = 'clean' ] ; then
+ echorun "rm -f $dir/macros \
+ $dir/macros.exe \
+ $dir/arena \
+ $dir/arena.exe \
+ $dir/sys \
+ $dir/sys.exe \
+ $dir/string \
+ $dir/string.exe"
+ echorun "cd $cur"
+ exit
+fi
+
+cc='tcc'
+if [ "$1" = 'windows' ] ; then
+ cc='x86_64-w64-mingw32-gcc'
+fi
+
+prbdir="$dir/.."
+if [ ! -e "$prbdir/libprb.a" ] ; then
+ $prbdir/build.sh
+fi
+
+cflags='-g -Wall -std=c99'
+include="-I$prbdir"
+lflags="-L$prbdir"
+libs='-lprb -lm'
+
+compile macros
+compile arena
+compile sys
+compile string
+
+echorun "cd $cur"