2 #----------------------------------------------------------------------------------
4 # Copyright (c) 2018-2019 AT&T Intellectual Property.
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
10 # http://www.apache.org/licenses/LICENSE-2.0
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.
18 #---------------------------------------------------------------------------------
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.
23 binaries = mc_listener mc_listener_si
24 adjuncts = rdc_replay rdc_extract
25 testers = sender pipe_reader sender_si
27 test_progs = sender unit_test pipe_reader
31 coverage_opts = -ftest-coverage -fprofile-arcs
33 # make with no parms should build all production and adjunct/verification binaries
34 all: $(binaries) $(adjuncts) $(testers)
36 libmcl.a:: $(lib_obj) $(lib_h)
37 ar -v -r libmcl.a $(lib_obj)
39 mc_listener: mc_listener.c libmcl.a
40 gcc mc_listener.c -o mc_listener -L. -lmcl -lrmr_nng -lnng -lm -lpthread
42 mc_listener_si: mc_listener.c libmcl.a
43 gcc mc_listener.c -o mc_listener_si -L. -lmcl -lrmr_si -lm -lpthread
46 # ---- testing stuff -----------------------------------------------------------------
50 gcc sender.c -o sender -lrmr_nng -lnng -lm -lpthread
53 gcc sender.c -o sender_si -lrmr_si -lm -lpthread
55 pipe_reader : pipe_reader.c libmcl.a
56 gcc pipe_reader.c -o pipe_reader -L. -lmcl -lrmr_nng -lnng -lm -lpthread
58 unit_test: unit_test.c mcl.c
59 gcc -g $(coverage_opts) unit_test.c -o unit_test -lrmr_nng -lnng -lm -lpthread
61 # ---- adjunct tools -----------------------------------------------------------------
62 rdc_replay: rdc_replay.c libmcl.a
63 gcc rdc_replay.c -o rdc_replay -L. -lmcl -lrmr_nng -lnng -lpthread -lm
65 rdc_extract: rdc_extract.c libmcl.a
66 gcc rdc_extract.c -o rdc_extract -L. -lmcl -lrmr_nng -lnng -lpthread -lm
68 # ---- housekeeping stuff -------------------------------------------------------------
69 # remove only intermediates
71 rm -f *.o *.gcda *.gcno *.gcov
73 # remove anything that can be rebuilt
75 rm -f *mcl.a $(binaries) $(test_progs)