[Feature][ZXW-33]merge ZXW 0428 version
Change-Id: I11f167edfea428d9fab198ff00ff1364932d1b0b
diff --git a/ap/lib/libvoice/Makefile b/ap/lib/libvoice/Makefile
index e092fad..31a4d66 100644
--- a/ap/lib/libvoice/Makefile
+++ b/ap/lib/libvoice/Makefile
@@ -23,8 +23,12 @@
#*******************************************************************************
LIB_SHARED = libvoice.so
LIB_STATIC = libvoice.a
-
-OBJS = voice.o
+ifeq ($(USE_VOICE_ALSA),yes)
+OBJS = voice.o alsa_call.o voice_api.o voiceipc.o
+else
+OBJS = voice.o
+endif
+
CFLAGS += -g
LDFLAGS += -lpthread
@@ -33,6 +37,7 @@
CFLAGS += -I$(zte_lib_path)/libtinyalsa/include
CFLAGS += -I$(STAGEDIR)/include
CFLAGS += -I$(APP_DIR)/include
+CFLAGS += -I$(LINUX_DIR)/include
CFLAGS += -fPIC
LDFLAGS_SHARED += -shared
@@ -41,14 +46,16 @@
#*******************************************************************************
# comp test app and
#*******************************************************************************
-
-
+ifeq ($(USE_VOICE_ALSA),yes)
+EXEC_voiceipc = voiceipc
+endif
#*******************************************************************************
# objects
#*******************************************************************************
-
-
+ifeq ($(USE_VOICE_ALSA),yes)
+voiceipc_OBJECTS += voice_api.o voiceipc.o
+endif
#########################for linux######################################
@@ -63,7 +70,29 @@
LDLIBS += -L$(LIB_DIR)/libtinyalsa
LDLIBS += -ltinyalsa
-all: $(LIB_STATIC) $(LIB_SHARED)
+ifeq ($(USE_VOICE_ALSA),yes)
+all: $(LIB_STATIC) $(LIB_SHARED) $(EXEC_voiceipc)
+
+$(LIB_STATIC) : $(OBJS)
+ $(AR) rcs $(LIB_STATIC) $(OBJS)
+
+$(LIB_SHARED): $(OBJS)
+ $(CC) $(LDFLAGS) $(LDFLAGS_SHARED) -o $@ $^
+
+
+$(EXEC_voiceipc): $(voiceipc_OBJECTS)
+ $(CC) $(LDFLAGS) -o $@ $(voiceipc_OBJECTS) -Wl,--start-group $(LDLIBS) -Wl,--end-group
+
+clean:
+ rm -f $(voiceipc_OBJECTS) $(lib_OBJECTS) $(LIB_SHARED) $(LIB_STATIC) $(EXEC_voiceipc) *.elf *.gdb *.o core
+
+romfs:
+ $(ROMFSINST) $(LIB_SHARED) /lib/$(LIB_SHARED)
+ $(ROMFSINST) $(EXEC_voiceipc) /bin/$(EXEC_voiceipc)
+
+ cp -v $(EXEC_voiceipc) $(APP_DIR)/test_tools/
+else
+all: $(LIB_STATIC) $(LIB_SHARED)
$(LIB_STATIC) : $(OBJS)
$(AR) rcs $(LIB_STATIC) $(OBJS)
@@ -79,7 +108,6 @@
romfs:
$(ROMFSINST) $(LIB_SHARED) /lib/$(LIB_SHARED)
-
-
+endif