blob: c8a0b6d0efba72449739b1d4ef84cbda4b2b50a5 [file] [log] [blame]
sjanab85024c2020-03-24 13:57:25 -04001CXX:= g++ --std=c++14 -O2 -L/usr/local/lib
2CC:= gcc -O2 -L/usr/local/lib
sjana6df19a42020-03-19 12:06:12 -04003
4SRC:=./
5HWSRC:=./
6UTILSRC=./xapp-utils
7MSGSRC:=./xapp-mgmt
8
9ASNSRC:=../asn1c_defs
sjana0f5c2342020-05-07 18:02:09 -040010E2APSRC:=./xapp-asn/e2ap
11E2SMSRC:=./xapp-asn/e2sm
sjana6df19a42020-03-19 12:06:12 -040012
13####### Logging library and flags
14CLOGFLAGS:= `pkg-config mdclog --cflags`
15LOG_LIBS:= `pkg-config mdclog --libs`
16CURL_LIBS:= `pkg-config libcurl --libs`
sjana0f5c2342020-05-07 18:02:09 -040017RNIB_LIBS:= -pthread /usr/local/include/rnib/rnibreader.a
sjana6df19a42020-03-19 12:06:12 -040018######## Keep include dirs separate so we have transparency
sjanab85024c2020-03-24 13:57:25 -040019
20
21BASEFLAGS= -Wall -std=c++14 $(CLOGFLAGS)
sjana6df19a42020-03-19 12:06:12 -040022C_BASEFLAGS= -Wall $(CLOGFLAGS) -DASN_DISABLE_OER_SUPPORT
23
24XAPPFLAGS= -I./
25HWFLAGS= -I./
26UTILFLAGS= -I$(UTILSRC)
27MSGFLAGS= -I$(MSGSRC)
28
29ASNFLAGS=-I$(ASNSRC) -DASN_DISABLE_OER_SUPPORT
30E2APFLAGS = -I$(E2APSRC)
31E2SMFLAGS = -I$(E2SMSRC)
32
33########libs
sjanab85024c2020-03-24 13:57:25 -040034
sjana60af3c92020-04-13 10:53:34 -040035LIBS= -lsdl -lrmr_si -lpthread -lm $(LOG_LIBS) $(CURL_LIBS) $(RNIB_LIBS)
sjana6df19a42020-03-19 12:06:12 -040036COV_FLAGS= -fprofile-arcs -ftest-coverage
37
38#######
39HWXAPP_SRC= hw_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}
51HWXAPP_OBJ= ${HWXAPP_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$(HWXAPP_OBJ):export CPPFLAGS=$(BASEFLAGS) $(HWFLAGS) $(XAPPFLAGS) $(UTILFLAGS) $(MSGFLAGS) $(E2APFLAGS) $(E2SMFLAGS) $(ASNFLAGS)
67
68OBJ= $(HWXAPP_OBJ) $(UTIL_OBJ) $(MSG_OBJ) $(ASN1C_MODULES) $(E2AP_OBJ) $(E2SM_OBJ) $(XAPP_OBJ)
69
70print-% : ; @echo $* = $($*)
71
72hw_xapp_main: $(OBJ)
sjanab85024c2020-03-24 13:57:25 -040073 $(CXX) -o $@ $(OBJ) $(LIBS) $(RNIBFLAGS) $(CPPFLAGS) $(CLOGFLAGS)
sjana6df19a42020-03-19 12:06:12 -040074
75install: hw_xapp_main
76 install -D hw_xapp_main /usr/local/bin/hw_xapp_main
77
78clean:
sjana91d30a62020-03-31 12:14:06 -040079 -rm *.o $(ASNSRC)/*.o $(E2APSRC)/*.o $(UTILSRC)/*.o $(E2SMSRC)/*.o $(MSGSRC)/*.o $(SRC)/*.o hw_xapp_main