blob: f6c3946a3ca7dc3f82153e72c4c1b1737d73ac65 [file] [log] [blame]
himeshshuklaff201292021-05-11 13:40:12 +05301CXX:= g++ --std=c++14 -O2 -L/usr/local/lib
2CC:= gcc -O2 -L/usr/local/lib
3
4SRC:=./
5B_SRC:=./
6UTILSRC=./xapp-utils
7MSGSRC:=./xapp-mgmt
8
9ASNSRC:=../asn1c_defs
10E2APSRC:=./xapp-asn/e2ap
11E2SMSRC:=./xapp-asn/e2sm
12
13####### Logging library and flags
14CLOGFLAGS:= `pkg-config mdclog --cflags`
15LOG_LIBS:= `pkg-config mdclog --libs`
16CURL_LIBS:= `pkg-config libcurl --libs`
17RNIB_LIBS:= -pthread /usr/local/include/rnib/rnibreader.a
18######## Keep include dirs separate so we have transparency
19
20
21BASEFLAGS= -Wall -std=c++14 $(CLOGFLAGS)
22C_BASEFLAGS= -Wall $(CLOGFLAGS) -DASN_DISABLE_OER_SUPPORT
23
24XAPPFLAGS= -I./
25B_FLAGS= -I./
26UTILFLAGS= -I$(UTILSRC)
27MSGFLAGS= -I$(MSGSRC)
28
29ASNFLAGS=-I$(ASNSRC) -DASN_DISABLE_OER_SUPPORT
30E2APFLAGS = -I$(E2APSRC)
31E2SMFLAGS = -I$(E2SMSRC)
32
33########libs
34
sandeepindiaeb27c052022-05-04 18:42:29 +053035LIBS= -lsdl -lrmr_si -lpthread -lm -lboost_system -lcrypto -lssl -lcpprest $(LOG_LIBS) $(CURL_LIBS) $(RNIB_LIBS)
himeshshuklaff201292021-05-11 13:40:12 +053036COV_FLAGS= -fprofile-arcs -ftest-coverage
37
38#######
39B_XAPP_SRC= b_xapp_main.cc
40XAPP_SRC= xapp.cc
41UTIL_SRC= $(wildcard $(UTILSRC)/*.cc)
42MSG_SRC= $(wildcard $(MSGSRC)/*.cc)
43
44E2AP_SRC= $(wildcard $(E2APSRC)/*.cc)
45E2SM_SRC= $(wildcard $(E2SMSRC)/*.cc)
46ASN1C_SRC= $(wildcard $(ASNSRC)/*.c)
47
48##############Objects
49UTIL_OBJ=${UTIL_SRC:.cc=.o}
50XAPP_OBJ=${XAPP_SRC:.cc=.o}
51B_XAPP_OBJ= ${B_XAPP_SRC:.cc=.o}
52MSG_OBJ= ${MSG_SRC:.cc=.o}
53
54E2AP_OBJ = $(E2AP_SRC:.cc=.o)
55E2SM_OBJ = $(E2SM_SRC:.cc=.o)
56ASN1C_MODULES = $(ASN1C_SRC:.c=.o)
57
58$(ASN1C_MODULES): export CFLAGS = $(C_BASEFLAGS) $(ASNFLAGS)
59$(UTIL_OBJ):export CPPFLAGS=$(BASEFLAGS) $(UTILFLAGS) $(E2APFLAGS) $(E2SMFLAGS) $(ASNFLAGS) $(MSGFLAGS)
60
61$(MSG_OBJ):export CPPFLAGS=$(BASEFLAGS) $(MSGFLAGS) $(ASNFLAGS) $(E2APFLAGS) $(E2SMFLAGS)
62$(E2AP_OBJ): export CPPFLAGS = $(BASEFLAGS) $(ASNFLAGS) $(E2APFLAGS)
63$(E2SM_OBJ): export CPPFLAGS = $(BASEFLAGS) $(ASNFLAGS) $(E2SMFLAGS)
64$(XAPP_OBJ): export CPPFLAGS = $(BASEFLAGS) $(XAPPFLAGS) $(UTILFLAGS) $(MSGFLAGS) $(E2APFLAGS) $(E2SMFLAGS) $(ASNFLAGS)
65
66$(B_XAPP_OBJ):export CPPFLAGS=$(BASEFLAGS) $(B_FLAGS) $(XAPPFLAGS) $(UTILFLAGS) $(MSGFLAGS) $(E2APFLAGS) $(E2SMFLAGS) $(ASNFLAGS)
67
68OBJ= $(B_XAPP_OBJ) $(UTIL_OBJ) $(MSG_OBJ) $(ASN1C_MODULES) $(E2AP_OBJ) $(E2SM_OBJ) $(XAPP_OBJ)
69
70print-% : ; @echo $* = $($*)
71
72b_xapp_main: $(OBJ)
73 $(CXX) -o $@ $(OBJ) $(LIBS) $(RNIBFLAGS) $(CPPFLAGS) $(CLOGFLAGS)
74
75install: b_xapp_main
76 install -D b_xapp_main /usr/local/bin/b_xapp_main
77
78clean:
79 -rm *.o $(ASNSRC)/*.o $(E2APSRC)/*.o $(UTILSRC)/*.o $(E2SMSRC)/*.o $(MSGSRC)/*.o $(SRC)/*.o b_xapp_main