5 source ~/agl/sdk/porter/environment*
6 if [ ! -d "$1/$2" ]; then
7 echo "INFO: build dir ($1/$2) doesn't exist, created it!"
12 cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=$3 $1
19 if [ -d "$1/$2" ]; then
30 echo "Usage: build.sh <action> <subdir> [config]"
31 echo " action: can be one of the following"
32 echo " build: build this project."
33 echo " rebuild: rebuild this project."
34 echo " clean: clean the previous build."
35 echo " install: install the build result."
36 echo " subdir: the subdir into which the build is done."
37 echo " config: can be Debug or Release. Ignored if the action is 'clean'."
40 function checkparams {
41 if [ "$#" -ne "$(($1+1))" ]; then
42 echo "ERROR: Wrong number of parameters, expected $1 but got $(($#-1))"
49 CURRENT_DIR=$( dirname "$(readlink -f "$0")" )
50 echo "Current script: $CURRENT_DIR"
52 if [ "$#" -lt "1" ]; then
53 echo "ERROR: At least <action> must be specified!"
60 build $CURRENT_DIR $2 $3
64 rebuild $CURRENT_DIR $2 $3
72 echo "ERROR: Not implemented yet!"
75 echo "ERROR: Unknown action '$3'!"