blob: e1fa85002def60af1f2bb5417d1163cab3bd7dbe [file] [log] [blame]
Rajeswara Raof6b4e6c2017-08-31 17:26:27 +05301bin_PROGRAMS = voltha_bal_driver
suhasgrao76e8f8c2017-07-12 16:24:33 +05302
Rajeswara Raof6b4e6c2017-08-31 17:26:27 +05303.PHONY = brcm_lib
suhasgrao76e8f8c2017-07-12 16:24:33 +05304
5HOSTPROG=yes
6
Rajeswara Raof6b4e6c2017-08-31 17:26:27 +05307DEFS += -UBAL_STUB
suhasgrao76e8f8c2017-07-12 16:24:33 +05308
Rajeswara Raof6b4e6c2017-08-31 17:26:27 +05309voltha_bal_driver_SOURCES = \
10 voltha_bal_driver.c \
suhasgrao76e8f8c2017-07-12 16:24:33 +053011 bal_stub.c \
12 grpc-c.h \
13 bal_errno.grpc-c.h bal_indications.grpc-c.h bal_model_types.grpc-c.h \
14 bal_obj.grpc-c.h bal.grpc-c.h bal_model_ids.grpc-c.h \
15 bal_msg_type.grpc-c.h bal_osmsg.grpc-c.h asfvolt16_driver.h \
16 bal.grpc-c.service.c \
17 bal_errno.grpc-c.c bal_indications.grpc-c.c \
18 bal_model_types.grpc-c.c bal_obj.grpc-c.c \
19 bal_errno.grpc-c.service.c bal_indications.grpc-c.service.c \
20 bal_model_types.grpc-c.service.c bal_obj.grpc-c.service.c \
21 bal.grpc-c.c bal_model_ids.grpc-c.c \
22 bal_msg_type.grpc-c.c bal_osmsg.grpc-c.c \
23 bal_model_ids.grpc-c.service.c \
24 bal_msg_type.grpc-c.service.c bal_osmsg.grpc-c.service.c
25
26replace:
27$(shell find . -type f \( -name '*.h' -o -name '*.c' \) -a -exec sed -i -e 's/bal_obj.proto.h/bal_obj.grpc-c.h/g' {} + )
28$(shell find . -type f \( -name '*.h' -o -name '*.c' \) -a -exec sed -i -e 's/bal_model_types.proto.h/bal_model_types.grpc-c.h/g' {} + )
29$(shell find . -type f \( -name '*.h' -o -name '*.c' \) -a -exec sed -i -e 's/bal_errno.proto.h/bal_errno.grpc-c.h/g' {} + )
30$(shell find . -type f \( -name '*.h' -o -name '*.c' \) -a -exec sed -i -e 's/bal_msg_type.proto.h/bal_msg_type.grpc-c.h/g' {} + )
31$(shell find . -type f \( -name '*.h' -o -name '*.c' \) -a -exec sed -i -e 's/bal_osmsg.proto.h/bal_osmsg.grpc-c.h/g' {} + )
32$(shell find . -type f \( -name '*.h' -o -name '*.c' \) -a -exec sed -i -e 's/bal_model_ids.proto.h/bal_model_ids.grpc-c.h/g' {} + )
33$(shell find . -type f \( -name '*.h' -o -name '*.c' \) -a -exec sed -i -e 's/bal.proto.h/bal.grpc-c.h/g' {} + )
suhasgrao65941192017-07-31 00:00:47 +053034$(shell find . -type f \( -name '*.h' -o -name '*.c' \) -a -exec sed -i -e 's/bal_indications.proto.h/bal_indications.grpc-c.h/g' {} + )
35
36autogen:
suhasgrao76e8f8c2017-07-12 16:24:33 +053037 protoc -I ${srcdir} --grpc-c_out=. --plugin=protoc-gen-grpc-c=../compiler/protoc-gen-grpc-c ${srcdir}/bal_errno.proto ${srcdir}/bal_model_ids.proto ${srcdir}/bal_msg_type.proto ${srcdir}/bal_osmsg.proto ${srcdir}/bal_indications.proto ${srcdir}/bal_model_types.proto ${srcdir}/bal_obj.proto ${srcdir}/bal.proto $(replace)
38
39LDADD = \
40 ../lib/libgrpc-c.la \
41 /usr/local/lib/libgrpc.a \
42 /usr/local/lib/libgpr.a \
43 /usr/local/lib/libprotobuf-c.a \
44 -lssl \
45 -lcrypto \
46 -lz \
47 -lpthread
48
Rajeswara Raof6b4e6c2017-08-31 17:26:27 +053049EXTRA_voltha_bal_driver_DEPENDENCIES=$(EDGECORE_DRIV_LIB) $(BRCM_BAL_LIB)
suhasgrao76e8f8c2017-07-12 16:24:33 +053050
Rajeswara Raof6b4e6c2017-08-31 17:26:27 +053051EDGECORE = /home/asfvolt/shared/OpenNetworkLinux/EdgeCore/driver-app
52BRCM_PATH = /home/asfvolt/shared/OpenNetworkLinux/bal_src_release_2.4.3.6/bal_release
53EDGECORE_DRIV_LIB=./libEdgecoreDriver.a
54BRCM_BAL_LIB=./libbal_api_dist.so
55
56LIBS = $(EDGECORE_DRIV_LIB) $(BRCM_BAL_LIB) -lrt -lm
suhasgrao76e8f8c2017-07-12 16:24:33 +053057
58AM_CFLAGS = \
59 -I. \
60 -I${srcdir}/../lib/h/ \
61 -I${srcdir}/../third_party/protobuf-c \
Rajeswara Raof6b4e6c2017-08-31 17:26:27 +053062 -I${srcdir}/../third_party/grpc/include \
63 -I${EDGECORE}/.
suhasgrao76e8f8c2017-07-12 16:24:33 +053064
Rajeswara Raof6b4e6c2017-08-31 17:26:27 +053065$(BRCM_BAL_LIB):
66 @cp $(BRCM_PATH)/build/core/lib/libbal_api_dist.so .
suhasgrao76e8f8c2017-07-12 16:24:33 +053067
Rajeswara Raof6b4e6c2017-08-31 17:26:27 +053068$(EDGECORE_DRIV_LIB):
69 @cd $(EDGECORE);make
70 @cp $(EDGECORE)/libEdgecoreDriver.a .
71
72edgecore_lib_clean:
73 @cd $(EDGECORE);make clean
74 @rm -f libEdgecoreDriver.a
75
76clean_all: edgecore_lib_clean clean
77
78all:voltha_bal_driver$(EXEEXT)
79