1 #==================================================================================
2 # Copyright (c) 2019 Nokia
3 # Copyright (c) 2018-2019 AT&T Intellectual Property.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #==================================================================================
19 # NOTE: this makefile assumes that RMr has been built using the directory .build
20 # at the top most repo directory (e.g. ../../.build). It can be changed
21 # if you need to by adding "build_path=<path>" to the make command line.
22 # To use this makefile to build on a system where RMr is already installed
23 # try: make build_path=/usr/local/lib
25 # By default we prefer the Korn shell (it's just better). If you really need
26 # to build with a dfferent shell add "SHELL=path" to the command line:
27 # make SHELL=/bin/bash
30 .EXPORT_ALL_VARIABLES:
32 #.SHELLFLAGS = -e # hosed on some flavours so keep it off
35 build_path ?= ../../.build
36 header_path := $(shell find $(build_path) -name 'rmr.h' |head -1 | sed 's!/rmr/.*!!' )
38 C_INCLUDE_PATH := $(header_path)
39 LD_LIBRARY_PATH=$(build_path):$(build_path)/lib
40 LIBRARY_PATH = $(LD_LIBRARY_PATH)
42 # These programmes are designed to test some basic application level functions
43 # from the perspective of two, or more, communicating processes.
47 all: sender receiver caller mt_receiver
49 receiver_nano: receiver.c
50 gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr -lnanomsg -lpthread -lm
53 gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr_nng -lnng -lpthread -lm
55 mt_receiver: receiver.c
56 gcc -I $${C_INCLUDE_PATH:-.} -DMTC $< -g -o $@ -lrmr_nng -lnng -lpthread -lm
58 lreceiver: lreceiver.c
59 gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr_nng -lnng -lpthread -lm
62 gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr -lnanomsg -lpthread -lm
65 gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr_nng -lnng -lpthread -lm
68 gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr_nng -lnng -lpthread -lm
71 gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr_nng -lnng -lpthread -lm
74 gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr_nng -lnng -lpthread -lm
77 # clean removes intermediates; nuke removes everything that can be built
83 rm -f sender sender_nano receiver receiver_nano caller mt_receiver