blob: 31a4d66223de77a4293358413a0fcef80dd94815 [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
28else
29OBJS = voice.o
30endif
31
lh9ed821d2023-04-07 01:36:19 -070032CFLAGS += -g
33LDFLAGS += -lpthread
34
35##############USER COMIZE END##################
36
37CFLAGS += -I$(zte_lib_path)/libtinyalsa/include
38CFLAGS += -I$(STAGEDIR)/include
39CFLAGS += -I$(APP_DIR)/include
xf.libdd93d52023-05-12 07:10:14 -070040CFLAGS += -I$(LINUX_DIR)/include
lh9ed821d2023-04-07 01:36:19 -070041CFLAGS += -fPIC
42
43LDFLAGS_SHARED += -shared
44
45
46#*******************************************************************************
47# comp test app and
48#*******************************************************************************
xf.libdd93d52023-05-12 07:10:14 -070049ifeq ($(USE_VOICE_ALSA),yes)
50EXEC_voiceipc = voiceipc
51endif
lh9ed821d2023-04-07 01:36:19 -070052
53#*******************************************************************************
54# objects
55#*******************************************************************************
xf.libdd93d52023-05-12 07:10:14 -070056ifeq ($(USE_VOICE_ALSA),yes)
57voiceipc_OBJECTS += voice_api.o voiceipc.o
58endif
lh9ed821d2023-04-07 01:36:19 -070059
60
61#########################for linux######################################
62
63
64
65
66
67CFLAGS += -I./include/
68CFLAGS += -g -Werror=implicit-function-declaration
69SHAREDFLAG := -shared -lc
70LDLIBS += -L$(LIB_DIR)/libtinyalsa
71LDLIBS += -ltinyalsa
72
xf.libdd93d52023-05-12 07:10:14 -070073ifeq ($(USE_VOICE_ALSA),yes)
74all: $(LIB_STATIC) $(LIB_SHARED) $(EXEC_voiceipc)
75
76$(LIB_STATIC) : $(OBJS)
77 $(AR) rcs $(LIB_STATIC) $(OBJS)
78
79$(LIB_SHARED): $(OBJS)
80 $(CC) $(LDFLAGS) $(LDFLAGS_SHARED) -o $@ $^
81
82
83$(EXEC_voiceipc): $(voiceipc_OBJECTS)
84 $(CC) $(LDFLAGS) -o $@ $(voiceipc_OBJECTS) -Wl,--start-group $(LDLIBS) -Wl,--end-group
85
86clean:
87 rm -f $(voiceipc_OBJECTS) $(lib_OBJECTS) $(LIB_SHARED) $(LIB_STATIC) $(EXEC_voiceipc) *.elf *.gdb *.o core
88
89romfs:
90 $(ROMFSINST) $(LIB_SHARED) /lib/$(LIB_SHARED)
91 $(ROMFSINST) $(EXEC_voiceipc) /bin/$(EXEC_voiceipc)
92
93 cp -v $(EXEC_voiceipc) $(APP_DIR)/test_tools/
94else
95all: $(LIB_STATIC) $(LIB_SHARED)
lh9ed821d2023-04-07 01:36:19 -070096
97$(LIB_STATIC) : $(OBJS)
98 $(AR) rcs $(LIB_STATIC) $(OBJS)
99
100$(LIB_SHARED): $(OBJS)
101 $(CC) $(LDFLAGS) $(LDFLAGS_SHARED) -o $@ $^
102
103
104
105
106clean:
107 rm -f $(lib_OBJECTS) $(LIB_SHARED) $(LIB_STATIC) *.elf *.gdb *.o core
108
109romfs:
110 $(ROMFSINST) $(LIB_SHARED) /lib/$(LIB_SHARED)
xf.libdd93d52023-05-12 07:10:14 -0700111endif
lh9ed821d2023-04-07 01:36:19 -0700112
113