blob: 0211013647e7d721b0f956366033fa9a272172b5 [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)
24 include $(AUDIO_ROOT)/config/sdm670auto.conf
25 export
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053026 INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.h
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053027 endif
Laxminath Kasam942d1c62017-12-29 11:02:22 +053028 ifeq ($(CONFIG_ARCH_SDM450), y)
29 include $(AUDIO_ROOT)/config/sdm670auto.conf
30 export
31 INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.h
32 endif
Banajit Goswamif58e5fc2018-04-11 14:10:09 -070033 ifeq ($(CONFIG_ARCH_SM8150), y)
Xiaoyu Ye60c105d2018-04-12 12:43:13 -070034 include $(AUDIO_ROOT)/config/sm8150auto.conf
Meng Wang5fddb8d2018-01-23 16:56:56 +080035 export
Xiaoyu Ye60c105d2018-04-12 12:43:13 -070036 INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h
Meng Wang5fddb8d2018-01-23 16:56:56 +080037 endif
Salendarsingh Gaudad978892018-05-14 16:53:09 +053038 ifeq ($(CONFIG_ARCH_SM6150), y)
Abhishek Arpure6d74b702018-04-05 13:50:25 +053039 include $(AUDIO_ROOT)/config/sm8150auto.conf
40 export
41 INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h
42 endif
Sudheer Papothie3842cf2018-03-31 02:27:42 +053043 ifeq ($(CONFIG_ARCH_SDMSHRIKE), y)
Xiaoyu Ye60c105d2018-04-12 12:43:13 -070044 include $(AUDIO_ROOT)/config/sm8150auto.conf
Sudheer Papothie3842cf2018-03-31 02:27:42 +053045 export
Xiaoyu Ye60c105d2018-04-12 12:43:13 -070046 INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h
Sudheer Papothie3842cf2018-03-31 02:27:42 +053047 endif
Mangesh Kunchamwar0bf1f572018-05-24 19:58:42 +053048 ifeq ($(CONFIG_ARCH_QCS405), y)
49 include $(AUDIO_ROOT)/config/qcs405auto.conf
50 export
51 INCS += -include $(AUDIO_ROOT)/config/qcs405autoconf.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 Ye60c105d2018-04-12 12:43:13 -0700103# for SM8150 sound card driver
104ifdef CONFIG_SND_SOC_SM8150
105 MACHINE_OBJS += sm8150.o
Meng Wang5fddb8d2018-01-23 16:56:56 +0800106endif
107
Mangesh Kunchamwar0bf1f572018-05-24 19:58:42 +0530108# for qcs405 sound card driver
109ifdef CONFIG_SND_SOC_QCS405
110 MACHINE_OBJS += qcs405.o
111endif
112
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530113ifdef CONFIG_SND_SOC_CPE
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530114 CPE_LSM_OBJS += msm-cpe-lsm.o
115endif
116
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530117ifdef CONFIG_SND_SOC_QDSP6V2
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530118 PLATFORM_OBJS += msm-audio-effects-q6-v2.o
119 PLATFORM_OBJS += msm-compress-q6-v2.o
120 PLATFORM_OBJS += msm-dai-fe.o
121 PLATFORM_OBJS += msm-dai-q6-hdmi-v2.o
122 PLATFORM_OBJS += msm-dai-q6-v2.o
123 PLATFORM_OBJS += msm-dai-slim.o
124 PLATFORM_OBJS += msm-dai-stub-v2.o
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530125 PLATFORM_OBJS += msm-lsm-client.o
126 PLATFORM_OBJS += msm-pcm-afe-v2.o
127 PLATFORM_OBJS += msm-pcm-dtmf-v2.o
128 PLATFORM_OBJS += msm-pcm-hostless.o
129 PLATFORM_OBJS += msm-pcm-host-voice-v2.o
130 PLATFORM_OBJS += msm-pcm-loopback-v2.o
131 PLATFORM_OBJS += msm-pcm-q6-noirq.o
132 PLATFORM_OBJS += msm-pcm-q6-v2.o
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530133 PLATFORM_OBJS += msm-pcm-routing-v2.o
134 PLATFORM_OBJS += msm-pcm-voice-v2.o
135 PLATFORM_OBJS += msm-pcm-voip-v2.o
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530136 PLATFORM_OBJS += msm-transcode-loopback-q6-v2.o
137 PLATFORM_OBJS += platform_init.o
138endif
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530139ifdef CONFIG_DOLBY_DS2
140 PLATFORM_OBJS += msm-ds2-dap-config.o
141endif
142ifdef CONFIG_DOLBY_LICENSE
143 PLATFORM_OBJS += msm-ds2-dap-config.o
144endif
Laxminath Kasam9a8caf42018-01-03 21:13:17 +0530145ifdef CONFIG_SND_HWDEP_ROUTING
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530146 PLATFORM_OBJS += msm-pcm-routing-devdep.o
147endif
148ifdef CONFIG_QTI_PP
149 PLATFORM_OBJS += msm-qti-pp-config.o
150endif
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530151
152LINUX_INC += -Iinclude/linux
153
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530154INCS += $(COMMON_INC) \
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530155 $(UAPI_INC)
156
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530157EXTRA_CFLAGS += $(INCS)
158
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530159CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \
160 -DANI_LITTLE_BIT_ENDIAN \
161 -DDOT11F_LITTLE_ENDIAN_HOST \
162 -DANI_COMPILER_TYPE_GCC \
163 -DANI_OS_TYPE_ANDROID=6 \
164 -DPTT_SOCK_SVC_ENABLE \
165 -Wall\
166 -Werror\
167 -D__linux__
168
169KBUILD_CPPFLAGS += $(CDEFINES)
170
171# Currently, for versions of gcc which support it, the kernel Makefile
172# is disabling the maybe-uninitialized warning. Re-enable it for the
173# AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it
174# will override the kernel settings.
175ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y)
176EXTRA_CFLAGS += -Wmaybe-uninitialized
177endif
178#EXTRA_CFLAGS += -Wmissing-prototypes
179
180ifeq ($(call cc-option-yn, -Wheader-guard),y)
181EXTRA_CFLAGS += -Wheader-guard
182endif
183
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530184ifeq ($(KERNEL_BUILD), 0)
Meng Wange61ddb02018-03-07 11:18:35 +0800185KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers
186KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers
187KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd934x/Module.symvers
188KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/sdm660_cdc/Module.symvers
189KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/msm_sdw/Module.symvers
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530190endif
191ifeq ($(KERNEL_BUILD), 1)
192 obj-y += codecs/
193endif
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530194# Module information used by KBuild framework
195obj-$(CONFIG_SND_SOC_QDSP6V2) += platform_dlkm.o
196platform_dlkm-y := $(PLATFORM_OBJS)
197
198obj-$(CONFIG_SND_SOC_MACHINE_SDM845) += machine_dlkm.o
199machine_dlkm-y := $(MACHINE_OBJS)
200
Xiaoyu Ye60c105d2018-04-12 12:43:13 -0700201obj-$(CONFIG_SND_SOC_SM8150) += machine_dlkm.o
Meng Wang5fddb8d2018-01-23 16:56:56 +0800202machine_dlkm-y := $(MACHINE_OBJS)
203
Mangesh Kunchamwar0bf1f572018-05-24 19:58:42 +0530204obj-$(CONFIG_SND_SOC_QCS405) += machine_dlkm.o
205machine_dlkm-y := $(MACHINE_OBJS)
206
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530207obj-$(CONFIG_SND_SOC_EXT_CODEC) += machine_dlkm.o
208machine_dlkm-y := $(MACHINE_OBJS)
209
210obj-$(CONFIG_SND_SOC_INT_CODEC) += machine_dlkm.o
211machine_dlkm-y := $(MACHINE_OBJS)
212
213obj-$(CONFIG_SND_SOC_CPE) += cpe_lsm_dlkm.o
214cpe_lsm_dlkm-y := $(CPE_LSM_OBJS)
215
216# inject some build related information
217DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\"