blob: c0980d64add58601a76b5e77da6c5c5dea1460f2 [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 +05307voltha_bal_driver_SOURCES = \
8 voltha_bal_driver.c \
suhasgrao76e8f8c2017-07-12 16:24:33 +05309 grpc-c.h \
10 bal_errno.grpc-c.h bal_indications.grpc-c.h bal_model_types.grpc-c.h \
11 bal_obj.grpc-c.h bal.grpc-c.h bal_model_ids.grpc-c.h \
root5be94e52018-02-15 22:30:14 +053012 bal_msg_type.grpc-c.h bal_osmsg.grpc-c.h asfvolt.grpc-c.h asfvolt16_driver.h \
suhasgrao76e8f8c2017-07-12 16:24:33 +053013 bal.grpc-c.service.c \
14 bal_errno.grpc-c.c bal_indications.grpc-c.c \
root5be94e52018-02-15 22:30:14 +053015 bal_model_types.grpc-c.c bal_obj.grpc-c.c asfvolt.grpc-c.c \
suhasgrao76e8f8c2017-07-12 16:24:33 +053016 bal_errno.grpc-c.service.c bal_indications.grpc-c.service.c \
17 bal_model_types.grpc-c.service.c bal_obj.grpc-c.service.c \
18 bal.grpc-c.c bal_model_ids.grpc-c.c \
19 bal_msg_type.grpc-c.c bal_osmsg.grpc-c.c \
20 bal_model_ids.grpc-c.service.c \
root5be94e52018-02-15 22:30:14 +053021 bal_msg_type.grpc-c.service.c bal_osmsg.grpc-c.service.c \
22 asfvolt.grpc-c.service.c
suhasgrao76e8f8c2017-07-12 16:24:33 +053023
24replace:
25$(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' {} + )
26$(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' {} + )
27$(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' {} + )
28$(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' {} + )
29$(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' {} + )
30$(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' {} + )
31$(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 +053032$(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 +053033$(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 +053034
35autogen:
root5be94e52018-02-15 22:30:14 +053036 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 +053037
38LDADD = \
39 ../lib/libgrpc-c.la \
40 /usr/local/lib/libgrpc.a \
41 /usr/local/lib/libgpr.a \
42 /usr/local/lib/libprotobuf-c.a \
43 -lssl \
44 -lcrypto \
45 -lz \
46 -lpthread
47
Rajeswara Raof6b4e6c2017-08-31 17:26:27 +053048EXTRA_voltha_bal_driver_DEPENDENCIES=$(EDGECORE_DRIV_LIB) $(BRCM_BAL_LIB)
suhasgrao76e8f8c2017-07-12 16:24:33 +053049
Rajeswara Raof6b4e6c2017-08-31 17:26:27 +053050EDGECORE = /home/asfvolt/shared/OpenNetworkLinux/EdgeCore/driver-app
51BRCM_PATH = /home/asfvolt/shared/OpenNetworkLinux/bal_src_release_2.4.3.6/bal_release
52EDGECORE_DRIV_LIB=./libEdgecoreDriver.a
53BRCM_BAL_LIB=./libbal_api_dist.so
54
55LIBS = $(EDGECORE_DRIV_LIB) $(BRCM_BAL_LIB) -lrt -lm
suhasgrao76e8f8c2017-07-12 16:24:33 +053056
57AM_CFLAGS = \
58 -I. \
59 -I${srcdir}/../lib/h/ \
60 -I${srcdir}/../third_party/protobuf-c \
Rajeswara Raof6b4e6c2017-08-31 17:26:27 +053061 -I${srcdir}/../third_party/grpc/include \
62 -I${EDGECORE}/.
suhasgrao76e8f8c2017-07-12 16:24:33 +053063
Rajeswara Raof6b4e6c2017-08-31 17:26:27 +053064$(BRCM_BAL_LIB):
Girish Gowdru9ebd8b22018-09-26 03:21:03 -070065 @cp $(BRCM_PATH)/3rdparty/maple/cur/asfvolt16/release/broadcom/libbal_api_dist.so .
suhasgrao76e8f8c2017-07-12 16:24:33 +053066
Rajeswara Raof6b4e6c2017-08-31 17:26:27 +053067$(EDGECORE_DRIV_LIB):
68 @cd $(EDGECORE);make
69 @cp $(EDGECORE)/libEdgecoreDriver.a .
70
71edgecore_lib_clean:
72 @cd $(EDGECORE);make clean
73 @rm -f libEdgecoreDriver.a
74
75clean_all: edgecore_lib_clean clean
76
77all:voltha_bal_driver$(EXEEXT)
78