3 export BASE_DIR=$( cd "$(dirname "$0")" ; pwd )
6 SUBMODULE="edge-home-orchestration-go"
7 SUBMODULE_BUILD_CMD="build.sh object"
9 # Orchestration library for c-archive
10 HEADER_FILE="orchestration.h"
11 LIBRARY_FILE="liborchestration.a"
12 INTERFACE_OUT_DIR="$BASE_DIR/$SUBMODULE/src/interfaces/capi/output"
13 INTERFACE_OUT_INC_DIR="$INTERFACE_OUT_DIR/inc/linux_arm"
14 INTERFACE_OUT_LIB_DIR="$INTERFACE_OUT_DIR/lib/linux_arm"
17 CMAIN_DIR="$BASE_DIR/CMain"
18 CMAIN_INC_DIR="$CMAIN_DIR/inc"
19 CMAIN_LIB_DIR="$CMAIN_DIR/lib"
21 function build_init() {
23 echo "=================================================================="
24 echo " Initialize Submodule from \"$SUBMODULE\" repository"
25 echo "=================================================================="
30 function build_c_interface() {
32 echo "=================================================================="
33 echo " Build binary [c-archive] of c interface from Submodule locally"
34 echo "=================================================================="
39 function submodule_init() {
41 echo "----------------------------------------------------------"
42 echo " Submodule Init to \"$SUBMODULE\" directory"
43 echo "----------------------------------------------------------"
47 function submodule_sync() {
49 echo "---------------------------------------------"
50 echo " Submodule Sync to Init version"
51 echo "---------------------------------------------"
55 function submodule_update() {
57 echo "---------------------------------------------"
58 echo " Submodule update to Latest version"
59 echo "---------------------------------------------"
60 git submodule foreach git pull origin master
63 function submodule_build() {
65 echo "---------------------------------------------"
66 echo " Build binary [c-archive]"
67 echo "---------------------------------------------"
69 cd $SUBMODULE || exit 1
70 bash $SUBMODULE_BUILD_CMD || exit 1
74 function copy_library() {
76 echo "----------------------------------------------------------"
77 echo " Copy orchestration library [c-archive] to CMain folder"
78 echo "----------------------------------------------------------"
79 cp $INTERFACE_OUT_INC_DIR/$HEADER_FILE $CMAIN_INC_DIR
80 cp $INTERFACE_OUT_LIB_DIR/$LIBRARY_FILE $CMAIN_LIB_DIR
84 function build_clean() {
86 echo "-----------------------------------"
88 echo "-----------------------------------"
92 function build_test() {
94 echo "-----------------------------------"
96 echo "-----------------------------------"
100 function build_package() {
102 echo "------------------------------------------"
103 echo " Create Packages for Tizen from gbs build"
104 echo "------------------------------------------"
106 gbs -c ./.tizen.gbs.conf build -A armv7l --include-all
108 ### build through go toolchain
109 #gbs -c ./.tizen.gbs.conf build -A armv7l --include-all --define 'go_build ON'
140 echo "--------------------------------------------------------------"
141 echo " $0 : build C-Archive & RPM packages from Submodule"
142 echo " $0 init : build from latest Submodule"
143 echo " $0 local : build from local Submodule"
144 echo " $0 test : build test"
145 echo " $0 clean : build clean"
146 echo "--------------------------------------------------------------"