Address sonar complaints about the listener
[ric-app/mc.git] / sidecars / listener / src / Makefile
1 # vim: ts=4 sw=4 noet:
2 #----------------------------------------------------------------------------------
3 #
4 #       Copyright (c) 2018-2019 AT&T Intellectual Property.
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 # CAUTION:  We expect that the unit test script(s) might build the various tools
21 #       with the environment variable "TEST_COV_OPTS" set. This variable should NOT
22 #       be set for the normal build.
23
24
25 # this make file assuems that both NNG and RMR are installed and that the variables
26 # LD_LIBRARY_PATH, LIBRARY_PATH are set correctly.
27
28 # with the latest builder support for NNG was dropped, so we must build only SI95
29 # based applications; the _si suffix has been dropped
30 binaries = mc_listener
31 adjuncts = rdc_replay rdc_extract
32 testers = sender pipe_reader sender
33
34 test_progs = sender pipe_reader
35 lib_obj = mcl.o rdc.o
36 lib_h = mcl.h
37
38 coverage_opts = -ftest-coverage -fprofile-arcs
39
40 # make with no parms should build all production and adjunct/verification binaries
41 all: $(binaries) $(adjuncts) $(testers)
42
43 libmcl.a::      $(lib_obj) $(lib_h)
44         ar -v -r libmcl.a $(lib_obj)
45
46 mc_listener: mc_listener.c libmcl.a
47         gcc mc_listener.c $$TEST_COV_OPTS -o mc_listener -L. -lmcl  -lrmr_si -lm -lpthread
48
49 # ---- adjunct tools -----------------------------------------------------------------
50 rdc_replay: rdc_replay.c libmcl.a
51         gcc rdc_replay.c $$TEST_COV_OPTS -o rdc_replay -L. -lmcl -lrmr_si -lpthread -lm
52
53 rdc_extract: rdc_extract.c libmcl.a
54         gcc rdc_extract.c $$TEST_COV_OPTS -o rdc_extract -L. -lmcl -lrmr_si -lpthread -lm
55
56 # ------- container verification programmes -------------------------------------------
57 sender : sender.c
58         gcc sender.c $$TEST_COV_OPTS -o sender  -lrmr_si -lm -lpthread
59
60 pipe_reader : pipe_reader.c libmcl.a
61         gcc pipe_reader.c $$TEST_COV_OPTS -o pipe_reader  -L. -lmcl -lrmr_si -lm -lpthread
62
63 # ---- housekeeping stuff -------------------------------------------------------------
64 # remove only intermediates
65 clean:
66         rm -f *.o *.gcda *.gcno *.gcov
67
68 # remove anything that can be rebuilt
69 nuke: clean
70         rm -f *mcl.a $(binaries) $(test_progs)