1b2fc2aca81278d7cf4515eaad67fc29ffba1cd3
[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 binaries = mc_listener
24 test_progs = sender unit_test pipe_reader
25 lib_obj = mcl.o rdc.o
26 lib_h = mcl.h
27
28 coverage_opts = -ftest-coverage -fprofile-arcs
29
30 # make with no parms should just build 'production' binaries
31 all: $(binaries) mc_listener
32
33 libmcl.a::      $(lib_obj) $(lib_h)
34         ar -v -r libmcl.a $(lib_obj)
35
36 mc_listener: mc_listener.c libmcl.a
37         gcc mc_listener.c -o mc_listener -L. -lmcl  -lrmr_nng -lnng -lm -lpthread
38
39
40 # ---- testing stuff -----------------------------------------------------------------
41 tests: $(test_progs)
42
43 sender : sender.c
44         gcc sender.c -o sender  -lrmr_nng -lnng -lm -lpthread
45
46 pipe_reader : pipe_reader.c libmcl.a
47         gcc pipe_reader.c -o pipe_reader  -L. -lmcl -lrmr_nng -lnng -lm -lpthread
48
49 unit_test: unit_test.c mcl.c
50         gcc $(coverage_opts) unit_test.c -o unit_test -lrmr_nng -lnng -lm -lpthread
51
52
53 # ---- housekeeping stuff -------------------------------------------------------------
54 # remove only intermediates
55 clean:
56         rm -f *.o *.gcda *.gcno *.gcov
57
58 # remove anything that can be rebuilt
59 nuke: clean
60         rm -f *mcl.a $(binaries) $(test_progs)