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