Fix CMake to reference unit test in correct dir
[ric-app/mc.git] / sidecars / listener / 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 # this make file assuems that both NNG and RMR are installed and that the variables
21 # LD_LIBRARY_PATH, LIBRARY_PATH are set correctly.
22
23 # with the latest builder support for NNG was dropped, so we must build only SI95
24 # based applications; the _si suffix has been dropped
25 binaries = mc_listener
26 adjuncts = rdc_replay rdc_extract
27 testers = sender pipe_reader sender
28
29 test_progs = sender pipe_reader
30 lib_obj = mcl.o rdc.o
31 lib_h = mcl.h
32
33 coverage_opts = -ftest-coverage -fprofile-arcs
34
35 # make with no parms should build all production and adjunct/verification binaries
36 all: $(binaries) $(adjuncts) $(testers)
37
38 libmcl.a::      $(lib_obj) $(lib_h)
39         ar -v -r libmcl.a $(lib_obj)
40
41 mc_listener: mc_listener.c libmcl.a
42         gcc mc_listener.c -o mc_listener -L. -lmcl  -lrmr_si -lm -lpthread
43
44 # ---- adjunct tools -----------------------------------------------------------------
45 rdc_replay: rdc_replay.c libmcl.a
46         gcc rdc_replay.c -o rdc_replay -L. -lmcl -lrmr_si -lpthread -lm
47
48 rdc_extract: rdc_extract.c libmcl.a
49         gcc rdc_extract.c -o rdc_extract -L. -lmcl -lrmr_si -lpthread -lm
50
51 # ------- container verification programmes -------------------------------------------
52 sender : sender.c
53         gcc sender.c -o sender  -lrmr_si -lm -lpthread
54
55 pipe_reader : pipe_reader.c libmcl.a
56         gcc pipe_reader.c -o pipe_reader  -L. -lmcl -lrmr_si -lm -lpthread
57
58 # ---- housekeeping stuff -------------------------------------------------------------
59 # remove only intermediates
60 clean:
61         rm -f *.o *.gcda *.gcno *.gcov
62
63 # remove anything that can be rebuilt
64 nuke: clean
65         rm -f *mcl.a $(binaries) $(test_progs)
66