blob: 229299dc2e491680d95abe8b7e48a025b070dac7 [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
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053013 AUDIO_BLD_DIR := $(ANDROID_BUILD_TOP)/kernel/msm-4.9
14 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)
44 include $(AUDIO_ROOT)/config/msm8909auto.conf
45 export
46 INCS += -include $(AUDIO_ROOT)/config/msm8909autoconf.h
47 endif
Soumya Managolid63fb8e2018-05-08 17:28:01 +053048 ifeq ($(CONFIG_ARCH_MSM8917), y)
49 include $(AUDIO_ROOT)/config/sdm450auto.conf
50 export
51 INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h
52 endif
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053053endif
54
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053055# As per target team, build is done as follows:
56# Defconfig : build with default flags
57# Slub : defconfig + CONFIG_SLUB_DEBUG := y +
58# CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y
59# Perf : Using appropriate msmXXXX-perf_defconfig
60#
61# Shipment builds (user variants) should not have any debug feature
62# enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds
63# are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since
64# there is no other way to identify defconfig builds, QTI internal
65# representation of perf builds (identified using the string 'perf'),
66# is used to identify if the build is a slub or defconfig one. This
67# way no critical debug feature will be enabled for perf and shipment
68# builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT
69# config.
70
71############ UAPI ############
72UAPI_DIR := uapi
73UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR)
74
75############ COMMON ############
76COMMON_DIR := include
77COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR)
78
79############ ASoC Drivers ############
80
81
82# for SDM6xx sound card driver
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053083ifdef CONFIG_SND_SOC_SDM670
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053084 MACHINE_OBJS += sdm660-common.o
85endif
86
87# for SDM6xx sound card driver
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053088ifdef CONFIG_SND_SOC_INT_CODEC
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053089 MACHINE_OBJS += sdm660-internal.o
90endif
91
92# for SDM6xx sound card driver
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053093ifdef CONFIG_SND_SOC_EXT_CODEC
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053094 MACHINE_OBJS += sdm660-external.o
95 MACHINE_OBJS += sdm660-ext-dai-links.o
96endif
97
98# for SDM845 sound card driver
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053099ifdef CONFIG_SND_SOC_MACHINE_SDM845
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530100 MACHINE_OBJS += sdm845.o
101endif
102
Xiaoyu Yee7df5cc2017-10-02 18:47:29 -0700103# for SDXPOORWILLS sound card driver
104ifdef CONFIG_SND_SOC_MACHINE_SDXPOORWILLS
105 MACHINE_OBJS += sdxpoorwills.o
106endif
107
Raja Mallikdc60da52018-05-21 16:41:24 +0530108# for APQ8009 external codec sound card driver
109ifdef CONFIG_SND_SOC_EXT_CODEC_8909
110 MACHINE_EXT_OBJS += apq8009-i2s-ext-codec.o
111endif
112
Soumya Managoli91b8c3f2018-02-24 18:36:15 +0530113# for SDM450 internal codec sound card driver
Soumya Managolieaff6622018-02-23 12:00:54 +0530114ifdef CONFIG_SND_SOC_SDM450
115 MACHINE_OBJS += msm8952.o
116endif
117
yang liu0e16b0c2018-08-10 12:09:21 +0800118ifdef CONFIG_SND_SOC_MSM8909
119 MACHINE_INT_OBJS += msm8952.o
120endif
121
Soumya Managoli91b8c3f2018-02-24 18:36:15 +0530122# for SDM450 external codec sound card driver
123ifdef CONFIG_SND_SOC_EXT_CODEC_SDM450
124 MACHINE_EXT_OBJS += msm8952-slimbus.o
125 MACHINE_EXT_OBJS += msm8952-dai-links.o
126endif
127
Sundara Vinayagam43ce7c92018-05-21 16:34:47 +0530128# for MSM8909 sound card driver
129ifdef CONFIG_SND_SOC_BG_8909
130 MACHINE_OBJS += msm_bg.o
131endif
132
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530133ifdef CONFIG_SND_SOC_CPE
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530134 CPE_LSM_OBJS += msm-cpe-lsm.o
135endif
136
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530137ifdef CONFIG_SND_SOC_QDSP6V2
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530138 PLATFORM_OBJS += msm-audio-effects-q6-v2.o
139 PLATFORM_OBJS += msm-compress-q6-v2.o
140 PLATFORM_OBJS += msm-dai-fe.o
141 PLATFORM_OBJS += msm-dai-q6-hdmi-v2.o
142 PLATFORM_OBJS += msm-dai-q6-v2.o
143 PLATFORM_OBJS += msm-dai-slim.o
144 PLATFORM_OBJS += msm-dai-stub-v2.o
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530145 PLATFORM_OBJS += msm-lsm-client.o
146 PLATFORM_OBJS += msm-pcm-afe-v2.o
147 PLATFORM_OBJS += msm-pcm-dtmf-v2.o
148 PLATFORM_OBJS += msm-pcm-hostless.o
149 PLATFORM_OBJS += msm-pcm-host-voice-v2.o
150 PLATFORM_OBJS += msm-pcm-loopback-v2.o
151 PLATFORM_OBJS += msm-pcm-q6-noirq.o
152 PLATFORM_OBJS += msm-pcm-q6-v2.o
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530153 PLATFORM_OBJS += msm-pcm-routing-v2.o
154 PLATFORM_OBJS += msm-pcm-voice-v2.o
155 PLATFORM_OBJS += msm-pcm-voip-v2.o
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530156 PLATFORM_OBJS += msm-transcode-loopback-q6-v2.o
157 PLATFORM_OBJS += platform_init.o
158endif
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530159ifdef CONFIG_DOLBY_DS2
160 PLATFORM_OBJS += msm-ds2-dap-config.o
161endif
162ifdef CONFIG_DOLBY_LICENSE
163 PLATFORM_OBJS += msm-ds2-dap-config.o
164endif
Laxminath Kasam27c8dcf2018-01-03 21:13:17 +0530165ifdef CONFIG_SND_HWDEP_ROUTING
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530166 PLATFORM_OBJS += msm-pcm-routing-devdep.o
167endif
168ifdef CONFIG_QTI_PP
169 PLATFORM_OBJS += msm-qti-pp-config.o
170endif
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530171
172LINUX_INC += -Iinclude/linux
173
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530174INCS += $(COMMON_INC) \
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530175 $(UAPI_INC)
176
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530177EXTRA_CFLAGS += $(INCS)
178
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530179CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \
180 -DANI_LITTLE_BIT_ENDIAN \
181 -DDOT11F_LITTLE_ENDIAN_HOST \
182 -DANI_COMPILER_TYPE_GCC \
183 -DANI_OS_TYPE_ANDROID=6 \
184 -DPTT_SOCK_SVC_ENABLE \
185 -Wall\
186 -Werror\
187 -D__linux__
188
189KBUILD_CPPFLAGS += $(CDEFINES)
190
191# Currently, for versions of gcc which support it, the kernel Makefile
192# is disabling the maybe-uninitialized warning. Re-enable it for the
193# AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it
194# will override the kernel settings.
195ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y)
196EXTRA_CFLAGS += -Wmaybe-uninitialized
197endif
198#EXTRA_CFLAGS += -Wmissing-prototypes
199
200ifeq ($(call cc-option-yn, -Wheader-guard),y)
201EXTRA_CFLAGS += -Wheader-guard
202endif
203
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530204ifeq ($(KERNEL_BUILD), 0)
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530205KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers
206KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers
207KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd934x/Module.symvers
208KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/sdm660_cdc/Module.symvers
209KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/msm_sdw/Module.symvers
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530210endif
211ifeq ($(KERNEL_BUILD), 1)
212 obj-y += codecs/
213endif
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530214# Module information used by KBuild framework
215obj-$(CONFIG_SND_SOC_QDSP6V2) += platform_dlkm.o
216platform_dlkm-y := $(PLATFORM_OBJS)
217
Soumya Managolieaff6622018-02-23 12:00:54 +0530218obj-$(CONFIG_SND_SOC_SDM450) += machine_dlkm.o
219machine_dlkm-y := $(MACHINE_OBJS)
220
yang liu0e16b0c2018-08-10 12:09:21 +0800221obj-$(CONFIG_SND_SOC_MSM8909) += machine_int_dlkm.o
222machine_int_dlkm-y := $(MACHINE_INT_OBJS)
223
Raja Mallikdc60da52018-05-21 16:41:24 +0530224obj-$(CONFIG_SND_SOC_EXT_CODEC_8909) += machine_ext_dlkm.o
225machine_ext_dlkm-y := $(MACHINE_EXT_OBJS)
226
Soumya Managoli91b8c3f2018-02-24 18:36:15 +0530227obj-$(CONFIG_SND_SOC_EXT_CODEC_SDM450) += machine_ext_dlkm.o
228machine_ext_dlkm-y := $(MACHINE_EXT_OBJS)
229
Sundara Vinayagam43ce7c92018-05-21 16:34:47 +0530230obj-$(CONFIG_SND_SOC_BG_8909) += machine_dlkm.o
231machine_dlkm-y := $(MACHINE_OBJS)
232
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530233obj-$(CONFIG_SND_SOC_MACHINE_SDM845) += machine_dlkm.o
234machine_dlkm-y := $(MACHINE_OBJS)
235
236obj-$(CONFIG_SND_SOC_EXT_CODEC) += machine_dlkm.o
237machine_dlkm-y := $(MACHINE_OBJS)
238
239obj-$(CONFIG_SND_SOC_INT_CODEC) += machine_dlkm.o
240machine_dlkm-y := $(MACHINE_OBJS)
241
242obj-$(CONFIG_SND_SOC_CPE) += cpe_lsm_dlkm.o
243cpe_lsm_dlkm-y := $(CPE_LSM_OBJS)
244
245# inject some build related information
246DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\"