Add better support for manual app testing
[ric-plt/lib/rmr.git] / test / app_test / Makefile
1 #
2 #=================================================================================
3 #    Copyright (c) 2019-2021 Nokia
4 #    Copyright (c) 2018-2021 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 # NOTE:  this makefile assumes that RMR has been built using the directory .build
21 #               at the top most repo directory (e.g. ../../.build). It can be changed 
22 #               if you need to by adding "build_path=<path>" to the make command line.
23 #               To use this makefile to build on a system where RMR is already installed
24 #               try:    make build_path=/usr/local/lib
25 #
26 #               By default we prefer the Korn shell (it's just better). If you really need
27 #               to build with a dfferent shell add "SHELL=path" to the command line:
28 #                               make SHELL=/bin/bash
29 #
30
31 .EXPORT_ALL_VARIABLES:
32 .ONESHELL:
33 #.SHELLFLAGS = -e       # hosed on some flavours so keep it off
34 SHELL ?= /bin/ksh
35
36 ex_cflags = $(shell echo $$EX_CFLAGS )
37
38 build_path ?= ../../.build
39 header_path := $(shell find $(build_path) -name 'rmr.h' 2>/dev/null |head -1 | sed 's!/rmr/.*!!' )
40
41 # use from environment if there so as to allow build to reference installed base
42 C_INCLUDE_PATH ?= $(header_path)
43 LD_LIBRARY_PATH ?= $(build_path):$(build_path)/lib
44 LIBRARY_PATH = $(LD_LIBRARY_PATH)
45
46 # These programmes are designed to test some basic application level functions
47 # from the perspective of two, or more, communicating processes. 
48
49
50 .PHONY: all all_si
51 all: sender receiver caller mt_receiver v_sender ex_rts_receiver 
52
53 all_si: sender_si receiver_si
54
55
56 # ------ all builds are si95 now ---------------------------------------------------
57
58 %:%.c
59         gcc -I $${C_INCLUDE_PATH:-.} $< -g -o $@ -lrmr_si -lpthread -lm
60
61 # special build rule as it reuses an existing source module with a sepcial define
62 mt_receiver: receiver.c
63         gcc -I $${C_INCLUDE_PATH:-.} -DMTC $< -g -o $@ -lrmr_si -lpthread -lm
64
65
66 # --------- housekeeping -----------------------------------------------------------
67
68 # clean removes intermediates; nuke removes everything that can be built
69 .PHONY: clean nuke
70 clean:
71         rm -f *.o
72
73 nuke: clean
74         rm -f sender receiver caller mt_receiver