Add network emulation feature.
[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/blank.c"
37     "core/datastore/schema.c"
38     "core/datastore/generate.c"
39     "core/datastore/populate.c"
40     "core/faults/faults.c"
41     "core/faults/faults_counters.c"
42     "core/faults/faults_processing.c"
43     "core/faults/faults_logic.c"
44     "core/faults/faults_ves.c"
45     "utils/log_utils.c"
46     "utils/rand_utils.c"
47     "utils/type_utils.c"
48     "utils/sys_utils.c"
49     "utils/http_client.c"
50     "utils/nts_utils.c"
51     "utils/nc_client.c"
52     "utils/network_emulation.c"
53     "features/ves_pnf_registration/ves_pnf_registration.c"
54     "features/ves_heartbeat/ves_heartbeat.c"
55     "features/ves_file_ready/ves_file_ready.c"
56     "features/manual_notification/manual_notification.c"
57     "features/netconf_call_home/netconf_call_home.c"
58     "features/web_cut_through/web_cut_through.c"
59     "main.c"
60 )
61
62 libs=(
63     "argp"
64     "m"
65     "yang"
66     "sysrepo"
67     "netconf2"
68     "cjson"
69     "curl"
70     "pthread"
71 )
72
73 sources=""
74 for i in ${files[@]}
75 do
76     sources="$sources source/$i"
77 done
78
79 libraries=""
80 for i in ${libs[@]}
81 do
82     libraries="$libraries -l$i"
83 done
84
85 output="ntsim-ng"
86
87 build="gcc -Wall -pedantic -Isource $sources $libraries -o$output"
88 if [[ -n "${BUILD_WITH_DEBUG}" ]]; then
89     build="gcc -g -Wall -pedantic -Isource $sources $libraries -o$output"
90 fi
91
92 echo "Building with command: $build"
93 $build
94 if [ "$?" -ne "0" ]; then
95   echo "Build failed"
96   exit 1
97 fi