summaryrefslogtreecommitdiff
path: root/src/poi-service/script/build.sh
blob: f73fc42f4652f39b6d51250de8b38fac2cc66132 (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
59
60
61
62
63
64
65
66
67
68
#!/bin/bash

###########################################################################
# @licence app begin@
# SPDX-License-Identifier: MPL-2.0
#
# Component Name: poi-server
# Author: Philippe Colliot <philippe.colliot@mpsa.com>
#
# Copyright (C) 2013-2014, PCA Peugeot Citroen
# 
# License:
# This Source Code Form is subject to the terms of the
# Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
# this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# @licence end@
###########################################################################
POI_SERVER_SRC_DIR=$PWD/../poi-server
POI_SERVER_BIN_DIR=$PWD/../bin
POSITIONING_SRC_DIR=$PWD/../positioning

usage() {
    echo "Usage: ./build.sh Build poi-server"
    echo "   or: ./build.sh [command]"
    echo
    echo "command:"
    echo "  make            Build"
    echo "  clean           Clean"
    echo "  src-clean       Clean the cloned sources of positioning"
    echo "  help            Print Help"
    echo
    echo
}

build() {
    echo ''
    echo 'Building poi-server ->' $POI_SERVER_SRC_DIR
    mkdir -p $POI_SERVER_BIN_DIR
    cd $POI_SERVER_BIN_DIR 
    cmake $POI_SERVER_SRC_DIR && make
}

clean() {
    rm -rf $POI_SERVER_BIN_DIR
}

src-clean() {
    rm -rf $POSITIONING_SRC_DIR
}

if [ $# -ge 1 ]; then
    if [ $1 = help ]; then
        usage
    elif [ $1 = make ]; then
        build
    elif [ $1 = clean ]; then
        clean
    elif [ $1 = src-clean ]; then
        src-clean
    else
        usage
    fi
elif [ $# -eq 0 ]; then
    build
else
    usage
fi