summaryrefslogtreecommitdiff
path: root/b
diff options
context:
space:
mode:
Diffstat (limited to 'b')
-rwxr-xr-xb58
1 files changed, 58 insertions, 0 deletions
diff --git a/b b/b
new file mode 100755
index 0000000..3619121
--- /dev/null
+++ b/b
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+echorun()
+{
+ echo $1
+ $1
+}
+
+compile()
+{
+ for src in $@ ; do
+ echorun "$cc -c $cflags $include -o $dir/$src.o $dir/$src.c"
+ done
+}
+
+archive()
+{
+ name="$dir/lib$1.a"
+ objs=`echo $@ | cut -d ' ' -f 2-`
+ dirobjs=''
+ echo "ar rcs $name"
+ for obj in $objs ; do
+ dirobjs="$dirobjs $dir/$obj.o"
+ echo "\t$dir/$obj.o"
+ done
+ ar rcs $name $dirobjs
+}
+
+start=`pwd`
+dir=`realpath $0`
+dir=`dirname $dir`
+
+echorun "cd $dir"
+
+if [ "$1" = 'clean' ] ; then
+ echorun "rm -f *.o *.a"
+ echorun "cd $start"
+ exit
+fi
+
+
+cc="gcc"
+cflags="-g -Wall"
+include="-I$dir/../prb"
+lflags=""
+
+srcs='
+camera
+context
+input
+model
+'
+
+compile $srcs
+
+archive prge $srcs
+
+echorun "cd $start"