blob: 57f561a7e2ffbe37272d9128015e40c1b9706125 [file] [log] [blame]
Laxminath Kasama0f84082018-05-31 10:42:50 +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
14 AUDIO_BLD_DIR := $(ANDROID_BUILD_TOP)/kernel/msm-4.14
15 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
21 export
22 INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h
23 endif
Mangesh Kunchamwar0bf1f572018-05-24 19:58:42 +053024 ifeq ($(CONFIG_ARCH_QCS405), y)
25 include $(AUDIO_ROOT)/config/qcs405auto.conf
26 export
27 INCS += -include $(AUDIO_ROOT)/config/qcs405autoconf.h
28 endif
Laxminath Kasama0f84082018-05-31 10:42:50 +053029endif
30
31# As per target team, build is done as follows:
32# Defconfig : build with default flags
33# Slub : defconfig + CONFIG_SLUB_DEBUG := y +
34# CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y
35# Perf : Using appropriate msmXXXX-perf_defconfig
36#
37# Shipment builds (user variants) should not have any debug feature
38# enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds
39# are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since
40# there is no other way to identify defconfig builds, QTI internal
41# representation of perf builds (identified using the string 'perf'),
42# is used to identify if the build is a slub or defconfig one. This
43# way no critical debug feature will be enabled for perf and shipment
44# builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT
45# config.
46
47############ UAPI ############
48UAPI_DIR := uapi
49UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR)
50
51############ COMMON ############
52COMMON_DIR := include
53COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR)
54
55############ BOLERO ############
56
57# for BOLERO Codec
58ifdef CONFIG_SND_SOC_BOLERO
59 BOLERO_OBJS += bolero-cdc.o
60 BOLERO_OBJS += bolero-cdc-utils.o
61 BOLERO_OBJS += bolero-cdc-regmap.o
62 BOLERO_OBJS += bolero-cdc-tables.o
63endif
64
65ifdef CONFIG_WSA_MACRO
66 WSA_OBJS += wsa-macro.o
67endif
68
69ifdef CONFIG_VA_MACRO
70 VA_OBJS += va-macro.o
71endif
72
73LINUX_INC += -Iinclude/linux
74
75INCS += $(COMMON_INC) \
76 $(UAPI_INC)
77
78EXTRA_CFLAGS += $(INCS)
79
80
81CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \
82 -DANI_LITTLE_BIT_ENDIAN \
83 -DDOT11F_LITTLE_ENDIAN_HOST \
84 -DANI_COMPILER_TYPE_GCC \
85 -DANI_OS_TYPE_ANDROID=6 \
86 -DPTT_SOCK_SVC_ENABLE \
87 -Wall\
88 -Werror\
89 -D__linux__
90
91KBUILD_CPPFLAGS += $(CDEFINES)
92
93# Currently, for versions of gcc which support it, the kernel Makefile
94# is disabling the maybe-uninitialized warning. Re-enable it for the
95# AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it
96# will override the kernel settings.
97ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y)
98EXTRA_CFLAGS += -Wmaybe-uninitialized
99endif
100#EXTRA_CFLAGS += -Wmissing-prototypes
101
102ifeq ($(call cc-option-yn, -Wheader-guard),y)
103EXTRA_CFLAGS += -Wheader-guard
104endif
105
106ifeq ($(KERNEL_BUILD), 0)
107KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers
108KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers
109KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers
110KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers
111KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers
112endif
113
114# Module information used by KBuild framework
115obj-$(CONFIG_SND_SOC_BOLERO) += bolero_cdc_dlkm.o
116bolero_cdc_dlkm-y := $(BOLERO_OBJS)
117
118obj-$(CONFIG_WSA_MACRO) += wsa_macro_dlkm.o
119wsa_macro_dlkm-y := $(WSA_OBJS)
120
121obj-$(CONFIG_VA_MACRO) += va_macro_dlkm.o
122va_macro_dlkm-y := $(VA_OBJS)
123
124# inject some build related information
125DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\"