blob: 1d2d300e6efb385dbfa7893eb2440c02a740f8f7 [file] [log] [blame]
Mangesh Kunchamwar82f61682018-05-17 18:47:47 +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
10ifeq ($(KERNEL_BUILD), 1)
11 # These are configurable via Kconfig for kernel-based builds
12 # Need to explicitly configure for Android-based builds
Meng Wang19fa6de2018-12-20 11:25:47 +080013 AUDIO_BLD_DIR := $(shell pwd)/kernel/msm-4.19
Mangesh Kunchamwar82f61682018-05-17 18:47:47 +053014 AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio
15endif
16
17ifeq ($(KERNEL_BUILD), 0)
18 ifeq ($(CONFIG_ARCH_QCS405), y)
19 include $(AUDIO_ROOT)/config/qcs405auto.conf
Mangesh Kunchamwar82f61682018-05-17 18:47:47 +053020 INCS += -include $(AUDIO_ROOT)/config/qcs405autoconf.h
21 endif
22endif
23
24# As per target team, build is done as follows:
25# Defconfig : build with default flags
26# Slub : defconfig + CONFIG_SLUB_DEBUG := y +
27# CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y
28# Perf : Using appropriate msmXXXX-perf_defconfig
29#
30# Shipment builds (user variants) should not have any debug feature
31# enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds
32# are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since
33# there is no other way to identify defconfig builds, QTI internal
34# representation of perf builds (identified using the string 'perf'),
35# is used to identify if the build is a slub or defconfig one. This
36# way no critical debug feature will be enabled for perf and shipment
37# builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT
38# config.
39
40############ UAPI ############
41UAPI_DIR := uapi
42UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR)
43
44############ COMMON ############
45COMMON_DIR := include
46COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR)
47
48############ CSRA66X0 ############
49
50# for CSRA66X0 Codec
51ifdef CONFIG_SND_SOC_CSRA66X0
52 CSRA66X0_OBJS += csra66x0.o
53endif
54
55LINUX_INC += -Iinclude/linux
56
57INCS += $(COMMON_INC) \
58 $(UAPI_INC)
59
60#EXTRA_CFLAGS += $(INCS)
61ccflags-y += $(INCS)
62
63
64CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \
65 -DANI_LITTLE_BIT_ENDIAN \
66 -DDOT11F_LITTLE_ENDIAN_HOST \
67 -DANI_COMPILER_TYPE_GCC \
68 -DANI_OS_TYPE_ANDROID=6 \
69 -DPTT_SOCK_SVC_ENABLE \
70 -Wall\
Mangesh Kunchamwar82f61682018-05-17 18:47:47 +053071 -D__linux__
72
73KBUILD_CPPFLAGS += $(CDEFINES)
74
75# Currently, for versions of gcc which support it, the kernel Makefile
76# is disabling the maybe-uninitialized warning. Re-enable it for the
77# AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it
78# will override the kernel settings.
79ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y)
80#EXTRA_CFLAGS += -Wmaybe-uninitialized
81ccflags-y += -Wmaybe-uninitialized
82endif
83#EXTRA_CFLAGS += -Wmissing-prototypes
84
85ifeq ($(call cc-option-yn, -Wheader-guard),y)
86#EXTRA_CFLAGS += -Wheader-guard
87ccflags-y += -Wheader-guard
88endif
89
90ifeq ($(KERNEL_BUILD), 0)
91KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers
92KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers
93KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers
94KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers
95KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers
96endif
97
98# Module information used by KBuild framework
99obj-$(CONFIG_SND_SOC_CSRA66X0) += csra66x0_dlkm.o
100csra66x0_dlkm-y := $(CSRA66X0_OBJS)