blob: 6bc854c8478731b26508f871d43939db8f349191 [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
3KERNEL_BUILD := 0
4
5
6ifeq ($(KERNEL_BUILD), 0)
7 # These are configurable via Kconfig for kernel-based builds
8 # Need to explicitly configure for Android-based builds
9 ifeq ($(CONFIG_ARCH_SDM845), y)
10 include $(AUDIO_ROOT)/config/sdm845auto.conf
11 export
12 endif
13 ifeq ($(CONFIG_ARCH_SDM670), y)
14 include $(AUDIO_ROOT)/config/sdm670auto.conf
15 export
16 endif
17endif
18
19
20# As per target team, build is done as follows:
21# Defconfig : build with default flags
22# Slub : defconfig + CONFIG_SLUB_DEBUG := y +
23# CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y
24# Perf : Using appropriate msmXXXX-perf_defconfig
25#
26# Shipment builds (user variants) should not have any debug feature
27# enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds
28# are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since
29# there is no other way to identify defconfig builds, QTI internal
30# representation of perf builds (identified using the string 'perf'),
31# is used to identify if the build is a slub or defconfig one. This
32# way no critical debug feature will be enabled for perf and shipment
33# builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT
34# config.
35
36############ UAPI ############
37UAPI_DIR := uapi
38UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR)
39
40############ COMMON ############
41COMMON_DIR := include
42COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR)
43
44############ WCD934X ############
45
46# for WCD934X Codec
47ifeq ($(CONFIG_SND_SOC_WCD934X), m)
48 WCD934X_OBJS += wcd934x.o
49 WCD934X_OBJS += wcd934x-dsp-cntl.o
50 WCD934X_OBJS += wcd934x-mbhc.o
51 WCD934X_OBJS += wcd934x-dsd.o
52endif
53
54LINUX_INC += -Iinclude/linux
55
56INCS := $(COMMON_INC) \
57 $(UAPI_INC)
58
59ifeq ($(CONFIG_ARCH_SDM845), y)
60INCS += -include $(AUDIO_ROOT)/config/sdm845autoconf.h
61endif
62ifeq ($(CONFIG_ARCH_SDM670), y)
63INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.h
64endif
65
66EXTRA_CFLAGS += $(INCS)
67
68
69CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \
70 -DANI_LITTLE_BIT_ENDIAN \
71 -DDOT11F_LITTLE_ENDIAN_HOST \
72 -DANI_COMPILER_TYPE_GCC \
73 -DANI_OS_TYPE_ANDROID=6 \
74 -DPTT_SOCK_SVC_ENABLE \
75 -Wall\
76 -Werror\
77 -D__linux__
78
79KBUILD_CPPFLAGS += $(CDEFINES)
80
81# Currently, for versions of gcc which support it, the kernel Makefile
82# is disabling the maybe-uninitialized warning. Re-enable it for the
83# AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it
84# will override the kernel settings.
85ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y)
86EXTRA_CFLAGS += -Wmaybe-uninitialized
87endif
88#EXTRA_CFLAGS += -Wmissing-prototypes
89
90ifeq ($(call cc-option-yn, -Wheader-guard),y)
91EXTRA_CFLAGS += -Wheader-guard
92endif
93
94
95KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers
96KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers
97KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers
98KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers
99KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers
100# Module information used by KBuild framework
101obj-$(CONFIG_SND_SOC_WCD934X) += wcd934x_dlkm.o
102wcd934x_dlkm-y := $(WCD934X_OBJS)
103
104# inject some build related information
105DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\"