X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=build.sh;h=393677aec19686190017d49f98e60437410d68cf;hb=ad1a743a6eba4fcc94ac5fee591c46b92ce1b0ac;hp=9496f0095a6b35218e63677c7b08da4ca9987872;hpb=a58d40b5ae336a54408201963b065ee049b43acd;p=apps%2Fagl-service-can-low-level.git diff --git a/build.sh b/build.sh index 9496f009..393677ae 100755 --- a/build.sh +++ b/build.sh @@ -1,82 +1,4 @@ #!/bin/bash -function build { - echo "ACTION: build" - source ~/agl/sdk/porter/environment* - if [ ! -d "$1/$2" ]; then - echo "INFO: build dir ($1/$2) doesn't exist, created it!" - mkdir -p "$1/$2" - fi - pushd "$1/$2" - #cd "$1/$2" - cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=$3 $1 - make - popd -} - -function clean { - echo "ACTION: clean" - if [ -d "$1/$2" ]; then - rm -vrf "$1/$2" - fi -} - -function rebuild { - clean $1 $2 - build $1 $2 $3 -} - -function printhelp { - echo "Usage: build.sh [config]" - echo " action: can be one of the following" - echo " build: build this project." - echo " rebuild: rebuild this project." - echo " clean: clean the previous build." - echo " install: install the build result." - echo " subdir: the subdir into which the build is done." - echo " config: can be Debug or Release. Ignored if the action is 'clean'." -} - -function checkparams { - if [ "$#" -ne "$(($1+1))" ]; then - echo "ERROR: Wrong number of parameters, expected $1 but got $(($#-1))" - printhelp - exit 1 - fi -} - -function main { - CURRENT_DIR=$( dirname "$(readlink -f "$0")" ) - echo "Current script: $CURRENT_DIR" - - if [ "$#" -lt "1" ]; then - echo "ERROR: At least must be specified!" - exit 1 - fi - - case "$1" in - "build") - checkparams 3 $* - build $CURRENT_DIR $2 $3 - ;; - "rebuild") - checkparams 3 $* - rebuild $CURRENT_DIR $2 $3 - ;; - "clean") - checkparams 2 $* - clean $CURRENT_DIR $2 - ;; - "install") - checkparams 3 $* - echo "ERROR: Not implemented yet!" - ;; - *) - echo "ERROR: Unknown action '$3'!" - exit 1 - ;; - esac -} - -main $* - +cd CAN-config-generator && make build && cd - +cd CAN-binder && ./build.mk mrproper && ./build.mk build && cd -