aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/compile_dmm.sh
blob: c378bae81eb55be43262726384a8aa83c87bc0ba (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
#!/bin/bash -x

set -x

BUILD_DIR=`dirname $(readlink -f $0)`/../build

OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')

echo "DMM build started....."

cd $BUILD_DIR
rm -rf *
cmake ..
make -j 8

if [ $? -eq 0 ]; then
    echo "DMM build is SUCCESS"
else
    echo "DMM build has FAILED"
    exit 1
fi

if [ "$OS_ID" == "centos" ]; then
    make pkg-rpm
    if [ $? -eq 0 ]; then
        echo "DMM rpm build is SUCCESS"
    else
        echo "DMM rpm build has FAILED"
        exit 1
    fi
elif [ "$OS_ID" == "ubuntu" ]; then
    make pkg-deb
    if [ $? -eq 0 ]; then
        echo "DMM deb build is SUCCESS"
    else
        echo "DMM deb build has FAILED"
        exit 1
    fi
fi

echo "DMM build has FINISHED"