Yamit Mehta | a0d653a | 2016-11-25 20:33:25 +0530 | [diff] [blame] | 1 | AM_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 Gadag | 3d3e78f | 2016-11-30 10:30:36 +0530 | [diff] [blame] | 7 | -I $(top_srcdir)/hal/${TARGET_PLATFORM} |
Yamit Mehta | a0d653a | 2016-11-25 20:33:25 +0530 | [diff] [blame] | 8 | |
| 9 | c_sources = audio_hw.c \ |
| 10 | voice.c \ |
| 11 | platform_info.c \ |
Sachin Mohan Gadag | 3d3e78f | 2016-11-30 10:30:36 +0530 | [diff] [blame] | 12 | ${TARGET_PLATFORM}/platform.c \ |
Yamit Mehta | a0d653a | 2016-11-25 20:33:25 +0530 | [diff] [blame] | 13 | audio_extn/audio_extn.c \ |
Vignesh Kulothungan | 5539688 | 2017-04-20 14:37:02 -0700 | [diff] [blame] | 14 | audio_extn/utils.c \ |
| 15 | acdb.c |
Yamit Mehta | a0d653a | 2016-11-25 20:33:25 +0530 | [diff] [blame] | 16 | |
| 17 | if HDMI_EDID |
| 18 | AM_CFLAGS += -DHDMI_EDID |
| 19 | c_sources += edid.c |
| 20 | endif |
| 21 | |
| 22 | if FM_POWER_OPT |
| 23 | AM_CFLAGS += -DFM_POWER_OPT |
| 24 | c_sources += audio_extn/fm.c |
| 25 | endif |
| 26 | |
| 27 | if USBAUDIO |
| 28 | AM_CFLAGS += -DUSB_HEADSET_ENABLED |
| 29 | c_sources += audio_extn/usb.c |
| 30 | endif |
| 31 | |
| 32 | if HFP |
| 33 | AM_CFLAGS += -DHFP_ENABLED |
| 34 | c_sources += audio_extn/hfp.c |
| 35 | endif |
| 36 | |
| 37 | if SSR |
| 38 | AM_CFLAGS += -DSSR_ENABLED |
| 39 | c_sources += audio_extn/ssr.c |
| 40 | AM_CFLAGS += -I ${WORKSPACE}/audio/mm-audio-noship/surround_sound_3mic/libsurround_3mic_proc/surround_rec_interface/inc/ |
| 41 | endif |
| 42 | |
| 43 | if MULTI_VOICE_SESSIONS |
| 44 | AM_CFLAGS += -DMULTI_VOICE_SESSION_ENABLED |
| 45 | c_sources += voice_extn/voice_extn.c |
| 46 | endif |
| 47 | |
| 48 | if COMPRESS_VOIP |
| 49 | AM_CFLAGS += -DCOMPRESS_VOIP_ENABLED |
| 50 | c_sources += voice_extn/compress_voip.c |
| 51 | endif |
| 52 | |
| 53 | if SPKR_PROTECTION |
| 54 | AM_CFLAGS += -DSPKR_PROT_ENABLED |
| 55 | c_sources += audio_extn/spkr_protection.c |
| 56 | endif |
| 57 | |
| 58 | if HW_VARIANTS |
| 59 | AM_CFLAGS += -DHW_VARIANTS_ENABLED |
Sachin Mohan Gadag | 3d3e78f | 2016-11-30 10:30:36 +0530 | [diff] [blame] | 60 | c_sources += ${TARGET_PLATFORM}/hw_info.c |
Yamit Mehta | a0d653a | 2016-11-25 20:33:25 +0530 | [diff] [blame] | 61 | endif |
| 62 | |
| 63 | if COMPRESS_CAPTURE |
| 64 | AM_CFLAGS += -DCOMPRESS_CAPTURE_ENABLED |
| 65 | c_sources += audio_extn/compress_capture.c |
| 66 | endif |
| 67 | |
| 68 | if DTS_EAGLE |
| 69 | AM_CFLAGS += -DDTS_EAGLE |
| 70 | c_sources += audio_extn/dts_eagle.c |
| 71 | endif |
| 72 | |
| 73 | if DOLBY_DDP |
| 74 | AM_CFLAGS += -DDS1_DOLBY_DDP_ENABLED |
| 75 | c_sources += audio_extn/dolby.c |
| 76 | endif |
| 77 | |
| 78 | if DS1_DOLBY_DAP |
| 79 | AM_CFLAGS += -DDS1_DOLBY_DAP_ENABLED |
| 80 | if DOLBY_DDP |
| 81 | c_sources += audio_extn/dolby.c |
| 82 | endif |
| 83 | endif |
| 84 | |
| 85 | if DEV_ARBI |
| 86 | AM_CFLAGS += -DDEV_ARBI_ENABLED |
| 87 | c_sources += audio_extn/dev_arbi.c |
| 88 | endif |
| 89 | |
| 90 | if SOURCE_TRACKING |
| 91 | AM_CFLAGS += -DSOURCE_TRACKING_ENABLED |
| 92 | c_sources += audio_extn/source_track.c |
| 93 | endif |
| 94 | |
| 95 | if LISTEN |
| 96 | AM_CFLAGS += -DAUDIO_LISTEN_ENABLED |
| 97 | AM_CFLAGS += -I ${WORKSPACE}/audio/mm-audio-noship/audio-listen |
| 98 | c_sources += audio_extn/listen.c |
| 99 | endif |
| 100 | |
| 101 | if SOUND_TRIGGER |
| 102 | AM_CFLAGS += -DSOUND_TRIGGER_ENABLED |
| 103 | AM_CFLAGS += -I ${WORKSPACE}/audio/mm-audio/sound_trigger/ |
| 104 | c_sources += audio_extn/soundtrigger.c |
| 105 | endif |
| 106 | |
Yamit Mehta | 0d37ca0 | 2016-11-24 09:12:40 +0530 | [diff] [blame] | 107 | if FLAC_SUPPORT |
| 108 | AM_CFLAGS += -DFLAC_OFFLOAD_ENABLED |
| 109 | AM_CFLAGS += -DCOMPRESS_METADATA_NEEDED |
| 110 | endif |
| 111 | |
| 112 | if ALAC_SUPPORT |
| 113 | AM_CFLAGS += -DALAC_OFFLOAD_ENABLED |
| 114 | AM_CFLAGS += -DCOMPRESS_METADATA_NEEDED |
| 115 | endif |
| 116 | |
| 117 | if VORBIS_SUPPORT |
| 118 | AM_CFLAGS += -DVORBIS_OFFLOAD_ENABLED |
| 119 | AM_CFLAGS += -DCOMPRESS_METADATA_NEEDED |
| 120 | endif |
| 121 | |
| 122 | if WMA_SUPPORT |
| 123 | AM_CFLAGS += -DWMA_OFFLOAD_ENABLED |
| 124 | AM_CFLAGS += -DCOMPRESS_METADATA_NEEDED |
| 125 | endif |
| 126 | |
Dhananjay Kumar | ee4d200 | 2016-10-25 18:02:58 +0530 | [diff] [blame] | 127 | if COMPRESS_INPUT |
| 128 | AM_CFLAGS += -DCOMPRESS_INPUT_ENABLED |
| 129 | c_sources += audio_extn/compress_in.c |
| 130 | endif |
| 131 | |
Satish Babu Patakokila | 915ecba | 2017-01-10 17:43:56 +0530 | [diff] [blame] | 132 | if COMPRESS_PASSTHROUGH |
| 133 | AM_CFLAGS += -DHDMI_PASSTHROUGH_ENABLED |
| 134 | c_sources += audio_extn/passthru.c |
| 135 | endif |
| 136 | |
Manish Dewangan | 798b00a | 2017-06-09 12:33:05 +0530 | [diff] [blame] | 137 | if AUDIO_PARSER |
| 138 | AM_CFLAGS += -I ${WORKSPACE}/audio/mm-audio/audio-parsers/inc/ |
| 139 | if DTSHD_PARSER |
| 140 | AM_CFLAGS += -DDTSHD_PARSER_ENABLED |
| 141 | endif |
| 142 | endif |
| 143 | |
Satish Babu Patakokila | 915ecba | 2017-01-10 17:43:56 +0530 | [diff] [blame] | 144 | if KEEP_ALIVE |
| 145 | AM_CFLAGS += -DKEEP_ALIVE_ENABLED |
| 146 | c_sources += audio_extn/keep_alive.c |
| 147 | endif |
| 148 | |
Dhananjay Kumar | ee4d200 | 2016-10-25 18:02:58 +0530 | [diff] [blame] | 149 | if AUDIO_HW_EXTN_API |
| 150 | AM_CFLAGS += -DAUDIO_HW_EXTN_API_ENABLED |
| 151 | c_sources += audio_hw_extn_api.c |
| 152 | endif |
| 153 | |
Weiyin Jiang | 82e4094 | 2017-01-10 16:07:34 +0800 | [diff] [blame] | 154 | if GEF |
| 155 | AM_CFLAGS += -DAUDIO_GENERIC_EFFECT_FRAMEWORK_ENABLED |
| 156 | c_sources += audio_extn/gef.c |
Dhanalakshmi Siddani | edaa182 | 2016-12-08 17:37:29 +0530 | [diff] [blame] | 157 | endif |
| 158 | |
Dhanalakshmi Siddani | 1873793 | 2016-11-29 17:33:17 +0530 | [diff] [blame] | 159 | if APTX_DECODER |
| 160 | AM_CFLAGS += -DAPTX_DECODER_ENABLED |
| 161 | endif |
| 162 | |
Dhanalakshmi Siddani | 0bbcb9e | 2017-02-03 19:14:42 +0530 | [diff] [blame] | 163 | if AFE_PROXY |
| 164 | AM_CFLAGS += -DAFE_PROXY_ENABLED |
| 165 | endif |
| 166 | |
Ben Romberger | d771a7c | 2017-02-22 18:05:17 -0800 | [diff] [blame] | 167 | if ADSP_HDLR |
| 168 | AM_CFLAGS += -DAUDIO_EXTN_ADSP_HDLR_ENABLED |
| 169 | c_sources += audio_extn/adsp_hdlr.c |
| 170 | endif |
| 171 | |
Naresh Tanniru | b183432 | 2017-04-13 18:27:03 +0530 | [diff] [blame] | 172 | if SPLIT_A2DP |
| 173 | AM_CFLAGS += -DSPLIT_A2DP_ENABLED |
| 174 | c_sources += audio_extn/a2dp.c |
| 175 | endif |
| 176 | |
Naresh Tanniru | e715603 | 2017-04-18 17:43:05 -0700 | [diff] [blame] | 177 | if AUDIO_IP_HDLR |
| 178 | AM_CFLAGS += -DAUDIO_EXTN_IP_HDLR_ENABLED |
| 179 | c_sources += audio_extn/ip_hdlr_intf.c |
| 180 | endif |
| 181 | |
Deepak Agarwal | 1a30478 | 2017-01-25 19:42:04 +0530 | [diff] [blame] | 182 | if QAF_SUPPORT |
| 183 | AM_CFLAGS += -DQAF_EXTN_ENABLED |
| 184 | c_sources += audio_extn/qaf.c |
| 185 | endif |
| 186 | |
Siddartha Shaik | 31b530e | 2017-05-19 15:26:33 +0530 | [diff] [blame] | 187 | if AUDIO_HW_LOOPBACK |
| 188 | AM_CFLAGS += -DAUDIO_HW_LOOPBACK_ENABLED |
| 189 | c_sources += audio_extn/hw_loopback.c |
| 190 | endif |
| 191 | |
Garmond Leung | e2433c3 | 2017-09-28 21:51:22 -0700 | [diff] [blame] | 192 | if AUDIO_HW_FFV |
| 193 | AM_CFLAGS += -DFFV_ENABLED \ |
| 194 | -I $(PKG_CONFIG_SYSROOT_DIR)/usr/include/ffv/ |
| 195 | c_sources += audio_extn/ffv.c |
| 196 | endif |
| 197 | |
Surendar karka | 82dd9b2 | 2018-01-05 14:52:23 +0530 | [diff] [blame^] | 198 | if CUSTOM_STEREO |
| 199 | AM_CFLAGS += -DCUSTOM_STEREO_ENABLED |
| 200 | endif |
| 201 | |
Yamit Mehta | a0d653a | 2016-11-25 20:33:25 +0530 | [diff] [blame] | 202 | h_sources = audio_extn/audio_defs.h \ |
| 203 | audio_extn/audio_extn.h \ |
| 204 | audio_hw.h \ |
| 205 | voice.h |
| 206 | |
| 207 | library_include_HEADERS = $(h_sources) |
| 208 | library_includedir = $(includedir) |
| 209 | |
Sachin Mohan Gadag | bc3584e | 2017-04-20 19:21:16 +0530 | [diff] [blame] | 210 | lib_LTLIBRARIES = audio.primary.default.la |
Yamit Mehta | a0d653a | 2016-11-25 20:33:25 +0530 | [diff] [blame] | 211 | audio_primary_default_la_SOURCES = $(c_sources) |
| 212 | audio_primary_default_la_LIBADD = $(GLIB_LIBS) -llog -lcutils -ltinyalsa |
| 213 | audio_primary_default_la_LIBADD += -ltinycompress -laudioroute -ldl -lexpat -laudioutils |
Manish Dewangan | 798b00a | 2017-06-09 12:33:05 +0530 | [diff] [blame] | 214 | if AUDIO_PARSER |
| 215 | audio_primary_default_la_LIBADD += -laudioparsers |
| 216 | endif |
Yamit Mehta | a0d653a | 2016-11-25 20:33:25 +0530 | [diff] [blame] | 217 | audio_primary_default_la_CFLAGS = $(AM_CFLAGS) $(GLIB_CFLAGS) |
| 218 | audio_primary_default_la_CFLAGS += -Dstrlcat=g_strlcat |
| 219 | audio_primary_default_la_CFLAGS += -DINT_MAX=0x7fffffff |
| 220 | audio_primary_default_la_CFLAGS += -D__unused=__attribute__\(\(__unused__\)\) |
Sachin Mohan Gadag | 1ec7fab | 2016-12-12 17:41:26 +0530 | [diff] [blame] | 221 | audio_primary_default_la_CFLAGS += -DLINUX_ENABLED $(TARGET_CFLAGS) -DAUDIO_EXTN_FORMATS_ENABLED |
Sachin Mohan Gadag | 364932c | 2017-10-30 19:14:52 +0530 | [diff] [blame] | 222 | audio_primary_default_la_CFLAGS += -DNDEBUG |
Yamit Mehta | a0d653a | 2016-11-25 20:33:25 +0530 | [diff] [blame] | 223 | audio_primary_default_la_LDFLAGS = -module -shared -avoid-version |