blob: a062f2ad8228cb4fd0f007d391bb7f081b13a707 [file] [log] [blame]
Rohit kumar759426e2018-05-14 18:21:52 +05301# We can build either as part of a standalone Kernel build or as
2# an external module. Determine which mechanism is being used
3ifeq ($(MODNAME),)
4 KERNEL_BUILD := 1
5else
6 KERNEL_BUILD := 0
7endif
8
9
10
11ifeq ($(KERNEL_BUILD), 1)
12 # These are configurable via Kconfig for kernel-based builds
13 # Need to explicitly configure for Android-based builds
Meng Wang19fa6de2018-12-20 11:25:47 +080014 AUDIO_BLD_DIR := $(ANDROID_BUILD_TOP)/kernel/msm-4.19
Rohit kumar759426e2018-05-14 18:21:52 +053015 AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio
16endif
17
18ifeq ($(KERNEL_BUILD), 0)
19 ifeq ($(CONFIG_ARCH_SM6150), y)
20 include $(AUDIO_ROOT)/config/sm6150auto.conf
Rohit kumar759426e2018-05-14 18:21:52 +053021 INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h
22 endif
Hari Veerubhotladcab67c2018-10-14 17:08:35 +053023 ifeq ($(CONFIG_ARCH_TRINKET), y)
24 include $(AUDIO_ROOT)/config/sm6150auto.conf
Hari Veerubhotladcab67c2018-10-14 17:08:35 +053025 INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h
26 endif
Laxminath Kasam00f60ba2019-10-04 09:37:07 +053027 ifeq ($(CONFIG_ARCH_BENGAL), y)
28 include $(AUDIO_ROOT)/config/bengalauto.conf
Laxminath Kasam00f60ba2019-10-04 09:37:07 +053029 INCS += -include $(AUDIO_ROOT)/config/bengalautoconf.h
30 endif
Kunlei Zhang745cbbb2020-02-10 19:43:30 +080031 ifeq ($(CONFIG_ARCH_LITO), y)
32 include $(AUDIO_ROOT)/config/litoauto.conf
Kunlei Zhang745cbbb2020-02-10 19:43:30 +080033 INCS += -include $(AUDIO_ROOT)/config/litoautoconf.h
34 endif
Rohit kumar759426e2018-05-14 18:21:52 +053035endif
36
37# As per target team, build is done as follows:
38# Defconfig : build with default flags
39# Slub : defconfig + CONFIG_SLUB_DEBUG := y +
40# CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y
41# Perf : Using appropriate msmXXXX-perf_defconfig
42#
43# Shipment builds (user variants) should not have any debug feature
44# enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds
45# are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since
46# there is no other way to identify defconfig builds, QTI internal
47# representation of perf builds (identified using the string 'perf'),
48# is used to identify if the build is a slub or defconfig one. This
49# way no critical debug feature will be enabled for perf and shipment
50# builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT
51# config.
52
53############ UAPI ############
54UAPI_DIR := uapi
55UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR)
56
57############ COMMON ############
58COMMON_DIR := include
59COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR)
60
61############ WCD937X ############
62
63# for WCD937X Codec
64ifdef CONFIG_SND_SOC_WCD937X
65 WCD937X_OBJS += wcd937x.o
Tanya Dixit9b37ac92018-07-27 16:52:47 +053066 WCD937X_OBJS += wcd937x-regmap.o
67 WCD937X_OBJS += wcd937x-tables.o
Vatsal Bucha92fad902018-07-30 20:17:41 +053068 WCD937X_OBJS += wcd937x-mbhc.o
Rohit kumar759426e2018-05-14 18:21:52 +053069endif
70
71ifdef CONFIG_SND_SOC_WCD937X_SLAVE
72 WCD937X_SLAVE_OBJS += wcd937x_slave.o
73endif
74
75LINUX_INC += -Iinclude/linux
76
77INCS += $(COMMON_INC) \
78 $(UAPI_INC)
79
80EXTRA_CFLAGS += $(INCS)
81
82
83CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \
84 -DANI_LITTLE_BIT_ENDIAN \
85 -DDOT11F_LITTLE_ENDIAN_HOST \
86 -DANI_COMPILER_TYPE_GCC \
87 -DANI_OS_TYPE_ANDROID=6 \
88 -DPTT_SOCK_SVC_ENABLE \
89 -Wall\
Rohit kumar759426e2018-05-14 18:21:52 +053090 -D__linux__
91
92KBUILD_CPPFLAGS += $(CDEFINES)
93
94# Currently, for versions of gcc which support it, the kernel Makefile
95# is disabling the maybe-uninitialized warning. Re-enable it for the
96# AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it
97# will override the kernel settings.
98ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y)
99EXTRA_CFLAGS += -Wmaybe-uninitialized
100endif
101#EXTRA_CFLAGS += -Wmissing-prototypes
102
103ifeq ($(call cc-option-yn, -Wheader-guard),y)
104EXTRA_CFLAGS += -Wheader-guard
105endif
106
107ifeq ($(KERNEL_BUILD), 0)
108KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers
109KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers
110KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers
111KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers
112KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers
113endif
114
115# Module information used by KBuild framework
116obj-$(CONFIG_SND_SOC_WCD937X) += wcd937x_dlkm.o
117wcd937x_dlkm-y := $(WCD937X_OBJS)
118
119obj-$(CONFIG_SND_SOC_WCD937X_SLAVE) += wcd937x_slave_dlkm.o
120wcd937x_slave_dlkm-y := $(WCD937X_SLAVE_OBJS)