blob: 137fd60f8841eefc07c1492f38e7227071095af8 [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
Asish Bhattacharya5faacb32017-12-04 17:23:15 +05309ifeq ($(KERNEL_BUILD), 1)
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053010 # These are configurable via Kconfig for kernel-based builds
11 # Need to explicitly configure for Android-based builds
Meng Wang19fa6de2018-12-20 11:25:47 +080012 AUDIO_BLD_DIR := $(shell pwd)/kernel/msm-4.19
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053013 AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio
14endif
15
16ifeq ($(KERNEL_BUILD), 0)
Banajit Goswamif58e5fc2018-04-11 14:10:09 -070017 ifeq ($(CONFIG_ARCH_SM8150), y)
Cong Tang1fa4e042018-12-17 19:45:55 +080018 ifdef CONFIG_SND_SOC_SA8155
19 include $(AUDIO_ROOT)/config/sa8155auto.conf
20 export
21 INCS += -include $(AUDIO_ROOT)/config/sa8155autoconf.h
22 else
23 include $(AUDIO_ROOT)/config/sm8150auto.conf
24 export
25 INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h
26 endif
Meng Wang5fddb8d2018-01-23 16:56:56 +080027 endif
Salendarsingh Gaudad978892018-05-14 16:53:09 +053028 ifeq ($(CONFIG_ARCH_SM6150), y)
Rahul Sharmaf53de7f2019-03-03 22:30:47 +053029 ifdef CONFIG_SND_SOC_SA6155
30 include $(AUDIO_ROOT)/config/sa6155auto.conf
31 export
32 INCS += -include $(AUDIO_ROOT)/config/sa6155autoconf.h
33 else
34 include $(AUDIO_ROOT)/config/sm6150auto.conf
35 export
36 INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h
37 endif
Abhishek Arpure6d74b702018-04-05 13:50:25 +053038 endif
Hari Veerubhotladcab67c2018-10-14 17:08:35 +053039 ifeq ($(CONFIG_ARCH_TRINKET), y)
40 include $(AUDIO_ROOT)/config/sm6150auto.conf
41 export
42 INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h
43 endif
Meng Wangb0e04792018-09-27 18:46:44 +080044 ifeq ($(CONFIG_ARCH_KONA), y)
45 include $(AUDIO_ROOT)/config/konaauto.conf
Meng Wangb0e04792018-09-27 18:46:44 +080046 INCS += -include $(AUDIO_ROOT)/config/konaautoconf.h
47 endif
Vatsal Buchad284ff12019-04-01 15:34:50 +053048 ifeq ($(CONFIG_ARCH_LITO), y)
49 include $(AUDIO_ROOT)/config/litoauto.conf
50 export
51 INCS += -include $(AUDIO_ROOT)/config/litoautoconf.h
52 endif
Laxminath Kasamfdda2d82019-07-31 21:26:30 +053053 ifeq ($(CONFIG_ARCH_BENGAL), y)
Laxminath Kasam00f60ba2019-10-04 09:37:07 +053054 include $(AUDIO_ROOT)/config/bengalauto.conf
Laxminath Kasamfdda2d82019-07-31 21:26:30 +053055 export
Laxminath Kasam00f60ba2019-10-04 09:37:07 +053056 INCS += -include $(AUDIO_ROOT)/config/bengalautoconf.h
Laxminath Kasamfdda2d82019-07-31 21:26:30 +053057 endif
Sudheer Papothie3842cf2018-03-31 02:27:42 +053058 ifeq ($(CONFIG_ARCH_SDMSHRIKE), y)
Derek Chen583e3bf2019-04-15 18:01:45 -070059 ifdef CONFIG_SND_SOC_SA8155
60 include $(AUDIO_ROOT)/config/sa8155auto.conf
61 export
62 INCS += -include $(AUDIO_ROOT)/config/sa8155autoconf.h
63 else
64 include $(AUDIO_ROOT)/config/sm8150auto.conf
65 export
66 INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h
67 endif
Sudheer Papothie3842cf2018-03-31 02:27:42 +053068 endif
Mangesh Kunchamwar0bf1f572018-05-24 19:58:42 +053069 ifeq ($(CONFIG_ARCH_QCS405), y)
70 include $(AUDIO_ROOT)/config/qcs405auto.conf
71 export
72 INCS += -include $(AUDIO_ROOT)/config/qcs405autoconf.h
73 endif
Timothy Sham4a6979f2019-02-19 12:36:06 -050074 ifeq ($(CONFIG_QTI_GVM), y)
75 include $(AUDIO_ROOT)/config/gvmauto.conf
76 export
77 INCS += -include $(AUDIO_ROOT)/config/gvmautoconf.h
78 endif
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053079endif
80
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053081# As per target team, build is done as follows:
82# Defconfig : build with default flags
83# Slub : defconfig + CONFIG_SLUB_DEBUG := y +
84# CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y
85# Perf : Using appropriate msmXXXX-perf_defconfig
86#
87# Shipment builds (user variants) should not have any debug feature
88# enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds
89# are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since
90# there is no other way to identify defconfig builds, QTI internal
91# representation of perf builds (identified using the string 'perf'),
92# is used to identify if the build is a slub or defconfig one. This
93# way no critical debug feature will be enabled for perf and shipment
94# builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT
95# config.
96
97############ UAPI ############
98UAPI_DIR := uapi
99UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR)
100
101############ COMMON ############
102COMMON_DIR := include
103COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR)
104
105############ ASoC Drivers ############
106
Xiaoyu Ye60c105d2018-04-12 12:43:13 -0700107# for SM8150 sound card driver
108ifdef CONFIG_SND_SOC_SM8150
109 MACHINE_OBJS += sm8150.o
Derek Chen39955472018-06-26 21:52:59 -0400110 MACHINE_OBJS += machine_815x_init.o
Meng Wang5fddb8d2018-01-23 16:56:56 +0800111endif
112
Laxminath Kasam144eabc2018-05-31 10:44:53 +0530113# for SM6150 sound card driver
114ifdef CONFIG_SND_SOC_SM6150
115 MACHINE_OBJS += sm6150.o
Rahul Sharmaa070ce52018-11-19 15:45:27 +0530116 MACHINE_OBJS += machine_615x_init.o
Laxminath Kasam144eabc2018-05-31 10:44:53 +0530117endif
118
Rahul Sharmaf53de7f2019-03-03 22:30:47 +0530119# For sa6155 sound card driver
120ifdef CONFIG_SND_SOC_SA6155
121 MACHINE_OBJS += sa6155.o
122endif
123
Mangesh Kunchamwar0bf1f572018-05-24 19:58:42 +0530124# for qcs405 sound card driver
125ifdef CONFIG_SND_SOC_QCS405
126 MACHINE_OBJS += qcs405.o
127endif
128
Vignesh Kulothungane9abcd02018-10-01 15:55:25 -0700129# for KONA sound card driver
130ifdef CONFIG_SND_SOC_KONA
131 MACHINE_OBJS += kona.o
132endif
133
Vatsal Buchad284ff12019-04-01 15:34:50 +0530134ifdef CONFIG_SND_SOC_LITO
135 MACHINE_OBJS += kona.o
136endif
137
Laxminath Kasam00f60ba2019-10-04 09:37:07 +0530138# for BENGAL sound card driver
139ifdef CONFIG_SND_SOC_BENGAL
140 MACHINE_OBJS += bengal.o
141endif
142
Cong Tang1fa4e042018-12-17 19:45:55 +0800143# for sa8155 sound card driver
144ifdef CONFIG_SND_SOC_SA8155
145 MACHINE_OBJS += sa8155.o
146endif
147
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530148ifdef CONFIG_SND_SOC_CPE
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530149 CPE_LSM_OBJS += msm-cpe-lsm.o
150endif
151
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530152ifdef CONFIG_SND_SOC_QDSP6V2
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530153 PLATFORM_OBJS += msm-audio-effects-q6-v2.o
154 PLATFORM_OBJS += msm-compress-q6-v2.o
155 PLATFORM_OBJS += msm-dai-fe.o
156 PLATFORM_OBJS += msm-dai-q6-hdmi-v2.o
157 PLATFORM_OBJS += msm-dai-q6-v2.o
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530158 PLATFORM_OBJS += msm-dai-stub-v2.o
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530159 PLATFORM_OBJS += msm-lsm-client.o
160 PLATFORM_OBJS += msm-pcm-afe-v2.o
161 PLATFORM_OBJS += msm-pcm-dtmf-v2.o
162 PLATFORM_OBJS += msm-pcm-hostless.o
163 PLATFORM_OBJS += msm-pcm-host-voice-v2.o
164 PLATFORM_OBJS += msm-pcm-loopback-v2.o
165 PLATFORM_OBJS += msm-pcm-q6-noirq.o
166 PLATFORM_OBJS += msm-pcm-q6-v2.o
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530167 PLATFORM_OBJS += msm-pcm-routing-v2.o
168 PLATFORM_OBJS += msm-pcm-voice-v2.o
169 PLATFORM_OBJS += msm-pcm-voip-v2.o
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530170 PLATFORM_OBJS += msm-transcode-loopback-q6-v2.o
171 PLATFORM_OBJS += platform_init.o
172endif
Meng Wangb0e04792018-09-27 18:46:44 +0800173ifdef CONFIG_WCD9XXX_CODEC_CORE
174 PLATFORM_OBJS += msm-dai-slim.o
175endif
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530176ifdef CONFIG_DOLBY_DS2
177 PLATFORM_OBJS += msm-ds2-dap-config.o
178endif
179ifdef CONFIG_DOLBY_LICENSE
180 PLATFORM_OBJS += msm-ds2-dap-config.o
181endif
Laxminath Kasam9a8caf42018-01-03 21:13:17 +0530182ifdef CONFIG_SND_HWDEP_ROUTING
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530183 PLATFORM_OBJS += msm-pcm-routing-devdep.o
184endif
185ifdef CONFIG_QTI_PP
186 PLATFORM_OBJS += msm-qti-pp-config.o
187endif
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530188
189LINUX_INC += -Iinclude/linux
190
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530191INCS += $(COMMON_INC) \
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530192 $(UAPI_INC)
193
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530194EXTRA_CFLAGS += $(INCS)
195
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530196CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \
197 -DANI_LITTLE_BIT_ENDIAN \
198 -DDOT11F_LITTLE_ENDIAN_HOST \
199 -DANI_COMPILER_TYPE_GCC \
200 -DANI_OS_TYPE_ANDROID=6 \
201 -DPTT_SOCK_SVC_ENABLE \
202 -Wall\
203 -Werror\
204 -D__linux__
205
206KBUILD_CPPFLAGS += $(CDEFINES)
207
208# Currently, for versions of gcc which support it, the kernel Makefile
209# is disabling the maybe-uninitialized warning. Re-enable it for the
210# AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it
211# will override the kernel settings.
212ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y)
213EXTRA_CFLAGS += -Wmaybe-uninitialized
214endif
215#EXTRA_CFLAGS += -Wmissing-prototypes
216
217ifeq ($(call cc-option-yn, -Wheader-guard),y)
218EXTRA_CFLAGS += -Wheader-guard
219endif
220
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530221ifeq ($(KERNEL_BUILD), 0)
Meng Wange61ddb02018-03-07 11:18:35 +0800222KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers
223KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers
224KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd934x/Module.symvers
Ramprasad Katkam997da402018-08-17 20:20:06 +0530225KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd937x/Module.symvers
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530226endif
227ifeq ($(KERNEL_BUILD), 1)
228 obj-y += codecs/
229endif
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530230# Module information used by KBuild framework
231obj-$(CONFIG_SND_SOC_QDSP6V2) += platform_dlkm.o
232platform_dlkm-y := $(PLATFORM_OBJS)
233
Xiaoyu Ye60c105d2018-04-12 12:43:13 -0700234obj-$(CONFIG_SND_SOC_SM8150) += machine_dlkm.o
Meng Wang5fddb8d2018-01-23 16:56:56 +0800235machine_dlkm-y := $(MACHINE_OBJS)
236
Laxminath Kasam144eabc2018-05-31 10:44:53 +0530237obj-$(CONFIG_SND_SOC_SM6150) += machine_dlkm.o
238machine_dlkm-y := $(MACHINE_OBJS)
239
Rahul Sharmaf53de7f2019-03-03 22:30:47 +0530240obj-$(CONFIG_SND_SOC_SA6155) += machine_dlkm.o
241machine_dlkm-y := $(MACHINE_OBJS)
242
Mangesh Kunchamwar0bf1f572018-05-24 19:58:42 +0530243obj-$(CONFIG_SND_SOC_QCS405) += machine_dlkm.o
244machine_dlkm-y := $(MACHINE_OBJS)
245
Vignesh Kulothungane9abcd02018-10-01 15:55:25 -0700246obj-$(CONFIG_SND_SOC_KONA) += machine_dlkm.o
247machine_dlkm-y := $(MACHINE_OBJS)
248
Vatsal Buchad284ff12019-04-01 15:34:50 +0530249obj-$(CONFIG_SND_SOC_LITO) += machine_dlkm.o
250machine_dlkm-y := $(MACHINE_OBJS)
251
Laxminath Kasam00f60ba2019-10-04 09:37:07 +0530252obj-$(CONFIG_SND_SOC_BENGAL) += machine_dlkm.o
253machine_dlkm-y := $(MACHINE_OBJS)
254
Cong Tang1fa4e042018-12-17 19:45:55 +0800255obj-$(CONFIG_SND_SOC_SA8155) += machine_dlkm.o
256machine_dlkm-y := $(MACHINE_OBJS)
257
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530258obj-$(CONFIG_SND_SOC_CPE) += cpe_lsm_dlkm.o
259cpe_lsm_dlkm-y := $(CPE_LSM_OBJS)
260
261# inject some build related information
262DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\"