blob: 91ebf8a0e0ad1ad5069e688699960511543daf2e [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
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053033endif
34
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053035# As per target team, build is done as follows:
36# Defconfig : build with default flags
37# Slub : defconfig + CONFIG_SLUB_DEBUG := y +
38# CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y
39# Perf : Using appropriate msmXXXX-perf_defconfig
40#
41# Shipment builds (user variants) should not have any debug feature
42# enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds
43# are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since
44# there is no other way to identify defconfig builds, QTI internal
45# representation of perf builds (identified using the string 'perf'),
46# is used to identify if the build is a slub or defconfig one. This
47# way no critical debug feature will be enabled for perf and shipment
48# builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT
49# config.
50
51############ UAPI ############
52UAPI_DIR := uapi
53UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR)
54
55############ COMMON ############
56COMMON_DIR := include
57COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR)
58
59############ ASoC Drivers ############
60
61
62# for SDM6xx sound card driver
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053063ifdef CONFIG_SND_SOC_SDM670
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053064 MACHINE_OBJS += sdm660-common.o
65endif
66
67# for SDM6xx sound card driver
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053068ifdef CONFIG_SND_SOC_INT_CODEC
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053069 MACHINE_OBJS += sdm660-internal.o
70endif
71
72# for SDM6xx sound card driver
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053073ifdef CONFIG_SND_SOC_EXT_CODEC
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053074 MACHINE_OBJS += sdm660-external.o
75 MACHINE_OBJS += sdm660-ext-dai-links.o
76endif
77
78# for SDM845 sound card driver
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053079ifdef CONFIG_SND_SOC_MACHINE_SDM845
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053080 MACHINE_OBJS += sdm845.o
81endif
82
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053083ifdef CONFIG_SND_SOC_CPE
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053084 CPE_LSM_OBJS += msm-cpe-lsm.o
85endif
86
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053087ifdef CONFIG_SND_SOC_QDSP6V2
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053088 PLATFORM_OBJS += msm-audio-effects-q6-v2.o
89 PLATFORM_OBJS += msm-compress-q6-v2.o
90 PLATFORM_OBJS += msm-dai-fe.o
91 PLATFORM_OBJS += msm-dai-q6-hdmi-v2.o
92 PLATFORM_OBJS += msm-dai-q6-v2.o
93 PLATFORM_OBJS += msm-dai-slim.o
94 PLATFORM_OBJS += msm-dai-stub-v2.o
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053095 PLATFORM_OBJS += msm-lsm-client.o
96 PLATFORM_OBJS += msm-pcm-afe-v2.o
97 PLATFORM_OBJS += msm-pcm-dtmf-v2.o
98 PLATFORM_OBJS += msm-pcm-hostless.o
99 PLATFORM_OBJS += msm-pcm-host-voice-v2.o
100 PLATFORM_OBJS += msm-pcm-loopback-v2.o
101 PLATFORM_OBJS += msm-pcm-q6-noirq.o
102 PLATFORM_OBJS += msm-pcm-q6-v2.o
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530103 PLATFORM_OBJS += msm-pcm-routing-v2.o
104 PLATFORM_OBJS += msm-pcm-voice-v2.o
105 PLATFORM_OBJS += msm-pcm-voip-v2.o
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530106 PLATFORM_OBJS += msm-transcode-loopback-q6-v2.o
107 PLATFORM_OBJS += platform_init.o
108endif
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530109ifdef CONFIG_DOLBY_DS2
110 PLATFORM_OBJS += msm-ds2-dap-config.o
111endif
112ifdef CONFIG_DOLBY_LICENSE
113 PLATFORM_OBJS += msm-ds2-dap-config.o
114endif
115ifdef CONFIG_SND_HWDEP
116 PLATFORM_OBJS += msm-pcm-routing-devdep.o
117endif
118ifdef CONFIG_QTI_PP
119 PLATFORM_OBJS += msm-qti-pp-config.o
120endif
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530121
122LINUX_INC += -Iinclude/linux
123
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530124INCS += $(COMMON_INC) \
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530125 $(UAPI_INC)
126
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530127EXTRA_CFLAGS += $(INCS)
128
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530129CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \
130 -DANI_LITTLE_BIT_ENDIAN \
131 -DDOT11F_LITTLE_ENDIAN_HOST \
132 -DANI_COMPILER_TYPE_GCC \
133 -DANI_OS_TYPE_ANDROID=6 \
134 -DPTT_SOCK_SVC_ENABLE \
135 -Wall\
136 -Werror\
137 -D__linux__
138
139KBUILD_CPPFLAGS += $(CDEFINES)
140
141# Currently, for versions of gcc which support it, the kernel Makefile
142# is disabling the maybe-uninitialized warning. Re-enable it for the
143# AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it
144# will override the kernel settings.
145ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y)
146EXTRA_CFLAGS += -Wmaybe-uninitialized
147endif
148#EXTRA_CFLAGS += -Wmissing-prototypes
149
150ifeq ($(call cc-option-yn, -Wheader-guard),y)
151EXTRA_CFLAGS += -Wheader-guard
152endif
153
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530154ifeq ($(KERNEL_BUILD), 0)
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530155KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers
156KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers
157KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd934x/Module.symvers
158KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/sdm660_cdc/Module.symvers
159KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/msm_sdw/Module.symvers
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530160endif
161ifeq ($(KERNEL_BUILD), 1)
162 obj-y += codecs/
163endif
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530164# Module information used by KBuild framework
165obj-$(CONFIG_SND_SOC_QDSP6V2) += platform_dlkm.o
166platform_dlkm-y := $(PLATFORM_OBJS)
167
168obj-$(CONFIG_SND_SOC_MACHINE_SDM845) += machine_dlkm.o
169machine_dlkm-y := $(MACHINE_OBJS)
170
171obj-$(CONFIG_SND_SOC_EXT_CODEC) += machine_dlkm.o
172machine_dlkm-y := $(MACHINE_OBJS)
173
174obj-$(CONFIG_SND_SOC_INT_CODEC) += machine_dlkm.o
175machine_dlkm-y := $(MACHINE_OBJS)
176
177obj-$(CONFIG_SND_SOC_CPE) += cpe_lsm_dlkm.o
178cpe_lsm_dlkm-y := $(CPE_LSM_OBJS)
179
180# inject some build related information
181DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\"