blob: 5bd2c54248e36db994eff70c27db6d9ab6795c01 [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 \
root5be94e52018-02-15 22:30:14 +053015 bal_msg_type.grpc-c.h bal_osmsg.grpc-c.h asfvolt.grpc-c.h asfvolt16_driver.h \
suhasgrao76e8f8c2017-07-12 16:24:33 +053016 bal.grpc-c.service.c \
17 bal_errno.grpc-c.c bal_indications.grpc-c.c \
root5be94e52018-02-15 22:30:14 +053018 bal_model_types.grpc-c.c bal_obj.grpc-c.c asfvolt.grpc-c.c \
suhasgrao76e8f8c2017-07-12 16:24:33 +053019 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 \
root5be94e52018-02-15 22:30:14 +053024 bal_msg_type.grpc-c.service.c bal_osmsg.grpc-c.service.c \
25 asfvolt.grpc-c.service.c
suhasgrao76e8f8c2017-07-12 16:24:33 +053026
27replace:
28$(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' {} + )
29$(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' {} + )
30$(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' {} + )
31$(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' {} + )
32$(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' {} + )
33$(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' {} + )
34$(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 +053035$(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' {} + )
root5be94e52018-02-15 22:30:14 +053036$(shell find . -type f \( -name '*.h' -o -name '*.c' \) -a -exec sed -i -e 's/asfvolt.proto.h/asfvolt.grpc-c.h/g' {} + )
suhasgrao65941192017-07-31 00:00:47 +053037
38autogen:
root5be94e52018-02-15 22:30:14 +053039 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 ${srcdir}/asfvolt.proto $(replace)
suhasgrao76e8f8c2017-07-12 16:24:33 +053040
41LDADD = \
42 ../lib/libgrpc-c.la \
43 /usr/local/lib/libgrpc.a \
44 /usr/local/lib/libgpr.a \
45 /usr/local/lib/libprotobuf-c.a \
46 -lssl \
47 -lcrypto \
48 -lz \
49 -lpthread
50
Rajeswara Raof6b4e6c2017-08-31 17:26:27 +053051EXTRA_voltha_bal_driver_DEPENDENCIES=$(EDGECORE_DRIV_LIB) $(BRCM_BAL_LIB)
suhasgrao76e8f8c2017-07-12 16:24:33 +053052
Rajeswara Raof6b4e6c2017-08-31 17:26:27 +053053EDGECORE = /home/asfvolt/shared/OpenNetworkLinux/EdgeCore/driver-app
54BRCM_PATH = /home/asfvolt/shared/OpenNetworkLinux/bal_src_release_2.4.3.6/bal_release
55EDGECORE_DRIV_LIB=./libEdgecoreDriver.a
56BRCM_BAL_LIB=./libbal_api_dist.so
57
58LIBS = $(EDGECORE_DRIV_LIB) $(BRCM_BAL_LIB) -lrt -lm
suhasgrao76e8f8c2017-07-12 16:24:33 +053059
60AM_CFLAGS = \
61 -I. \
62 -I${srcdir}/../lib/h/ \
63 -I${srcdir}/../third_party/protobuf-c \
Rajeswara Raof6b4e6c2017-08-31 17:26:27 +053064 -I${srcdir}/../third_party/grpc/include \
65 -I${EDGECORE}/.
suhasgrao76e8f8c2017-07-12 16:24:33 +053066
Rajeswara Raof6b4e6c2017-08-31 17:26:27 +053067$(BRCM_BAL_LIB):
68 @cp $(BRCM_PATH)/build/core/lib/libbal_api_dist.so .
suhasgrao76e8f8c2017-07-12 16:24:33 +053069
Rajeswara Raof6b4e6c2017-08-31 17:26:27 +053070$(EDGECORE_DRIV_LIB):
71 @cd $(EDGECORE);make
72 @cp $(EDGECORE)/libEdgecoreDriver.a .
73
74edgecore_lib_clean:
75 @cd $(EDGECORE);make clean
76 @rm -f libEdgecoreDriver.a
77
78clean_all: edgecore_lib_clean clean
79
80all:voltha_bal_driver$(EXEEXT)
81