aml_audio_hal: Change link libraries for test commands.
PD#SWPL-13795
Problem:
Test commands only need link libaudio_client.so as
dependency lib and it does not need link grpc and
protobuf libs. Adding those libs in link list will
cause the build binaries cannot run on platforms
with different gprc/protobuf versions.
Solution:
Separate link library between audio_server,
libaudio_client and other utilities which don't
talk to RPC libraries directly.
Verify:
The built binary such as hal_param can run on other
builds with different RPC lib versions
Change-Id: Ie87b95b1ce38711de03f8619a02ac43479b4fb48
diff --git a/Makefile b/Makefile
index 6330c53..526b94b 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,8 @@
CFLAGS+=-fPIC -O2 -I$(PROTOC_INC) -I./include -I. -I./src
CXXFLAGS+=-std=c++14
-LDFLAGS+=-lgrpc++_unsecure -lprotobuf -lboost_system -llog -ldl -lrt -lpthread -lstdc++
+SC_LDFLAGS+=-lgrpc++_unsecure -lprotobuf -lboost_system -llog -ldl -lrt -lpthread -lstdc++
+LDFLAGS+=-llog -ldl -lrt -lpthread -lstdc++
%.grpc.pb.cc: %.proto
$(PROTOC) -I=. -I=$(PROTOC_INC) --grpc_out=. --plugin=protoc-gen-grpc=$(GRPC_CPP_PLUGIN_PATH) $<
@@ -46,10 +47,10 @@
all: audio_server libaudio_client.so audio_client_test audio_client_test_ac3 halplay dap_setting speaker_delay digital_mode test_arc start_arc hal_param master_vol
audio_server: $(SERVER_OBJS)
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+ $(CC) $(CFLAGS) $(SC_LDFLAGS) -o $@ $^
libaudio_client.so: $(CLIENT_OBJS)
- $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^
+ $(CC) $(CFLAGS) $(SC_LDFLAGS) -shared -o $@ $^
audio_client_test: $(TEST_PCM_OBJS) libaudio_client.so
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^