summaryrefslogtreecommitdiff
path: root/example/b
diff options
context:
space:
mode:
Diffstat (limited to 'example/b')
-rwxr-xr-xexample/b40
1 files changed, 40 insertions, 0 deletions
diff --git a/example/b b/example/b
new file mode 100755
index 0000000..4ccb9a4
--- /dev/null
+++ b/example/b
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+echorun()
+{
+ echo $1
+ $1
+}
+
+compile()
+{
+ echorun "$cc -c $cflags $include $lflags -o $1.o $1.c $libs"
+}
+
+compile_and_link()
+{
+ echorun "$cc $cflags $include $lflags -o $1 $1.c $libs"
+}
+
+start=`pwd`
+dir=`realpath $0`
+dir=`dirname $dir`
+
+echorun "cd $dir"
+
+if [ "$1" = 'clean' ] ; then
+ echorun "rm -f *.o linux"
+ echorun "cd $start"
+ exit
+fi
+
+cc='gcc'
+cflags='-g'
+
+include="-I../../prb -I../../prge"
+lflags="-L../../prb -L../../prge"
+libs='-lprb -lprge -lGL -lX11 -lm'
+
+compile_and_link linux
+
+echorun "cd $start"