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 \ |
| 14 | audio_extn/utils.c |
| 15 | |
| 16 | if HDMI_EDID |
| 17 | AM_CFLAGS += -DHDMI_EDID |
| 18 | c_sources += edid.c |
| 19 | endif |
| 20 | |
| 21 | if FM_POWER_OPT |
| 22 | AM_CFLAGS += -DFM_POWER_OPT |
| 23 | c_sources += audio_extn/fm.c |
| 24 | endif |
| 25 | |
| 26 | if USBAUDIO |
| 27 | AM_CFLAGS += -DUSB_HEADSET_ENABLED |
| 28 | c_sources += audio_extn/usb.c |
| 29 | endif |
| 30 | |
| 31 | if HFP |
| 32 | AM_CFLAGS += -DHFP_ENABLED |
| 33 | c_sources += audio_extn/hfp.c |
| 34 | endif |
| 35 | |
| 36 | if SSR |
| 37 | AM_CFLAGS += -DSSR_ENABLED |
| 38 | c_sources += audio_extn/ssr.c |
| 39 | AM_CFLAGS += -I ${WORKSPACE}/audio/mm-audio-noship/surround_sound_3mic/libsurround_3mic_proc/surround_rec_interface/inc/ |
| 40 | endif |
| 41 | |
| 42 | if MULTI_VOICE_SESSIONS |
| 43 | AM_CFLAGS += -DMULTI_VOICE_SESSION_ENABLED |
| 44 | c_sources += voice_extn/voice_extn.c |
| 45 | endif |
| 46 | |
| 47 | if COMPRESS_VOIP |
| 48 | AM_CFLAGS += -DCOMPRESS_VOIP_ENABLED |
| 49 | c_sources += voice_extn/compress_voip.c |
| 50 | endif |
| 51 | |
| 52 | if SPKR_PROTECTION |
| 53 | AM_CFLAGS += -DSPKR_PROT_ENABLED |
| 54 | c_sources += audio_extn/spkr_protection.c |
| 55 | endif |
| 56 | |
| 57 | if HW_VARIANTS |
| 58 | AM_CFLAGS += -DHW_VARIANTS_ENABLED |
Sachin Mohan Gadag | 3d3e78f | 2016-11-30 10:30:36 +0530 | [diff] [blame^] | 59 | c_sources += ${TARGET_PLATFORM}/hw_info.c |
Yamit Mehta | a0d653a | 2016-11-25 20:33:25 +0530 | [diff] [blame] | 60 | endif |
| 61 | |
| 62 | if COMPRESS_CAPTURE |
| 63 | AM_CFLAGS += -DCOMPRESS_CAPTURE_ENABLED |
| 64 | c_sources += audio_extn/compress_capture.c |
| 65 | endif |
| 66 | |
| 67 | if DTS_EAGLE |
| 68 | AM_CFLAGS += -DDTS_EAGLE |
| 69 | c_sources += audio_extn/dts_eagle.c |
| 70 | endif |
| 71 | |
| 72 | if DOLBY_DDP |
| 73 | AM_CFLAGS += -DDS1_DOLBY_DDP_ENABLED |
| 74 | c_sources += audio_extn/dolby.c |
| 75 | endif |
| 76 | |
| 77 | if DS1_DOLBY_DAP |
| 78 | AM_CFLAGS += -DDS1_DOLBY_DAP_ENABLED |
| 79 | if DOLBY_DDP |
| 80 | c_sources += audio_extn/dolby.c |
| 81 | endif |
| 82 | endif |
| 83 | |
| 84 | if DEV_ARBI |
| 85 | AM_CFLAGS += -DDEV_ARBI_ENABLED |
| 86 | c_sources += audio_extn/dev_arbi.c |
| 87 | endif |
| 88 | |
| 89 | if SOURCE_TRACKING |
| 90 | AM_CFLAGS += -DSOURCE_TRACKING_ENABLED |
| 91 | c_sources += audio_extn/source_track.c |
| 92 | endif |
| 93 | |
| 94 | if LISTEN |
| 95 | AM_CFLAGS += -DAUDIO_LISTEN_ENABLED |
| 96 | AM_CFLAGS += -I ${WORKSPACE}/audio/mm-audio-noship/audio-listen |
| 97 | c_sources += audio_extn/listen.c |
| 98 | endif |
| 99 | |
| 100 | if SOUND_TRIGGER |
| 101 | AM_CFLAGS += -DSOUND_TRIGGER_ENABLED |
| 102 | AM_CFLAGS += -I ${WORKSPACE}/audio/mm-audio/sound_trigger/ |
| 103 | c_sources += audio_extn/soundtrigger.c |
| 104 | endif |
| 105 | |
Yamit Mehta | 0d37ca0 | 2016-11-24 09:12:40 +0530 | [diff] [blame] | 106 | if FLAC_SUPPORT |
| 107 | AM_CFLAGS += -DFLAC_OFFLOAD_ENABLED |
| 108 | AM_CFLAGS += -DCOMPRESS_METADATA_NEEDED |
| 109 | endif |
| 110 | |
| 111 | if ALAC_SUPPORT |
| 112 | AM_CFLAGS += -DALAC_OFFLOAD_ENABLED |
| 113 | AM_CFLAGS += -DCOMPRESS_METADATA_NEEDED |
| 114 | endif |
| 115 | |
| 116 | if VORBIS_SUPPORT |
| 117 | AM_CFLAGS += -DVORBIS_OFFLOAD_ENABLED |
| 118 | AM_CFLAGS += -DCOMPRESS_METADATA_NEEDED |
| 119 | endif |
| 120 | |
| 121 | if WMA_SUPPORT |
| 122 | AM_CFLAGS += -DWMA_OFFLOAD_ENABLED |
| 123 | AM_CFLAGS += -DCOMPRESS_METADATA_NEEDED |
| 124 | endif |
| 125 | |
Dhananjay Kumar | ee4d200 | 2016-10-25 18:02:58 +0530 | [diff] [blame] | 126 | if COMPRESS_INPUT |
| 127 | AM_CFLAGS += -DCOMPRESS_INPUT_ENABLED |
| 128 | c_sources += audio_extn/compress_in.c |
| 129 | endif |
| 130 | |
| 131 | if AUDIO_HW_EXTN_API |
| 132 | AM_CFLAGS += -DAUDIO_HW_EXTN_API_ENABLED |
| 133 | c_sources += audio_hw_extn_api.c |
| 134 | endif |
| 135 | |
Yamit Mehta | a0d653a | 2016-11-25 20:33:25 +0530 | [diff] [blame] | 136 | h_sources = audio_extn/audio_defs.h \ |
| 137 | audio_extn/audio_extn.h \ |
| 138 | audio_hw.h \ |
| 139 | voice.h |
| 140 | |
| 141 | library_include_HEADERS = $(h_sources) |
| 142 | library_includedir = $(includedir) |
| 143 | |
| 144 | lib_LTLIBRARIES = audio_primary_default.la |
| 145 | audio_primary_default_la_SOURCES = $(c_sources) |
| 146 | audio_primary_default_la_LIBADD = $(GLIB_LIBS) -llog -lcutils -ltinyalsa |
| 147 | audio_primary_default_la_LIBADD += -ltinycompress -laudioroute -ldl -lexpat -laudioutils |
| 148 | audio_primary_default_la_CFLAGS = $(AM_CFLAGS) $(GLIB_CFLAGS) |
| 149 | audio_primary_default_la_CFLAGS += -Dstrlcat=g_strlcat |
| 150 | audio_primary_default_la_CFLAGS += -DINT_MAX=0x7fffffff |
| 151 | audio_primary_default_la_CFLAGS += -D__unused=__attribute__\(\(__unused__\)\) |
Sachin Mohan Gadag | 3d3e78f | 2016-11-30 10:30:36 +0530 | [diff] [blame^] | 152 | audio_primary_default_la_CFLAGS += -DLINUX_ENABLED $(TARGET_CFLAGS) |
Yamit Mehta | a0d653a | 2016-11-25 20:33:25 +0530 | [diff] [blame] | 153 | audio_primary_default_la_LDFLAGS = -module -shared -avoid-version |