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