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