blob: be1a8de80b6c8d10ac07c0a898073ac9e00de785 [file] [log] [blame]
Laxminath Kasam8b1366a2017-10-05 01:44:16 +05301# We can build either as part of a standalone Kernel build or as
2# an external module. Determine which mechanism is being used
Asish Bhattacharya5faacb32017-12-04 17:23:15 +05303ifeq ($(MODNAME),)
4 KERNEL_BUILD := 1
5else
6 KERNEL_BUILD := 0
7endif
Laxminath Kasam8b1366a2017-10-05 01:44:16 +05308
9
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053010ifeq ($(KERNEL_BUILD), 1)
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053011 # These are configurable via Kconfig for kernel-based builds
12 # Need to explicitly configure for Android-based builds
Piyush Balwanif9d9d1e2018-11-30 19:13:42 +053013 AUDIO_BLD_DIR := $(shell pwd)/kernel/msm-4.9
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053014 AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio
15endif
16
17ifeq ($(KERNEL_BUILD), 0)
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053018 ifeq ($(CONFIG_ARCH_SDM845), y)
19 include $(AUDIO_ROOT)/config/sdm845auto.conf
20 export
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053021 INCS += -include $(AUDIO_ROOT)/config/sdm845autoconf.h
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053022 endif
23 ifeq ($(CONFIG_ARCH_SDM670), y)
Aditya Bavanari68d3ed82018-04-08 14:34:47 +053024 include $(AUDIO_ROOT)/config/sdm710auto.conf
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053025 export
Aditya Bavanari68d3ed82018-04-08 14:34:47 +053026 INCS += -include $(AUDIO_ROOT)/config/sdm710autoconf.h
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053027 endif
Laxminath Kasam942d1c62017-12-29 11:02:22 +053028 ifeq ($(CONFIG_ARCH_SDM450), y)
Soumya Managolieaff6622018-02-23 12:00:54 +053029 include $(AUDIO_ROOT)/config/sdm450auto.conf
Laxminath Kasam942d1c62017-12-29 11:02:22 +053030 export
Soumya Managolieaff6622018-02-23 12:00:54 +053031 INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
Laxminath Kasam942d1c62017-12-29 11:02:22 +053032 endif
Vaishnavi Kommaraju59562a12018-04-25 19:33:46 +053033 ifeq ($(CONFIG_ARCH_SDM439), y)
34 include $(AUDIO_ROOT)/config/sdm450auto.conf
35 export
36 INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
37 endif
Xiaoyu Yee7df5cc2017-10-02 18:47:29 -070038 ifeq ($(CONFIG_ARCH_SDXPOORWILLS), y)
39 include $(AUDIO_ROOT)/config/sdxpoorwillsauto.conf
40 export
41 INCS += -include $(AUDIO_ROOT)/config/sdxpoorwillsautoconf.h
42 endif
Sundara Vinayagam43ce7c92018-05-21 16:34:47 +053043 ifeq ($(CONFIG_ARCH_MSM8909), y)
Manjunatha Madana58ebedb2020-02-19 17:39:05 +053044 ifeq ($(CONFIG_MSM_BGCOM), y)
45 include $(AUDIO_ROOT)/config/msm8909auto.conf
46 export
47 INCS += -include $(AUDIO_ROOT)/config/msm8909autoconf.h
48 endif
49 ifeq ($(CONFIG_MSM_8905), m)
50 include $(AUDIO_ROOT)/config/msm8905auto.conf
51 export
52 INCS += -include $(AUDIO_ROOT)/config/msm8905autoconf.h
53 endif
Sundara Vinayagam43ce7c92018-05-21 16:34:47 +053054 endif
Soumya Managolid63fb8e2018-05-08 17:28:01 +053055 ifeq ($(CONFIG_ARCH_MSM8917), y)
56 include $(AUDIO_ROOT)/config/sdm450auto.conf
57 export
58 INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
59 endif
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053060endif
61
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053062# As per target team, build is done as follows:
63# Defconfig : build with default flags
64# Slub : defconfig + CONFIG_SLUB_DEBUG := y +
65# CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y
66# Perf : Using appropriate msmXXXX-perf_defconfig
67#
68# Shipment builds (user variants) should not have any debug feature
69# enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds
70# are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since
71# there is no other way to identify defconfig builds, QTI internal
72# representation of perf builds (identified using the string 'perf'),
73# is used to identify if the build is a slub or defconfig one. This
74# way no critical debug feature will be enabled for perf and shipment
75# builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT
76# config.
77
78############ UAPI ############
79UAPI_DIR := uapi
80UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR)
81
82############ COMMON ############
83COMMON_DIR := include
84COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR)
85
86############ ASoC Drivers ############
87
88
89# for SDM6xx sound card driver
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053090ifdef CONFIG_SND_SOC_SDM670
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053091 MACHINE_OBJS += sdm660-common.o
92endif
93
94# for SDM6xx sound card driver
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053095ifdef CONFIG_SND_SOC_INT_CODEC
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053096 MACHINE_OBJS += sdm660-internal.o
97endif
98
99# for SDM6xx sound card driver
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530100ifdef CONFIG_SND_SOC_EXT_CODEC
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530101 MACHINE_OBJS += sdm660-external.o
102 MACHINE_OBJS += sdm660-ext-dai-links.o
103endif
104
105# for SDM845 sound card driver
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530106ifdef CONFIG_SND_SOC_MACHINE_SDM845
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530107 MACHINE_OBJS += sdm845.o
108endif
109
Xiaoyu Yee7df5cc2017-10-02 18:47:29 -0700110# for SDXPOORWILLS sound card driver
111ifdef CONFIG_SND_SOC_MACHINE_SDXPOORWILLS
112 MACHINE_OBJS += sdxpoorwills.o
113endif
114
Raja Mallikdc60da52018-05-21 16:41:24 +0530115# for APQ8009 external codec sound card driver
116ifdef CONFIG_SND_SOC_EXT_CODEC_8909
117 MACHINE_EXT_OBJS += apq8009-i2s-ext-codec.o
118endif
119
Soumya Managoli91b8c3f2018-02-24 18:36:15 +0530120# for SDM450 internal codec sound card driver
Soumya Managolieaff6622018-02-23 12:00:54 +0530121ifdef CONFIG_SND_SOC_SDM450
122 MACHINE_OBJS += msm8952.o
123endif
124
yang liu0e16b0c2018-08-10 12:09:21 +0800125ifdef CONFIG_SND_SOC_MSM8909
126 MACHINE_INT_OBJS += msm8952.o
127endif
128
Soumya Managoli91b8c3f2018-02-24 18:36:15 +0530129# for SDM450 external codec sound card driver
130ifdef CONFIG_SND_SOC_EXT_CODEC_SDM450
131 MACHINE_EXT_OBJS += msm8952-slimbus.o
132 MACHINE_EXT_OBJS += msm8952-dai-links.o
133endif
134
Sundara Vinayagam43ce7c92018-05-21 16:34:47 +0530135# for MSM8909 sound card driver
136ifdef CONFIG_SND_SOC_BG_8909
137 MACHINE_OBJS += msm_bg.o
138endif
139
Manjunatha Madana80e8ffa2018-12-17 14:13:08 +0530140ifdef CONFIG_SND_SOC_8909_DIG_CDC
141 MACHINE_DIGCDC_OBJS += msm8909.o
142endif
143
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530144ifdef CONFIG_SND_SOC_CPE
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530145 CPE_LSM_OBJS += msm-cpe-lsm.o
146endif
147
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530148ifdef CONFIG_SND_SOC_QDSP6V2
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530149 PLATFORM_OBJS += msm-audio-effects-q6-v2.o
150 PLATFORM_OBJS += msm-compress-q6-v2.o
151 PLATFORM_OBJS += msm-dai-fe.o
152 PLATFORM_OBJS += msm-dai-q6-hdmi-v2.o
153 PLATFORM_OBJS += msm-dai-q6-v2.o
154 PLATFORM_OBJS += msm-dai-slim.o
155 PLATFORM_OBJS += msm-dai-stub-v2.o
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530156 PLATFORM_OBJS += msm-lsm-client.o
157 PLATFORM_OBJS += msm-pcm-afe-v2.o
158 PLATFORM_OBJS += msm-pcm-dtmf-v2.o
159 PLATFORM_OBJS += msm-pcm-hostless.o
160 PLATFORM_OBJS += msm-pcm-host-voice-v2.o
161 PLATFORM_OBJS += msm-pcm-loopback-v2.o
162 PLATFORM_OBJS += msm-pcm-q6-noirq.o
163 PLATFORM_OBJS += msm-pcm-q6-v2.o
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530164 PLATFORM_OBJS += msm-pcm-routing-v2.o
165 PLATFORM_OBJS += msm-pcm-voice-v2.o
166 PLATFORM_OBJS += msm-pcm-voip-v2.o
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530167 PLATFORM_OBJS += msm-transcode-loopback-q6-v2.o
168 PLATFORM_OBJS += platform_init.o
169endif
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530170ifdef CONFIG_DOLBY_DS2
171 PLATFORM_OBJS += msm-ds2-dap-config.o
172endif
173ifdef CONFIG_DOLBY_LICENSE
174 PLATFORM_OBJS += msm-ds2-dap-config.o
175endif
Laxminath Kasam27c8dcf2018-01-03 21:13:17 +0530176ifdef CONFIG_SND_HWDEP_ROUTING
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530177 PLATFORM_OBJS += msm-pcm-routing-devdep.o
178endif
179ifdef CONFIG_QTI_PP
180 PLATFORM_OBJS += msm-qti-pp-config.o
181endif
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530182
183LINUX_INC += -Iinclude/linux
184
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530185INCS += $(COMMON_INC) \
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530186 $(UAPI_INC)
187
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530188EXTRA_CFLAGS += $(INCS)
189
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530190CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \
191 -DANI_LITTLE_BIT_ENDIAN \
192 -DDOT11F_LITTLE_ENDIAN_HOST \
193 -DANI_COMPILER_TYPE_GCC \
194 -DANI_OS_TYPE_ANDROID=6 \
195 -DPTT_SOCK_SVC_ENABLE \
196 -Wall\
197 -Werror\
198 -D__linux__
199
200KBUILD_CPPFLAGS += $(CDEFINES)
201
202# Currently, for versions of gcc which support it, the kernel Makefile
203# is disabling the maybe-uninitialized warning. Re-enable it for the
204# AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it
205# will override the kernel settings.
206ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y)
207EXTRA_CFLAGS += -Wmaybe-uninitialized
208endif
209#EXTRA_CFLAGS += -Wmissing-prototypes
210
211ifeq ($(call cc-option-yn, -Wheader-guard),y)
212EXTRA_CFLAGS += -Wheader-guard
213endif
214
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530215ifeq ($(KERNEL_BUILD), 0)
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530216KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers
217KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers
218KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd934x/Module.symvers
219KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/sdm660_cdc/Module.symvers
220KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/msm_sdw/Module.symvers
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530221endif
222ifeq ($(KERNEL_BUILD), 1)
223 obj-y += codecs/
224endif
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530225# Module information used by KBuild framework
226obj-$(CONFIG_SND_SOC_QDSP6V2) += platform_dlkm.o
227platform_dlkm-y := $(PLATFORM_OBJS)
228
Soumya Managolieaff6622018-02-23 12:00:54 +0530229obj-$(CONFIG_SND_SOC_SDM450) += machine_dlkm.o
230machine_dlkm-y := $(MACHINE_OBJS)
231
yang liu0e16b0c2018-08-10 12:09:21 +0800232obj-$(CONFIG_SND_SOC_MSM8909) += machine_int_dlkm.o
233machine_int_dlkm-y := $(MACHINE_INT_OBJS)
234
Raja Mallikdc60da52018-05-21 16:41:24 +0530235obj-$(CONFIG_SND_SOC_EXT_CODEC_8909) += machine_ext_dlkm.o
236machine_ext_dlkm-y := $(MACHINE_EXT_OBJS)
237
Soumya Managoli91b8c3f2018-02-24 18:36:15 +0530238obj-$(CONFIG_SND_SOC_EXT_CODEC_SDM450) += machine_ext_dlkm.o
239machine_ext_dlkm-y := $(MACHINE_EXT_OBJS)
240
Sundara Vinayagam43ce7c92018-05-21 16:34:47 +0530241obj-$(CONFIG_SND_SOC_BG_8909) += machine_dlkm.o
242machine_dlkm-y := $(MACHINE_OBJS)
243
Manjunatha Madana80e8ffa2018-12-17 14:13:08 +0530244obj-$(CONFIG_SND_SOC_8909_DIG_CDC) += machine_digcdc_dlkm.o
245machine_digcdc_dlkm-y := $(MACHINE_DIGCDC_OBJS)
246
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530247obj-$(CONFIG_SND_SOC_MACHINE_SDM845) += machine_dlkm.o
248machine_dlkm-y := $(MACHINE_OBJS)
249
250obj-$(CONFIG_SND_SOC_EXT_CODEC) += machine_dlkm.o
251machine_dlkm-y := $(MACHINE_OBJS)
252
253obj-$(CONFIG_SND_SOC_INT_CODEC) += machine_dlkm.o
254machine_dlkm-y := $(MACHINE_OBJS)
255
256obj-$(CONFIG_SND_SOC_CPE) += cpe_lsm_dlkm.o
257cpe_lsm_dlkm-y := $(CPE_LSM_OBJS)
258
259# inject some build related information
260DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\"