blob: c41b7191fceba5d3d773e47ed573bce3e94162f5 [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#* 2018/01/15 V1.0 Create chentianming ´´½¨
12#*
13# ******************************************************************************/
14
15#*******************************************************************************
16# include ZTE library makefile
17#*******************************************************************************
18include $(COMMON_MK)
19
20
21#*******************************************************************************
22# library
23#*******************************************************************************
24LIB_SHARED = libtinyalsa.so
25LIB_STATIC = libtinyalsa.a
26
27ifeq ($(_APP_AUDIO_TYPE_),watch_cap)
28OBJS = mixer.o pcm.o mixer_ctrl_watch_cap.o
29else
30OBJS = mixer.o pcm.o audio_mixer_ctrl.o
31endif
32CFLAGS += -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#*******************************************************************************
49EXEC_tinyplay = tinyplay
50EXEC_tinycap = tinycap
51EXEC_tinymix = tinymix
52EXEC_tinypcminfo = tinyinfo
53EXEC_alsatest = alsatest
54EXEC_voltest = voltest
55
56#*******************************************************************************
57# objects
58#*******************************************************************************
59tinyplay_OBJECTS += mixer.o pcm.o tinyplay.o
60tinycap_OBJECTS += mixer.o pcm.o tinycap.o
61tinymix_OBJECTS += mixer.o pcm.o tinymix.o
62tinypcminfo_OBJECTS += mixer.o pcm.o tinypcminfo.o
63alsatest_OBJECTS += mixer.o pcm.o alsatest.o
64voltest_OBJECTS += vol_test.o
65#########################for linux######################################
66
67ifeq ($(V3PHONE_TYPE), K318)
68 CFLAGS += -D_USE_7520V3_PHONE_TYPE_K318
69endif
70ifeq ($(V3PHONE_TYPE), C31F)
71 CFLAGS += -D_USE_7520V3_PHONE_TYPE_C31F
72endif
73ifeq ($(V3PHONE_TYPE), XRSD)
74 CFLAGS += -D_USE_7520V3_PHONE_TYPE_XRSD
75endif
76ifeq ($(V3PHONE_TYPE), FWP)
77 CFLAGS += -D_USE_7520V3_PHONE_TYPE_FWP
78endif
79ifeq ($(V3PHONE_TYPE), WTWD)
80 CFLAGS += -D_USE_7520V3_PHONE_TYPE_WTWD
81endif
82
83
84CFLAGS += -I./include/
85CFLAGS += -g -Werror=implicit-function-declaration
86SHAREDFLAG := -shared -lc
87LDLIBS += -L$(LIB_DIR)/libtinyalsa
88LDLIBS += -ltinyalsa
89
90all: $(LIB_STATIC) $(LIB_SHARED) $(EXEC_tinyplay) $(EXEC_tinycap) $(EXEC_tinymix) $(EXEC_tinypcminfo)
91
92$(LIB_STATIC) : $(OBJS)
93 $(AR) rcs $(LIB_STATIC) $(OBJS)
94
95$(LIB_SHARED): $(OBJS)
96 $(CC) $(LDFLAGS) $(LDFLAGS_SHARED) -o $@ $^
97
98
99$(EXEC_tinyplay): $(tinyplay_OBJECTS)
100 $(CC) $(LDFLAGS) -o $@ $(tinyplay_OBJECTS) -Wl,--start-group $(LDLIBS) -Wl,--end-group
101$(EXEC_tinycap): $(tinycap_OBJECTS)
102 $(CC) $(LDFLAGS) -o $@ $(tinycap_OBJECTS) -Wl,--start-group $(LDLIBS) -Wl,--end-group
103$(EXEC_tinymix): $(tinymix_OBJECTS)
104 $(CC) $(LDFLAGS) -o $@ $(tinymix_OBJECTS) -Wl,--start-group $(LDLIBS) -Wl,--end-group
105$(EXEC_tinypcminfo): $(tinypcminfo_OBJECTS)
106 $(CC) $(LDFLAGS) -o $@ $(tinypcminfo_OBJECTS) -Wl,--start-group $(LDLIBS) -Wl,--end-group
107#$(EXEC_alsatest): $(alsatest_OBJECTS)
108# $(CC) $(LDFLAGS) -o $@ $(alsatest_OBJECTS) -Wl,--start-group $(LDLIBS) -Wl,--end-group
109#$(EXEC_voltest): $(voltest_OBJECTS)
110# $(CC) $(LDFLAGS) -o $@ $(voltest_OBJECTS) -Wl,--start-group $(LDLIBS) -lm -Wl,--end-group
111
112clean:
113 rm -f $(tinyplay_OBJECTS) $(tinycap_OBJECTS) $(tinymix_OBJECTS) $(tinypcminfo_OBJECTS) $(lib_OBJECTS) $(LIB_SHARED) $(LIB_STATIC) $(EXEC_tinyplay) $(EXEC_tinycap) $(EXEC_tinymix) $(EXEC_tinypcminfo) $(EXEC_alsatest) *.elf *.gdb *.o core
114
115romfs:
116 $(ROMFSINST) $(LIB_SHARED) /lib/$(LIB_SHARED)
xf.libdd93d52023-05-12 07:10:14 -0700117 $(ROMFSINST) $(EXEC_tinyplay) /bin/$(EXEC_tinyplay)
118 $(ROMFSINST) $(EXEC_tinycap) /bin/$(EXEC_tinycap)
119 $(ROMFSINST) $(EXEC_tinymix) /bin/$(EXEC_tinymix)
lh9ed821d2023-04-07 01:36:19 -0700120 #$(ROMFSINST) $(EXEC_tinypcminfo) /bin/$(EXEC_tinypcminfo)
121 #$(ROMFSINST) $(EXEC_voltest) /bin/$(EXEC_voltest)
122 cp -v $(EXEC_tinyplay) $(APP_DIR)/test_tools/
123 cp -v $(EXEC_tinycap) $(APP_DIR)/test_tools/
124 cp -v $(EXEC_tinymix) $(APP_DIR)/test_tools/
125 cp -v $(EXEC_tinypcminfo) $(APP_DIR)/test_tools/
126# $(ROMFSINST) $(EXEC_alsatest) /bin/$(EXEC_alsatest)
127
128
129# cp $(EXEC_tinyplay) $(EXEC_tinyplay).elf
130# cp $(EXEC_tinycap) $(EXEC_tinycap).elf
131
132# cp $(EXEC_tinymix) $(EXEC_tinymix).elf
133# cp $(EXEC_tinypcminfo) $(EXEC_tinypcminfo).elf
134# cp $(EXEC_alsatest) $(EXEC_alsatest).elf