blob: 4f01efcde6b23402f52b1abb5b3af38119bcfa16 [file] [log] [blame]
Yamit Mehtaa0d653a2016-11-25 20:33:25 +05301AM_CFLAGS = -I ${WORKSPACE}/external/tinyalsa/include \
2 -I ${WORKSPACE}/system/media/audio_effects/include \
3 -I ${WORKSPACE}/system/media/audio_utils/include \
4 -I $(top_srcdir)/hal \
5 -I $(top_srcdir)/hal/audio_extn \
6 -I $(top_srcdir)/hal/voice_extn \
Sachin Mohan Gadag3d3e78f2016-11-30 10:30:36 +05307 -I $(top_srcdir)/hal/${TARGET_PLATFORM}
Yamit Mehtaa0d653a2016-11-25 20:33:25 +05308
9c_sources = audio_hw.c \
10 voice.c \
11 platform_info.c \
Sachin Mohan Gadag3d3e78f2016-11-30 10:30:36 +053012 ${TARGET_PLATFORM}/platform.c \
Yamit Mehtaa0d653a2016-11-25 20:33:25 +053013 audio_extn/audio_extn.c \
Vignesh Kulothungan55396882017-04-20 14:37:02 -070014 audio_extn/utils.c \
15 acdb.c
Yamit Mehtaa0d653a2016-11-25 20:33:25 +053016
17if HDMI_EDID
18AM_CFLAGS += -DHDMI_EDID
19c_sources += edid.c
20endif
21
22if FM_POWER_OPT
23AM_CFLAGS += -DFM_POWER_OPT
24c_sources += audio_extn/fm.c
25endif
26
27if USBAUDIO
28AM_CFLAGS += -DUSB_HEADSET_ENABLED
29c_sources += audio_extn/usb.c
30endif
31
32if HFP
33AM_CFLAGS += -DHFP_ENABLED
34c_sources += audio_extn/hfp.c
35endif
36
37if SSR
38AM_CFLAGS += -DSSR_ENABLED
39c_sources += audio_extn/ssr.c
40AM_CFLAGS += -I ${WORKSPACE}/audio/mm-audio-noship/surround_sound_3mic/libsurround_3mic_proc/surround_rec_interface/inc/
41endif
42
43if MULTI_VOICE_SESSIONS
44AM_CFLAGS += -DMULTI_VOICE_SESSION_ENABLED
45c_sources += voice_extn/voice_extn.c
46endif
47
48if COMPRESS_VOIP
49AM_CFLAGS += -DCOMPRESS_VOIP_ENABLED
50c_sources += voice_extn/compress_voip.c
51endif
52
53if SPKR_PROTECTION
54AM_CFLAGS += -DSPKR_PROT_ENABLED
55c_sources += audio_extn/spkr_protection.c
56endif
57
58if HW_VARIANTS
59AM_CFLAGS += -DHW_VARIANTS_ENABLED
Sachin Mohan Gadag3d3e78f2016-11-30 10:30:36 +053060c_sources += ${TARGET_PLATFORM}/hw_info.c
Yamit Mehtaa0d653a2016-11-25 20:33:25 +053061endif
62
63if COMPRESS_CAPTURE
64AM_CFLAGS += -DCOMPRESS_CAPTURE_ENABLED
65c_sources += audio_extn/compress_capture.c
66endif
67
68if DTS_EAGLE
69AM_CFLAGS += -DDTS_EAGLE
70c_sources += audio_extn/dts_eagle.c
71endif
72
73if DOLBY_DDP
74AM_CFLAGS += -DDS1_DOLBY_DDP_ENABLED
75c_sources += audio_extn/dolby.c
76endif
77
78if DS1_DOLBY_DAP
79AM_CFLAGS += -DDS1_DOLBY_DAP_ENABLED
80if DOLBY_DDP
81c_sources += audio_extn/dolby.c
82endif
83endif
84
85if DEV_ARBI
86AM_CFLAGS += -DDEV_ARBI_ENABLED
87c_sources += audio_extn/dev_arbi.c
88endif
89
90if SOURCE_TRACKING
91AM_CFLAGS += -DSOURCE_TRACKING_ENABLED
92c_sources += audio_extn/source_track.c
93endif
94
95if LISTEN
96AM_CFLAGS += -DAUDIO_LISTEN_ENABLED
97AM_CFLAGS += -I ${WORKSPACE}/audio/mm-audio-noship/audio-listen
98c_sources += audio_extn/listen.c
99endif
100
101if SOUND_TRIGGER
102AM_CFLAGS += -DSOUND_TRIGGER_ENABLED
103AM_CFLAGS += -I ${WORKSPACE}/audio/mm-audio/sound_trigger/
104c_sources += audio_extn/soundtrigger.c
105endif
106
Yamit Mehta0d37ca02016-11-24 09:12:40 +0530107if FLAC_SUPPORT
108AM_CFLAGS += -DFLAC_OFFLOAD_ENABLED
109AM_CFLAGS += -DCOMPRESS_METADATA_NEEDED
110endif
111
112if ALAC_SUPPORT
113AM_CFLAGS += -DALAC_OFFLOAD_ENABLED
114AM_CFLAGS += -DCOMPRESS_METADATA_NEEDED
115endif
116
117if VORBIS_SUPPORT
118AM_CFLAGS += -DVORBIS_OFFLOAD_ENABLED
119AM_CFLAGS += -DCOMPRESS_METADATA_NEEDED
120endif
121
122if WMA_SUPPORT
123AM_CFLAGS += -DWMA_OFFLOAD_ENABLED
124AM_CFLAGS += -DCOMPRESS_METADATA_NEEDED
125endif
126
Dhananjay Kumaree4d2002016-10-25 18:02:58 +0530127if COMPRESS_INPUT
128AM_CFLAGS += -DCOMPRESS_INPUT_ENABLED
129c_sources += audio_extn/compress_in.c
130endif
131
Satish Babu Patakokila915ecba2017-01-10 17:43:56 +0530132if COMPRESS_PASSTHROUGH
133AM_CFLAGS += -DHDMI_PASSTHROUGH_ENABLED
134c_sources += audio_extn/passthru.c
135endif
136
Manish Dewangan798b00a2017-06-09 12:33:05 +0530137if AUDIO_PARSER
138AM_CFLAGS += -I ${WORKSPACE}/audio/mm-audio/audio-parsers/inc/
139if DTSHD_PARSER
140AM_CFLAGS += -DDTSHD_PARSER_ENABLED
141endif
142endif
143
Satish Babu Patakokila915ecba2017-01-10 17:43:56 +0530144if KEEP_ALIVE
145AM_CFLAGS += -DKEEP_ALIVE_ENABLED
146c_sources += audio_extn/keep_alive.c
147endif
148
Dhananjay Kumaree4d2002016-10-25 18:02:58 +0530149if AUDIO_HW_EXTN_API
150AM_CFLAGS += -DAUDIO_HW_EXTN_API_ENABLED
151c_sources += audio_hw_extn_api.c
152endif
153
Weiyin Jiang82e40942017-01-10 16:07:34 +0800154if GEF
155AM_CFLAGS += -DAUDIO_GENERIC_EFFECT_FRAMEWORK_ENABLED
156c_sources += audio_extn/gef.c
Dhanalakshmi Siddaniedaa1822016-12-08 17:37:29 +0530157endif
158
Dhanalakshmi Siddani18737932016-11-29 17:33:17 +0530159if APTX_DECODER
160AM_CFLAGS += -DAPTX_DECODER_ENABLED
161endif
162
Dhanalakshmi Siddani0bbcb9e2017-02-03 19:14:42 +0530163if AFE_PROXY
164AM_CFLAGS += -DAFE_PROXY_ENABLED
165endif
166
Ben Rombergerd771a7c2017-02-22 18:05:17 -0800167if ADSP_HDLR
168AM_CFLAGS += -DAUDIO_EXTN_ADSP_HDLR_ENABLED
169c_sources += audio_extn/adsp_hdlr.c
170endif
171
Naresh Tannirub1834322017-04-13 18:27:03 +0530172if SPLIT_A2DP
173AM_CFLAGS += -DSPLIT_A2DP_ENABLED
174c_sources += audio_extn/a2dp.c
175endif
176
Naresh Tannirue7156032017-04-18 17:43:05 -0700177if AUDIO_IP_HDLR
178AM_CFLAGS += -DAUDIO_EXTN_IP_HDLR_ENABLED
179c_sources += audio_extn/ip_hdlr_intf.c
180endif
181
Deepak Agarwal1a304782017-01-25 19:42:04 +0530182if QAF_SUPPORT
183AM_CFLAGS += -DQAF_EXTN_ENABLED
184c_sources += audio_extn/qaf.c
185endif
186
Siddartha Shaik31b530e2017-05-19 15:26:33 +0530187if AUDIO_HW_LOOPBACK
188AM_CFLAGS += -DAUDIO_HW_LOOPBACK_ENABLED
189c_sources += audio_extn/hw_loopback.c
190endif
191
Garmond Leunge2433c32017-09-28 21:51:22 -0700192if AUDIO_HW_FFV
193AM_CFLAGS += -DFFV_ENABLED \
194 -I $(PKG_CONFIG_SYSROOT_DIR)/usr/include/ffv/
195c_sources += audio_extn/ffv.c
196endif
197
Surendar karka82dd9b22018-01-05 14:52:23 +0530198if CUSTOM_STEREO
199AM_CFLAGS += -DCUSTOM_STEREO_ENABLED
200endif
201
Yamit Mehtaa0d653a2016-11-25 20:33:25 +0530202h_sources = audio_extn/audio_defs.h \
203 audio_extn/audio_extn.h \
204 audio_hw.h \
205 voice.h
206
207library_include_HEADERS = $(h_sources)
208library_includedir = $(includedir)
209
Sachin Mohan Gadagbc3584e2017-04-20 19:21:16 +0530210lib_LTLIBRARIES = audio.primary.default.la
Yamit Mehtaa0d653a2016-11-25 20:33:25 +0530211audio_primary_default_la_SOURCES = $(c_sources)
212audio_primary_default_la_LIBADD = $(GLIB_LIBS) -llog -lcutils -ltinyalsa
213audio_primary_default_la_LIBADD += -ltinycompress -laudioroute -ldl -lexpat -laudioutils
Manish Dewangan798b00a2017-06-09 12:33:05 +0530214if AUDIO_PARSER
215audio_primary_default_la_LIBADD += -laudioparsers
216endif
Yamit Mehtaa0d653a2016-11-25 20:33:25 +0530217audio_primary_default_la_CFLAGS = $(AM_CFLAGS) $(GLIB_CFLAGS)
218audio_primary_default_la_CFLAGS += -Dstrlcat=g_strlcat
219audio_primary_default_la_CFLAGS += -DINT_MAX=0x7fffffff
220audio_primary_default_la_CFLAGS += -D__unused=__attribute__\(\(__unused__\)\)
Sachin Mohan Gadag1ec7fab2016-12-12 17:41:26 +0530221audio_primary_default_la_CFLAGS += -DLINUX_ENABLED $(TARGET_CFLAGS) -DAUDIO_EXTN_FORMATS_ENABLED
Sachin Mohan Gadag364932c2017-10-30 19:14:52 +0530222audio_primary_default_la_CFLAGS += -DNDEBUG
Yamit Mehtaa0d653a2016-11-25 20:33:25 +0530223audio_primary_default_la_LDFLAGS = -module -shared -avoid-version