blob: 7d677fb237a62908e0471f1336c39297e08c2268 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001# /*****************************************************************************
2#* °æÈ¨ËùÓÐ (C)2015, ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£
3#*
4#* ÎļþÃû³Æ: Makefile
5#* Îļþ±êʶ: Makefile
6#* ÄÚÈÝÕªÒª: Makefile of ZTE librarys
7#* ʹÓ÷½·¨: void
8#*
9#* ÐÞ¸ÄÈÕÆÚ °æ±¾ºÅ Ð޸ıê¼Ç ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
10#* -----------------------------------------------------------------------------
11#* 2019/09/25 V1.0 Create xxq ´´½¨
12#*
13# ******************************************************************************/
14
15#*******************************************************************************
16# include ZTE library makefile
17#*******************************************************************************
18include $(COMMON_MK)
19
20
21#*******************************************************************************
22# library
23#*******************************************************************************
24LIB_SHARED = libvoice.so
25LIB_STATIC = libvoice.a
xf.libdd93d52023-05-12 07:10:14 -070026ifeq ($(USE_VOICE_ALSA),yes)
27OBJS = voice.o alsa_call.o voice_api.o voiceipc.o
xf.lie31de8b2023-12-26 23:38:58 -080028else ifeq ($(USE_VOICE_BUFFER_IN_AP),yes)
29OBJS = voice.o voice_buffer.o
xf.libdd93d52023-05-12 07:10:14 -070030else
31OBJS = voice.o
32endif
33
lh9ed821d2023-04-07 01:36:19 -070034CFLAGS += -g
35LDFLAGS += -lpthread
36
37##############USER COMIZE END##################
38
39CFLAGS += -I$(zte_lib_path)/libtinyalsa/include
40CFLAGS += -I$(STAGEDIR)/include
41CFLAGS += -I$(APP_DIR)/include
xf.libdd93d52023-05-12 07:10:14 -070042CFLAGS += -I$(LINUX_DIR)/include
lh9ed821d2023-04-07 01:36:19 -070043CFLAGS += -fPIC
44
45LDFLAGS_SHARED += -shared
46
47
48#*******************************************************************************
49# comp test app and
50#*******************************************************************************
xf.libdd93d52023-05-12 07:10:14 -070051ifeq ($(USE_VOICE_ALSA),yes)
52EXEC_voiceipc = voiceipc
53endif
lh9ed821d2023-04-07 01:36:19 -070054
55#*******************************************************************************
56# objects
57#*******************************************************************************
xf.libdd93d52023-05-12 07:10:14 -070058ifeq ($(USE_VOICE_ALSA),yes)
xf.li742dd022023-06-08 01:43:32 -070059voiceipc_OBJECTS += alsa_call.o voice_api.o voiceipc.o
xf.libdd93d52023-05-12 07:10:14 -070060endif
lh9ed821d2023-04-07 01:36:19 -070061
62
63#########################for linux######################################
64
65
66
67
68
69CFLAGS += -I./include/
70CFLAGS += -g -Werror=implicit-function-declaration
71SHAREDFLAG := -shared -lc
72LDLIBS += -L$(LIB_DIR)/libtinyalsa
73LDLIBS += -ltinyalsa
xf.li742dd022023-06-08 01:43:32 -070074LDLIBS += -lnvram_sc -L$(zte_lib_path)/libnvram
75LDLIBS += -lsoftap -L$(zte_lib_path)/libsoftap
76LDLIBS += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
lh9ed821d2023-04-07 01:36:19 -070077
xf.libdd93d52023-05-12 07:10:14 -070078ifeq ($(USE_VOICE_ALSA),yes)
79all: $(LIB_STATIC) $(LIB_SHARED) $(EXEC_voiceipc)
80
81$(LIB_STATIC) : $(OBJS)
82 $(AR) rcs $(LIB_STATIC) $(OBJS)
83
84$(LIB_SHARED): $(OBJS)
85 $(CC) $(LDFLAGS) $(LDFLAGS_SHARED) -o $@ $^
86
87
88$(EXEC_voiceipc): $(voiceipc_OBJECTS)
89 $(CC) $(LDFLAGS) -o $@ $(voiceipc_OBJECTS) -Wl,--start-group $(LDLIBS) -Wl,--end-group
90
91clean:
92 rm -f $(voiceipc_OBJECTS) $(lib_OBJECTS) $(LIB_SHARED) $(LIB_STATIC) $(EXEC_voiceipc) *.elf *.gdb *.o core
93
94romfs:
95 $(ROMFSINST) $(LIB_SHARED) /lib/$(LIB_SHARED)
96 $(ROMFSINST) $(EXEC_voiceipc) /bin/$(EXEC_voiceipc)
97
98 cp -v $(EXEC_voiceipc) $(APP_DIR)/test_tools/
99else
100all: $(LIB_STATIC) $(LIB_SHARED)
lh9ed821d2023-04-07 01:36:19 -0700101
102$(LIB_STATIC) : $(OBJS)
103 $(AR) rcs $(LIB_STATIC) $(OBJS)
104
105$(LIB_SHARED): $(OBJS)
106 $(CC) $(LDFLAGS) $(LDFLAGS_SHARED) -o $@ $^
107
108
109
110
111clean:
112 rm -f $(lib_OBJECTS) $(LIB_SHARED) $(LIB_STATIC) *.elf *.gdb *.o core
113
114romfs:
115 $(ROMFSINST) $(LIB_SHARED) /lib/$(LIB_SHARED)
xf.libdd93d52023-05-12 07:10:14 -0700116endif
lh9ed821d2023-04-07 01:36:19 -0700117
118