32d8af003acefa477fe568405d99cff4a61de83b
[o-du/phy.git] / fhi_lib / build.sh
1 #!/bin/bash
2 #/******************************************************************************
3 #*
4 #*   Copyright (c) 2019 Intel.
5 #*
6 #*   Licensed under the Apache License, Version 2.0 (the "License");
7 #*   you may not use this file except in compliance with the License.
8 #*   You may obtain a copy of the License at
9 #*
10 #*       http://www.apache.org/licenses/LICENSE-2.0
11 #*
12 #*   Unless required by applicable law or agreed to in writing, software
13 #*   distributed under the License is distributed on an "AS IS" BASIS,
14 #*   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 #*   See the License for the specific language governing permissions and
16 #*   limitations under the License.
17 #*
18 #*******************************************************************************/
19
20 XRAN_FH_LIB_DIR=$XRAN_DIR/lib
21 XRAN_FH_APP_DIR=$XRAN_DIR/app
22 XRAN_FH_TEST_DIR=$XRAN_DIR/test/test_xran
23 LIBXRANSO=0
24 MLOG=0
25 COMMAND_LINE=
26
27 echo Number of commandline arguments: $#
28 while [[ $# -ne 0 ]]
29 do
30 key="$1"
31
32 #echo Parsing: $key
33 case $key in
34     LIBXRANSO)
35     LIBXRANSO=1
36     ;;
37     MLOG)
38     MLOG=1
39     ;;
40     xclean)
41     COMMAND_LINE+=$key
42     COMMAND_LINE+=" "
43         ;;
44     *)
45     echo $key is unknown command        # unknown option
46     ;;
47 esac
48 shift # past argument or value
49 done
50
51 if [ -z "$MLOG_DIR" ]
52 then
53         echo 'MLOG folder is not set. Disable MLOG (MLOG_DIR='$MLOG_DIR')'
54         MLOG=0
55 else
56         echo 'MLOG folder is set. Enable MLOG (MLOG_DIR='$MLOG_DIR')'
57         MLOG=1
58 fi
59
60 echo 'Building xRAN Library'
61 echo "LIBXRANSO = ${LIBXRANSO}"
62 echo "MLOG      = ${MLOG}"
63
64 cd $XRAN_FH_LIB_DIR
65 make $COMMAND_LINE MLOG=${MLOG} LIBXRANSO=${LIBXRANSO} #DEBUG=1 VERBOSE=1
66
67 echo 'Building xRAN Test Application'
68 cd $XRAN_FH_APP_DIR
69 make $COMMAND_LINE MLOG=${MLOG} #DEBUG=1 VERBOSE=1
70
71 if [ -z ${GTEST_ROOT+x} ];
72 then
73     echo "GTEST_ROOT is not set. Unit tests are not compiled";
74 else
75         echo 'Building xRAN Test Application ('$GTEST_ROOT')'
76         cd $XRAN_FH_TEST_DIR
77         make clean;
78         make
79 fi
80