CI: Update RTD configuration file
[sim/o1-interface.git] / ntsimulator / deploy / base / build_ntsim-ng.sh
1 #!/bin/bash
2
3 # /*************************************************************************
4 # *
5 # * Copyright 2020 highstreet technologies GmbH and others
6 # *
7 # * Licensed under the Apache License, Version 2.0 (the "License");
8 # * you may not use this file except in compliance with the License.
9 # * You may obtain a copy of the License at
10 # *
11 # *     http://www.apache.org/licenses/LICENSE-2.0
12 # *
13 # * Unless required by applicable law or agreed to in writing, software
14 # * distributed under the License is distributed on an "AS IS" BASIS,
15 # * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # * See the License for the specific language governing permissions and
17 # * limitations under the License.
18 # ***************************************************************************/
19
20 files=(
21     "core/container.c"
22     "core/context.c"
23     "core/docker.c"
24     "core/framework.c"
25     "core/test.c"
26     "core/session.c"
27     "core/nc_config.c"
28     "core/app/supervisor.c"
29     "core/app/app_common.c"
30     "core/app/manager.c"
31     "core/app/manager_context.c"
32     "core/app/manager_operations.c"
33     "core/app/manager_actions.c"
34     "core/app/manager_sysrepo.c"
35     "core/app/network_function.c"
36     "core/app/nf_oran_du.c"
37     "core/app/nf_oran_ru_supervision.c"
38     "core/app/blank.c"
39     "core/datastore/schema.c"
40     "core/datastore/operations.c"
41     "core/datastore/populate.c"
42     "core/datastore/populate_aux.c"
43     "core/datastore/populate_late_resolve.c"
44     "core/datastore/populate_recursive.c"
45     "core/datastore/populate_validation.c"
46     "core/faults/faults.c"
47     "core/faults/faults_counters.c"
48     "core/faults/faults_processing.c"
49     "core/faults/faults_logic.c"
50     "core/faults/faults_ves.c"
51     "utils/debug_utils.c"
52     "utils/log_utils.c"
53     "utils/rand_utils.c"
54     "utils/type_utils.c"
55     "utils/sys_utils.c"
56     "utils/http_client.c"
57     "utils/nts_utils.c"
58     "utils/nc_client.c"
59     "utils/network_emulation.c"
60     "features/ves_pnf_registration/ves_pnf_registration.c"
61     "features/ves_heartbeat/ves_heartbeat.c"
62     "features/ves_file_ready/ves_file_ready.c"
63     "features/manual_notification/manual_notification.c"
64     "features/netconf_call_home/netconf_call_home.c"
65     "features/web_cut_through/web_cut_through.c"
66     "features/ves_o1_pnf_registration/ves_o1_pnf_registration.c"
67     "main.c"
68 )
69
70 libs=(
71     "argp"
72     "m"
73     "yang"
74     "sysrepo"
75     "netconf2"
76     "cjson"
77     "curl"
78     "pthread"
79 )
80
81 sources=""
82 for i in ${files[@]}
83 do
84     sources="$sources source/$i"
85 done
86
87 libraries=""
88 for i in ${libs[@]}
89 do
90     libraries="$libraries -l$i"
91 done
92
93 output="ntsim-ng"
94
95 build="gcc -Wall -pedantic -Isource $sources $libraries -o$output"
96 if [[ -n "${BUILD_WITH_DEBUG}" ]]; then
97     build="gcc -g -Wall -pedantic -Isource $sources $libraries -o$output"
98 fi
99
100 echo "Building with command: $build"
101 $build
102 if [ "$?" -ne "0" ]; then
103   echo "Build failed"
104   exit 1
105 fi