3 export BASE_DIR=$( cd "$(dirname "$0")" ; pwd )
6 SUBMODULE="edge-home-orchestration-go"
7 SUBMODULE_BUILD_CMD="build.sh object"
8 SUBMODULE_BUILD_CMD_WITH_TAGS="build.sh object secure"
10 # Orchestration library for c-archive
11 HEADER_FILE="orchestration.h"
12 LIBRARY_FILE="liborchestration.a"
13 INTERFACE_OUT_DIR="$BASE_DIR/$SUBMODULE/src/interfaces/capi/output"
14 INTERFACE_OUT_INC_DIR="$INTERFACE_OUT_DIR/inc/linux_arm"
15 INTERFACE_OUT_LIB_DIR="$INTERFACE_OUT_DIR/lib/linux_arm"
16 CERTKEY_FILE="edge-orchestration.key"
17 CERTKEY_PATH="$BASE_DIR/$SUBMODULE/doc/sampleTLSKey"
20 CMAIN_DIR="$BASE_DIR/CMain"
21 CMAIN_INC_DIR="$CMAIN_DIR/inc"
22 CMAIN_LIB_DIR="$CMAIN_DIR/lib"
24 function build_init() {
26 echo "=================================================================="
27 echo " Initialize Submodule from \"$SUBMODULE\" repository"
28 echo "=================================================================="
33 function build_c_interface() {
35 echo "=================================================================="
36 echo " Build binary [c-archive] of c interface from Submodule locally"
37 echo "=================================================================="
43 function submodule_init() {
45 echo "----------------------------------------------------------"
46 echo " Submodule Init to \"$SUBMODULE\" directory"
47 echo "----------------------------------------------------------"
51 function submodule_sync() {
53 echo "---------------------------------------------"
54 echo " Submodule Sync to Init version"
55 echo "---------------------------------------------"
59 function submodule_update() {
61 echo "---------------------------------------------"
62 echo " Submodule update to Latest version"
63 echo "---------------------------------------------"
64 git submodule foreach -q --recursive 'branch="$(git config -f $BASE_DIR/.gitmodules submodule.$name.branch)"; git checkout $branch'
67 function submodule_build() {
69 echo "---------------------------------------------"
70 echo " Build binary [c-archive]"
71 echo "---------------------------------------------"
73 cd $SUBMODULE || exit 1
74 if [ "$1" == "secure" ]; then
75 bash $SUBMODULE_BUILD_CMD_WITH_TAGS || exit 1
77 bash $SUBMODULE_BUILD_CMD || exit 1
82 function copy_library() {
84 echo "----------------------------------------------------------"
85 echo " Copy orchestration library [c-archive] to CMain folder"
86 echo "----------------------------------------------------------"
87 cp $INTERFACE_OUT_INC_DIR/$HEADER_FILE $CMAIN_INC_DIR
88 cp $INTERFACE_OUT_LIB_DIR/$LIBRARY_FILE $CMAIN_LIB_DIR
92 function copy_certKey() {
94 echo "----------------------------------------------------------"
95 echo " Copy orchestration Certification Key to CMain folder"
96 echo "----------------------------------------------------------"
97 cp $CERTKEY_PATH/$CERTKEY_FILE $CMAIN_DIR
100 function build_clean() {
102 echo "-----------------------------------"
104 echo "-----------------------------------"
108 function build_test() {
110 echo "-----------------------------------"
112 echo "-----------------------------------"
116 function build_package() {
118 echo "------------------------------------------"
119 echo " Create Packages for Tizen from gbs build"
120 echo "------------------------------------------"
122 gbs -c ./.tizen.gbs.conf build -A armv7l --include-all
124 ### build through go toolchain
125 #gbs -c ./.tizen.gbs.conf build -A armv7l --include-all --define 'go_build ON'
162 echo "---------------------------------------------------------------------------------------"
163 echo " $0 : build C-Archive & RPM packages from Submodule"
164 echo " $0 secure : build C-Archive & RPM packages from Submodule with secure option"
165 echo " $0 init : build from latest Submodule"
166 echo " $0 init secure : build from latest Submodule with secure option"
167 echo " $0 local : build from local Submodule"
168 echo " $0 local secure : build from local Submodule with secure option"
169 echo " $0 test : build test"
170 echo " $0 clean : build clean"
171 echo "---------------------------------------------------------------------------------------"