blob: 9e455a99314adaac1d886941e9c52893ef5e0ade [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)
54 include $(AUDIO_ROOT)/config/litoauto.conf
55 export
56 INCS += -include $(AUDIO_ROOT)/config/litoautoconf.h
57 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
Cong Tang1fa4e042018-12-17 19:45:55 +0800138# for sa8155 sound card driver
139ifdef CONFIG_SND_SOC_SA8155
140 MACHINE_OBJS += sa8155.o
141endif
142
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530143ifdef CONFIG_SND_SOC_CPE
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530144 CPE_LSM_OBJS += msm-cpe-lsm.o
145endif
146
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530147ifdef CONFIG_SND_SOC_QDSP6V2
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530148 PLATFORM_OBJS += msm-audio-effects-q6-v2.o
149 PLATFORM_OBJS += msm-compress-q6-v2.o
150 PLATFORM_OBJS += msm-dai-fe.o
151 PLATFORM_OBJS += msm-dai-q6-hdmi-v2.o
152 PLATFORM_OBJS += msm-dai-q6-v2.o
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530153 PLATFORM_OBJS += msm-dai-stub-v2.o
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530154 PLATFORM_OBJS += msm-lsm-client.o
155 PLATFORM_OBJS += msm-pcm-afe-v2.o
156 PLATFORM_OBJS += msm-pcm-dtmf-v2.o
157 PLATFORM_OBJS += msm-pcm-hostless.o
158 PLATFORM_OBJS += msm-pcm-host-voice-v2.o
159 PLATFORM_OBJS += msm-pcm-loopback-v2.o
160 PLATFORM_OBJS += msm-pcm-q6-noirq.o
161 PLATFORM_OBJS += msm-pcm-q6-v2.o
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530162 PLATFORM_OBJS += msm-pcm-routing-v2.o
163 PLATFORM_OBJS += msm-pcm-voice-v2.o
164 PLATFORM_OBJS += msm-pcm-voip-v2.o
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530165 PLATFORM_OBJS += msm-transcode-loopback-q6-v2.o
166 PLATFORM_OBJS += platform_init.o
167endif
Meng Wangb0e04792018-09-27 18:46:44 +0800168ifdef CONFIG_WCD9XXX_CODEC_CORE
169 PLATFORM_OBJS += msm-dai-slim.o
170endif
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530171ifdef CONFIG_DOLBY_DS2
172 PLATFORM_OBJS += msm-ds2-dap-config.o
173endif
174ifdef CONFIG_DOLBY_LICENSE
175 PLATFORM_OBJS += msm-ds2-dap-config.o
176endif
Laxminath Kasam9a8caf42018-01-03 21:13:17 +0530177ifdef CONFIG_SND_HWDEP_ROUTING
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530178 PLATFORM_OBJS += msm-pcm-routing-devdep.o
179endif
180ifdef CONFIG_QTI_PP
181 PLATFORM_OBJS += msm-qti-pp-config.o
182endif
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530183
184LINUX_INC += -Iinclude/linux
185
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530186INCS += $(COMMON_INC) \
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530187 $(UAPI_INC)
188
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530189EXTRA_CFLAGS += $(INCS)
190
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530191CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \
192 -DANI_LITTLE_BIT_ENDIAN \
193 -DDOT11F_LITTLE_ENDIAN_HOST \
194 -DANI_COMPILER_TYPE_GCC \
195 -DANI_OS_TYPE_ANDROID=6 \
196 -DPTT_SOCK_SVC_ENABLE \
197 -Wall\
198 -Werror\
199 -D__linux__
200
201KBUILD_CPPFLAGS += $(CDEFINES)
202
203# Currently, for versions of gcc which support it, the kernel Makefile
204# is disabling the maybe-uninitialized warning. Re-enable it for the
205# AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it
206# will override the kernel settings.
207ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y)
208EXTRA_CFLAGS += -Wmaybe-uninitialized
209endif
210#EXTRA_CFLAGS += -Wmissing-prototypes
211
212ifeq ($(call cc-option-yn, -Wheader-guard),y)
213EXTRA_CFLAGS += -Wheader-guard
214endif
215
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530216ifeq ($(KERNEL_BUILD), 0)
Meng Wange61ddb02018-03-07 11:18:35 +0800217KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers
218KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers
219KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd934x/Module.symvers
Ramprasad Katkam997da402018-08-17 20:20:06 +0530220KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd937x/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
Xiaoyu Ye60c105d2018-04-12 12:43:13 -0700229obj-$(CONFIG_SND_SOC_SM8150) += machine_dlkm.o
Meng Wang5fddb8d2018-01-23 16:56:56 +0800230machine_dlkm-y := $(MACHINE_OBJS)
231
Laxminath Kasam144eabc2018-05-31 10:44:53 +0530232obj-$(CONFIG_SND_SOC_SM6150) += machine_dlkm.o
233machine_dlkm-y := $(MACHINE_OBJS)
234
Rahul Sharmaf53de7f2019-03-03 22:30:47 +0530235obj-$(CONFIG_SND_SOC_SA6155) += machine_dlkm.o
236machine_dlkm-y := $(MACHINE_OBJS)
237
Mangesh Kunchamwar0bf1f572018-05-24 19:58:42 +0530238obj-$(CONFIG_SND_SOC_QCS405) += machine_dlkm.o
239machine_dlkm-y := $(MACHINE_OBJS)
240
Vignesh Kulothungane9abcd02018-10-01 15:55:25 -0700241obj-$(CONFIG_SND_SOC_KONA) += machine_dlkm.o
242machine_dlkm-y := $(MACHINE_OBJS)
243
Vatsal Buchad284ff12019-04-01 15:34:50 +0530244obj-$(CONFIG_SND_SOC_LITO) += machine_dlkm.o
245machine_dlkm-y := $(MACHINE_OBJS)
246
Cong Tang1fa4e042018-12-17 19:45:55 +0800247obj-$(CONFIG_SND_SOC_SA8155) += machine_dlkm.o
248machine_dlkm-y := $(MACHINE_OBJS)
249
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530250obj-$(CONFIG_SND_SOC_CPE) += cpe_lsm_dlkm.o
251cpe_lsm_dlkm-y := $(CPE_LSM_OBJS)
252
253# inject some build related information
254DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\"