summaryrefslogtreecommitdiff
path: root/b
blob: 3619121d847392949f429b8668adfd181bfbc3ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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"