blob: a7f371a9f4539fb603f4c973507a9bf622e513ac [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)
xf.li742dd022023-06-08 01:43:32 -070057voiceipc_OBJECTS += alsa_call.o voice_api.o voiceipc.o
xf.libdd93d52023-05-12 07:10:14 -070058endif
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
xf.li742dd022023-06-08 01:43:32 -070072LDLIBS += -lnvram_sc -L$(zte_lib_path)/libnvram
73LDLIBS += -lsoftap -L$(zte_lib_path)/libsoftap
74LDLIBS += -lsoft_timer_sc -L$(zte_lib_path)/libsoft_timer
lh9ed821d2023-04-07 01:36:19 -070075
xf.libdd93d52023-05-12 07:10:14 -070076ifeq ($(USE_VOICE_ALSA),yes)
77all: $(LIB_STATIC) $(LIB_SHARED) $(EXEC_voiceipc)
78
79$(LIB_STATIC) : $(OBJS)
80 $(AR) rcs $(LIB_STATIC) $(OBJS)
81
82$(LIB_SHARED): $(OBJS)
83 $(CC) $(LDFLAGS) $(LDFLAGS_SHARED) -o $@ $^
84
85
86$(EXEC_voiceipc): $(voiceipc_OBJECTS)
87 $(CC) $(LDFLAGS) -o $@ $(voiceipc_OBJECTS) -Wl,--start-group $(LDLIBS) -Wl,--end-group
88
89clean:
90 rm -f $(voiceipc_OBJECTS) $(lib_OBJECTS) $(LIB_SHARED) $(LIB_STATIC) $(EXEC_voiceipc) *.elf *.gdb *.o core
91
92romfs:
93 $(ROMFSINST) $(LIB_SHARED) /lib/$(LIB_SHARED)
94 $(ROMFSINST) $(EXEC_voiceipc) /bin/$(EXEC_voiceipc)
95
96 cp -v $(EXEC_voiceipc) $(APP_DIR)/test_tools/
97else
98all: $(LIB_STATIC) $(LIB_SHARED)
lh9ed821d2023-04-07 01:36:19 -070099
100$(LIB_STATIC) : $(OBJS)
101 $(AR) rcs $(LIB_STATIC) $(OBJS)
102
103$(LIB_SHARED): $(OBJS)
104 $(CC) $(LDFLAGS) $(LDFLAGS_SHARED) -o $@ $^
105
106
107
108
109clean:
110 rm -f $(lib_OBJECTS) $(LIB_SHARED) $(LIB_STATIC) *.elf *.gdb *.o core
111
112romfs:
113 $(ROMFSINST) $(LIB_SHARED) /lib/$(LIB_SHARED)
xf.libdd93d52023-05-12 07:10:14 -0700114endif
lh9ed821d2023-04-07 01:36:19 -0700115
116