X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fapp_test%2FMakefile;h=8fd68f0b529e0f1574edea4f23dcedf351a39e07;hb=refs%2Ftags%2F3.3.0;hp=f05f49e5f932932ca949c7fdba6691bad442fb44;hpb=4c42c80d426a3499ca47ce1849032cda1bd5ff8f;p=ric-plt%2Flib%2Frmr.git diff --git a/test/app_test/Makefile b/test/app_test/Makefile index f05f49e..8fd68f0 100644 --- a/test/app_test/Makefile +++ b/test/app_test/Makefile @@ -1,6 +1,7 @@ -#================================================================================== -# Copyright (c) 2019 Nokia -# Copyright (c) 2018-2019 AT&T Intellectual Property. +# +#================================================================================= +# Copyright (c) 2019-2020 Nokia +# Copyright (c) 2018-2020 AT&T Intellectual Property. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,42 +17,68 @@ #================================================================================== # -# NOTE: this makefile assumes that RMr has been built using the directory .build +# NOTE: this makefile assumes that RMR has been built using the directory .build # at the top most repo directory (e.g. ../../.build). It can be changed # if you need to by adding "build_path=" to the make command line. +# To use this makefile to build on a system where RMR is already installed +# try: make build_path=/usr/local/lib +# +# By default we prefer the Korn shell (it's just better). If you really need +# to build with a dfferent shell add "SHELL=path" to the command line: +# make SHELL=/bin/bash +# .EXPORT_ALL_VARIABLES: .ONESHELL: #.SHELLFLAGS = -e # hosed on some flavours so keep it off -SHELL = /bin/ksh +SHELL ?= /bin/ksh + +ex_cflags = $(shell echo $$EX_CFLAGS ) build_path ?= ../../.build -header_path := $(shell find ../../.build -name 'rmr.h' |head -1 | sed 's!/rmr/.*!!' ) +header_path := $(shell find $(build_path) -name 'rmr.h' |head -1 | sed 's!/rmr/.*!!' ) -C_INCLUDE_PATH := $(header_path) -LD_LIBRARY_PATH=$(build_path):$(build_path)/lib +# use from environment if there so as to allow build to reference installed base +C_INCLUDE_PATH ?= $(header_path) +LD_LIBRARY_PATH ?= $(build_path):$(build_path)/lib LIBRARY_PATH = $(LD_LIBRARY_PATH) # These programmes are designed to test some basic application level functions -# from the perspective of two communicating processes. +# from the perspective of two, or more, communicating processes. -.PHONY: all -all: sender receiver sender_nano receiver_nano +.PHONY: all all_si +all: sender receiver caller mt_receiver v_sender ex_rts_receiver sender_si receiver_si -receiver_nano: receiver.c - gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr -lnanomsg -lpthread -lm +all_si: sender_si receiver_si -receiver: receiver.c - gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr_nng -lnng -lpthread -lm -sender_nano: sender.c - gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr -lnanomsg -lpthread -lm +# ------ nng based builds ------------------------------------------------------------ -sender: sender.c +%:%.c gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr_nng -lnng -lpthread -lm +# special build as it reuses an existing source module +mt_receiver: receiver.c + gcc -I $${C_INCLUDE_PATH:-.} -DMTC $< -g -o $@ -lrmr_nng -lnng -lpthread -lm + -.PHONY: clean +# ----- si test builds ------------------------------------------------------------- + +%_si : %.c + gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr_si -lpthread -lm + +# explicit rule because there is no mt_recever.c +mt_receiver_si: receiver.c + gcc -I $${C_INCLUDE_PATH:-.} -DMTC $< -g -o $@ -lrmr_si -lpthread -lm + + +# --------- housekeeping ----------------------------------------------------------- + +# clean removes intermediates; nuke removes everything that can be built +.PHONY: clean nuke clean: - rm -f sender sender_nano receiver receiver_nano *.o + rm -f *.o + +nuke: clean + rm -f sender receiver caller mt_receiver