Rajeswara Rao | f6b4e6c | 2017-08-31 17:26:27 +0530 | [diff] [blame] | 1 | bin_PROGRAMS = voltha_bal_driver |
suhasgrao | 76e8f8c | 2017-07-12 16:24:33 +0530 | [diff] [blame] | 2 | |
Rajeswara Rao | f6b4e6c | 2017-08-31 17:26:27 +0530 | [diff] [blame] | 3 | .PHONY = brcm_lib |
suhasgrao | 76e8f8c | 2017-07-12 16:24:33 +0530 | [diff] [blame] | 4 | |
| 5 | HOSTPROG=yes |
| 6 | |
Rajeswara Rao | f6b4e6c | 2017-08-31 17:26:27 +0530 | [diff] [blame] | 7 | DEFS += -UBAL_STUB |
suhasgrao | 76e8f8c | 2017-07-12 16:24:33 +0530 | [diff] [blame] | 8 | |
Rajeswara Rao | f6b4e6c | 2017-08-31 17:26:27 +0530 | [diff] [blame] | 9 | voltha_bal_driver_SOURCES = \ |
| 10 | voltha_bal_driver.c \ |
suhasgrao | 76e8f8c | 2017-07-12 16:24:33 +0530 | [diff] [blame] | 11 | 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 | |
| 26 | replace: |
| 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' {} + ) |
suhasgrao | 6594119 | 2017-07-31 00:00:47 +0530 | [diff] [blame] | 34 | $(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 | |
| 36 | autogen: |
suhasgrao | 76e8f8c | 2017-07-12 16:24:33 +0530 | [diff] [blame] | 37 | 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 | |
| 39 | LDADD = \ |
| 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 Rao | f6b4e6c | 2017-08-31 17:26:27 +0530 | [diff] [blame] | 49 | EXTRA_voltha_bal_driver_DEPENDENCIES=$(EDGECORE_DRIV_LIB) $(BRCM_BAL_LIB) |
suhasgrao | 76e8f8c | 2017-07-12 16:24:33 +0530 | [diff] [blame] | 50 | |
Rajeswara Rao | f6b4e6c | 2017-08-31 17:26:27 +0530 | [diff] [blame] | 51 | EDGECORE = /home/asfvolt/shared/OpenNetworkLinux/EdgeCore/driver-app |
| 52 | BRCM_PATH = /home/asfvolt/shared/OpenNetworkLinux/bal_src_release_2.4.3.6/bal_release |
| 53 | EDGECORE_DRIV_LIB=./libEdgecoreDriver.a |
| 54 | BRCM_BAL_LIB=./libbal_api_dist.so |
| 55 | |
| 56 | LIBS = $(EDGECORE_DRIV_LIB) $(BRCM_BAL_LIB) -lrt -lm |
suhasgrao | 76e8f8c | 2017-07-12 16:24:33 +0530 | [diff] [blame] | 57 | |
| 58 | AM_CFLAGS = \ |
| 59 | -I. \ |
| 60 | -I${srcdir}/../lib/h/ \ |
| 61 | -I${srcdir}/../third_party/protobuf-c \ |
Rajeswara Rao | f6b4e6c | 2017-08-31 17:26:27 +0530 | [diff] [blame] | 62 | -I${srcdir}/../third_party/grpc/include \ |
| 63 | -I${EDGECORE}/. |
suhasgrao | 76e8f8c | 2017-07-12 16:24:33 +0530 | [diff] [blame] | 64 | |
Rajeswara Rao | f6b4e6c | 2017-08-31 17:26:27 +0530 | [diff] [blame] | 65 | $(BRCM_BAL_LIB): |
| 66 | @cp $(BRCM_PATH)/build/core/lib/libbal_api_dist.so . |
suhasgrao | 76e8f8c | 2017-07-12 16:24:33 +0530 | [diff] [blame] | 67 | |
Rajeswara Rao | f6b4e6c | 2017-08-31 17:26:27 +0530 | [diff] [blame] | 68 | $(EDGECORE_DRIV_LIB): |
| 69 | @cd $(EDGECORE);make |
| 70 | @cp $(EDGECORE)/libEdgecoreDriver.a . |
| 71 | |
| 72 | edgecore_lib_clean: |
| 73 | @cd $(EDGECORE);make clean |
| 74 | @rm -f libEdgecoreDriver.a |
| 75 | |
| 76 | clean_all: edgecore_lib_clean clean |
| 77 | |
| 78 | all:voltha_bal_driver$(EXEEXT) |
| 79 | |