blob: 995622d541db6c7c74f019ceaada3e17cf559be6 [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 Gadag0d2d39a2018-03-19 12:18:26 +05307 -I $(PKG_CONFIG_SYSROOT_DIR)/usr/include/audio-kernel \
Sachin Mohan Gadag3d3e78f2016-11-30 10:30:36 +05308 -I $(top_srcdir)/hal/${TARGET_PLATFORM}
Yamit Mehtaa0d653a2016-11-25 20:33:25 +05309
10c_sources = audio_hw.c \
11 voice.c \
12 platform_info.c \
Sachin Mohan Gadag3d3e78f2016-11-30 10:30:36 +053013 ${TARGET_PLATFORM}/platform.c \
Yamit Mehtaa0d653a2016-11-25 20:33:25 +053014 audio_extn/audio_extn.c \
Vignesh Kulothungan55396882017-04-20 14:37:02 -070015 audio_extn/utils.c \
16 acdb.c
Yamit Mehtaa0d653a2016-11-25 20:33:25 +053017
18if HDMI_EDID
19AM_CFLAGS += -DHDMI_EDID
20c_sources += edid.c
21endif
22
23if FM_POWER_OPT
24AM_CFLAGS += -DFM_POWER_OPT
25c_sources += audio_extn/fm.c
26endif
27
28if USBAUDIO
29AM_CFLAGS += -DUSB_HEADSET_ENABLED
30c_sources += audio_extn/usb.c
31endif
32
33if HFP
34AM_CFLAGS += -DHFP_ENABLED
35c_sources += audio_extn/hfp.c
36endif
37
38if SSR
39AM_CFLAGS += -DSSR_ENABLED
40c_sources += audio_extn/ssr.c
41AM_CFLAGS += -I ${WORKSPACE}/audio/mm-audio-noship/surround_sound_3mic/libsurround_3mic_proc/surround_rec_interface/inc/
42endif
43
44if MULTI_VOICE_SESSIONS
45AM_CFLAGS += -DMULTI_VOICE_SESSION_ENABLED
46c_sources += voice_extn/voice_extn.c
47endif
48
49if COMPRESS_VOIP
50AM_CFLAGS += -DCOMPRESS_VOIP_ENABLED
51c_sources += voice_extn/compress_voip.c
52endif
53
54if SPKR_PROTECTION
55AM_CFLAGS += -DSPKR_PROT_ENABLED
56c_sources += audio_extn/spkr_protection.c
57endif
58
59if HW_VARIANTS
60AM_CFLAGS += -DHW_VARIANTS_ENABLED
Sachin Mohan Gadag3d3e78f2016-11-30 10:30:36 +053061c_sources += ${TARGET_PLATFORM}/hw_info.c
Yamit Mehtaa0d653a2016-11-25 20:33:25 +053062endif
63
64if COMPRESS_CAPTURE
65AM_CFLAGS += -DCOMPRESS_CAPTURE_ENABLED
66c_sources += audio_extn/compress_capture.c
67endif
68
69if DTS_EAGLE
70AM_CFLAGS += -DDTS_EAGLE
71c_sources += audio_extn/dts_eagle.c
72endif
73
74if DOLBY_DDP
75AM_CFLAGS += -DDS1_DOLBY_DDP_ENABLED
76c_sources += audio_extn/dolby.c
77endif
78
79if DS1_DOLBY_DAP
80AM_CFLAGS += -DDS1_DOLBY_DAP_ENABLED
81if DOLBY_DDP
82c_sources += audio_extn/dolby.c
83endif
84endif
85
86if DEV_ARBI
87AM_CFLAGS += -DDEV_ARBI_ENABLED
88c_sources += audio_extn/dev_arbi.c
89endif
90
91if SOURCE_TRACKING
92AM_CFLAGS += -DSOURCE_TRACKING_ENABLED
93c_sources += audio_extn/source_track.c
94endif
95
96if LISTEN
97AM_CFLAGS += -DAUDIO_LISTEN_ENABLED
98AM_CFLAGS += -I ${WORKSPACE}/audio/mm-audio-noship/audio-listen
99c_sources += audio_extn/listen.c
100endif
101
102if SOUND_TRIGGER
103AM_CFLAGS += -DSOUND_TRIGGER_ENABLED
104AM_CFLAGS += -I ${WORKSPACE}/audio/mm-audio/sound_trigger/
105c_sources += audio_extn/soundtrigger.c
106endif
107
Yamit Mehta0d37ca02016-11-24 09:12:40 +0530108if FLAC_SUPPORT
109AM_CFLAGS += -DFLAC_OFFLOAD_ENABLED
110AM_CFLAGS += -DCOMPRESS_METADATA_NEEDED
111endif
112
113if ALAC_SUPPORT
114AM_CFLAGS += -DALAC_OFFLOAD_ENABLED
115AM_CFLAGS += -DCOMPRESS_METADATA_NEEDED
116endif
117
118if VORBIS_SUPPORT
119AM_CFLAGS += -DVORBIS_OFFLOAD_ENABLED
120AM_CFLAGS += -DCOMPRESS_METADATA_NEEDED
121endif
122
123if WMA_SUPPORT
124AM_CFLAGS += -DWMA_OFFLOAD_ENABLED
125AM_CFLAGS += -DCOMPRESS_METADATA_NEEDED
126endif
127
Dhananjay Kumaree4d2002016-10-25 18:02:58 +0530128if COMPRESS_INPUT
129AM_CFLAGS += -DCOMPRESS_INPUT_ENABLED
130c_sources += audio_extn/compress_in.c
131endif
132
Satish Babu Patakokila915ecba2017-01-10 17:43:56 +0530133if COMPRESS_PASSTHROUGH
134AM_CFLAGS += -DHDMI_PASSTHROUGH_ENABLED
135c_sources += audio_extn/passthru.c
136endif
137
Manish Dewangan798b00a2017-06-09 12:33:05 +0530138if AUDIO_PARSER
139AM_CFLAGS += -I ${WORKSPACE}/audio/mm-audio/audio-parsers/inc/
140if DTSHD_PARSER
141AM_CFLAGS += -DDTSHD_PARSER_ENABLED
142endif
143endif
144
Satish Babu Patakokila915ecba2017-01-10 17:43:56 +0530145if KEEP_ALIVE
146AM_CFLAGS += -DKEEP_ALIVE_ENABLED
147c_sources += audio_extn/keep_alive.c
148endif
149
Dhananjay Kumaree4d2002016-10-25 18:02:58 +0530150if AUDIO_HW_EXTN_API
151AM_CFLAGS += -DAUDIO_HW_EXTN_API_ENABLED
152c_sources += audio_hw_extn_api.c
153endif
154
Weiyin Jiang82e40942017-01-10 16:07:34 +0800155if GEF
156AM_CFLAGS += -DAUDIO_GENERIC_EFFECT_FRAMEWORK_ENABLED
157c_sources += audio_extn/gef.c
Dhanalakshmi Siddaniedaa1822016-12-08 17:37:29 +0530158endif
159
Dhanalakshmi Siddani18737932016-11-29 17:33:17 +0530160if APTX_DECODER
161AM_CFLAGS += -DAPTX_DECODER_ENABLED
162endif
163
Dhanalakshmi Siddani0bbcb9e2017-02-03 19:14:42 +0530164if AFE_PROXY
165AM_CFLAGS += -DAFE_PROXY_ENABLED
166endif
167
Ben Rombergerd771a7c2017-02-22 18:05:17 -0800168if ADSP_HDLR
169AM_CFLAGS += -DAUDIO_EXTN_ADSP_HDLR_ENABLED
170c_sources += audio_extn/adsp_hdlr.c
171endif
172
Naresh Tannirub1834322017-04-13 18:27:03 +0530173if SPLIT_A2DP
174AM_CFLAGS += -DSPLIT_A2DP_ENABLED
175c_sources += audio_extn/a2dp.c
176endif
177
Naresh Tannirue7156032017-04-18 17:43:05 -0700178if AUDIO_IP_HDLR
179AM_CFLAGS += -DAUDIO_EXTN_IP_HDLR_ENABLED
180c_sources += audio_extn/ip_hdlr_intf.c
181endif
182
Deepak Agarwal1a304782017-01-25 19:42:04 +0530183if QAF_SUPPORT
184AM_CFLAGS += -DQAF_EXTN_ENABLED
185c_sources += audio_extn/qaf.c
186endif
187
Siddartha Shaik31b530e2017-05-19 15:26:33 +0530188if AUDIO_HW_LOOPBACK
189AM_CFLAGS += -DAUDIO_HW_LOOPBACK_ENABLED
190c_sources += audio_extn/hw_loopback.c
191endif
192
Surendar Karka59c51072017-12-13 11:25:57 +0530193if RUN_KEEP_ALIVE_IN_ARM_FFV
194AM_CFLAGS += -DRUN_KEEP_ALIVE_IN_ARM_FFV
195endif
196
Garmond Leunge2433c32017-09-28 21:51:22 -0700197if AUDIO_HW_FFV
198AM_CFLAGS += -DFFV_ENABLED \
199 -I $(PKG_CONFIG_SYSROOT_DIR)/usr/include/ffv/
200c_sources += audio_extn/ffv.c
201endif
202
Surendar karka82dd9b22018-01-05 14:52:23 +0530203if CUSTOM_STEREO
204AM_CFLAGS += -DCUSTOM_STEREO_ENABLED
205endif
206
Dhananjay Kumar6085bd12018-07-11 22:49:01 +0530207if INSTANCE_ID
208AM_CFLAGS += -DINSTANCE_ID_ENABLED
209endif
210
Yamit Mehtaa0d653a2016-11-25 20:33:25 +0530211h_sources = audio_extn/audio_defs.h \
212 audio_extn/audio_extn.h \
213 audio_hw.h \
214 voice.h
215
216library_include_HEADERS = $(h_sources)
217library_includedir = $(includedir)
218
Sachin Mohan Gadagbc3584e2017-04-20 19:21:16 +0530219lib_LTLIBRARIES = audio.primary.default.la
Yamit Mehtaa0d653a2016-11-25 20:33:25 +0530220audio_primary_default_la_SOURCES = $(c_sources)
221audio_primary_default_la_LIBADD = $(GLIB_LIBS) -llog -lcutils -ltinyalsa
222audio_primary_default_la_LIBADD += -ltinycompress -laudioroute -ldl -lexpat -laudioutils
Manish Dewangan798b00a2017-06-09 12:33:05 +0530223if AUDIO_PARSER
224audio_primary_default_la_LIBADD += -laudioparsers
225endif
Yamit Mehtaa0d653a2016-11-25 20:33:25 +0530226audio_primary_default_la_CFLAGS = $(AM_CFLAGS) $(GLIB_CFLAGS)
227audio_primary_default_la_CFLAGS += -Dstrlcat=g_strlcat
228audio_primary_default_la_CFLAGS += -DINT_MAX=0x7fffffff
229audio_primary_default_la_CFLAGS += -D__unused=__attribute__\(\(__unused__\)\)
Sachin Mohan Gadag1ec7fab2016-12-12 17:41:26 +0530230audio_primary_default_la_CFLAGS += -DLINUX_ENABLED $(TARGET_CFLAGS) -DAUDIO_EXTN_FORMATS_ENABLED
Sachin Mohan Gadag364932c2017-10-30 19:14:52 +0530231audio_primary_default_la_CFLAGS += -DNDEBUG
Yamit Mehtaa0d653a2016-11-25 20:33:25 +0530232audio_primary_default_la_LDFLAGS = -module -shared -avoid-version