E. Scott Daniels | e8a5b2c | 2019-04-22 17:04:10 +0000 | [diff] [blame^] | 1 | #================================================================================== |
| 2 | # Copyright (c) 2019 Nokia |
| 3 | # Copyright (c) 2018-2019 AT&T Intellectual Property. |
| 4 | # |
| 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 |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 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 | #================================================================================== |
| 17 | # |
| 18 | |
| 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 | |
| 23 | .EXPORT_ALL_VARIABLES: |
| 24 | .ONESHELL: |
| 25 | .SHELLFLAGS = -e |
| 26 | SHELL = /bin/ksh |
| 27 | |
| 28 | build_path ?= ../../.build |
| 29 | header_path := $(shell find ../../.build -name 'rmr.h' |head -1 | sed 's!/rmr/.*!!' ) |
| 30 | |
| 31 | C_INCLUDE_PATH := $(header_path) |
| 32 | LD_LIBRARY_PATH=$(build_path):$(build_path)/lib |
| 33 | LIBRARY_PATH = $(LD_LIBRARY_PATH) |
| 34 | |
| 35 | # These programmes are designed to test some basic application level functions |
| 36 | # from the perspective of two communicating processes. |
| 37 | |
| 38 | |
| 39 | .PHONY: all |
| 40 | all: sender receiver sender_nano receiver_nano |
| 41 | |
| 42 | receiver_nano: receiver.c |
| 43 | gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr -lnanomsg -lpthread -lm |
| 44 | |
| 45 | receiver: receiver.c |
| 46 | gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr_nng -lnng -lpthread -lm |
| 47 | |
| 48 | sender_nano: sender.c |
| 49 | gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr -lnanomsg -lpthread -lm |
| 50 | |
| 51 | sender: sender.c |
| 52 | gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr_nng -lnng -lpthread -lm |
| 53 | |
| 54 | |
| 55 | .PHONY: clean |
| 56 | clean: |
| 57 | rm -f sender sender_nano receiver receiver_nano *.o |