blob: 48061f2d3cd892e7928cd717a3ae312dcf5a61e6 [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.lidf7f8ba2024-09-12 23:53:34 -070028
xf.libdd93d52023-05-12 07:10:14 -070029else
30OBJS = voice.o
31endif
xf.lidf7f8ba2024-09-12 23:53:34 -070032
33ifeq ($(USE_VOICE_BUFFER_IN_AP),yes)
34OBJS += voice_buffer.o
35endif
xf.libdd93d52023-05-12 07:10:14 -070036
lh9ed821d2023-04-07 01:36:19 -070037CFLAGS += -g
38LDFLAGS += -lpthread
39
40##############USER COMIZE END##################
41
42CFLAGS += -I$(zte_lib_path)/libtinyalsa/include
43CFLAGS += -I$(STAGEDIR)/include
44CFLAGS += -I$(APP_DIR)/include
xf.libdd93d52023-05-12 07:10:14 -070045CFLAGS += -I$(LINUX_DIR)/include
lh9ed821d2023-04-07 01:36:19 -070046CFLAGS += -fPIC
47
48LDFLAGS_SHARED += -shared
49
50
51#*******************************************************************************
52# comp test app and
53#*******************************************************************************
xf.libdd93d52023-05-12 07:10:14 -070054ifeq ($(USE_VOICE_ALSA),yes)
55EXEC_voiceipc = voiceipc
56endif
lh9ed821d2023-04-07 01:36:19 -070057
58#*******************************************************************************
59# objects
60#*******************************************************************************
xf.libdd93d52023-05-12 07:10:14 -070061ifeq ($(USE_VOICE_ALSA),yes)
xf.li742dd022023-06-08 01:43:32 -070062voiceipc_OBJECTS += alsa_call.o voice_api.o voiceipc.o
xf.libdd93d52023-05-12 07:10:14 -070063endif
lh9ed821d2023-04-07 01:36:19 -070064
65
66#########################for linux######################################
67
68
69
70
71
72CFLAGS += -I./include/
73CFLAGS += -g -Werror=implicit-function-declaration
74SHAREDFLAG := -shared -lc
75LDLIBS += -L$(LIB_DIR)/libtinyalsa
76LDLIBS += -ltinyalsa
xf.li742dd022023-06-08 01:43:32 -070077LDLIBS += -lnvram_sc -L$(zte_lib_path)/libnvram
78LDLIBS += -lsoftap -L$(zte_lib_path)/libsoftap
79LDLIBS += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
lh9ed821d2023-04-07 01:36:19 -070080
xf.libdd93d52023-05-12 07:10:14 -070081ifeq ($(USE_VOICE_ALSA),yes)
82all: $(LIB_STATIC) $(LIB_SHARED) $(EXEC_voiceipc)
83
84$(LIB_STATIC) : $(OBJS)
85 $(AR) rcs $(LIB_STATIC) $(OBJS)
86
87$(LIB_SHARED): $(OBJS)
88 $(CC) $(LDFLAGS) $(LDFLAGS_SHARED) -o $@ $^
89
90
91$(EXEC_voiceipc): $(voiceipc_OBJECTS)
92 $(CC) $(LDFLAGS) -o $@ $(voiceipc_OBJECTS) -Wl,--start-group $(LDLIBS) -Wl,--end-group
93
94clean:
95 rm -f $(voiceipc_OBJECTS) $(lib_OBJECTS) $(LIB_SHARED) $(LIB_STATIC) $(EXEC_voiceipc) *.elf *.gdb *.o core
96
97romfs:
98 $(ROMFSINST) $(LIB_SHARED) /lib/$(LIB_SHARED)
99 $(ROMFSINST) $(EXEC_voiceipc) /bin/$(EXEC_voiceipc)
100
101 cp -v $(EXEC_voiceipc) $(APP_DIR)/test_tools/
102else
103all: $(LIB_STATIC) $(LIB_SHARED)
lh9ed821d2023-04-07 01:36:19 -0700104
105$(LIB_STATIC) : $(OBJS)
106 $(AR) rcs $(LIB_STATIC) $(OBJS)
107
108$(LIB_SHARED): $(OBJS)
109 $(CC) $(LDFLAGS) $(LDFLAGS_SHARED) -o $@ $^
110
111
112
113
114clean:
115 rm -f $(lib_OBJECTS) $(LIB_SHARED) $(LIB_STATIC) *.elf *.gdb *.o core
116
117romfs:
118 $(ROMFSINST) $(LIB_SHARED) /lib/$(LIB_SHARED)
xf.libdd93d52023-05-12 07:10:14 -0700119endif
lh9ed821d2023-04-07 01:36:19 -0700120
121