blob: dee3463a24595394a009c4a74413e2ba39443a5f [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
Laxminath Kasamf8ef43e2018-06-15 16:57:46 +053073ifdef CONFIG_TX_MACRO
74 TX_OBJS += tx-macro.o
75endif
76
77ifdef CONFIG_RX_MACRO
78 RX_OBJS += rx-macro.o
79endif
80
Laxminath Kasama0f84082018-05-31 10:42:50 +053081LINUX_INC += -Iinclude/linux
82
83INCS += $(COMMON_INC) \
84 $(UAPI_INC)
85
86EXTRA_CFLAGS += $(INCS)
87
88
89CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \
90 -DANI_LITTLE_BIT_ENDIAN \
91 -DDOT11F_LITTLE_ENDIAN_HOST \
92 -DANI_COMPILER_TYPE_GCC \
93 -DANI_OS_TYPE_ANDROID=6 \
94 -DPTT_SOCK_SVC_ENABLE \
95 -Wall\
96 -Werror\
97 -D__linux__
98
99KBUILD_CPPFLAGS += $(CDEFINES)
100
101# Currently, for versions of gcc which support it, the kernel Makefile
102# is disabling the maybe-uninitialized warning. Re-enable it for the
103# AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it
104# will override the kernel settings.
105ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y)
106EXTRA_CFLAGS += -Wmaybe-uninitialized
107endif
108#EXTRA_CFLAGS += -Wmissing-prototypes
109
110ifeq ($(call cc-option-yn, -Wheader-guard),y)
111EXTRA_CFLAGS += -Wheader-guard
112endif
113
114ifeq ($(KERNEL_BUILD), 0)
115KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers
116KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers
117KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers
118KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers
119KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers
120endif
121
122# Module information used by KBuild framework
123obj-$(CONFIG_SND_SOC_BOLERO) += bolero_cdc_dlkm.o
124bolero_cdc_dlkm-y := $(BOLERO_OBJS)
125
126obj-$(CONFIG_WSA_MACRO) += wsa_macro_dlkm.o
127wsa_macro_dlkm-y := $(WSA_OBJS)
128
129obj-$(CONFIG_VA_MACRO) += va_macro_dlkm.o
130va_macro_dlkm-y := $(VA_OBJS)
131
Laxminath Kasamf8ef43e2018-06-15 16:57:46 +0530132obj-$(CONFIG_TX_MACRO) += tx_macro_dlkm.o
133tx_macro_dlkm-y := $(TX_OBJS)
134
135obj-$(CONFIG_RX_MACRO) += rx_macro_dlkm.o
136rx_macro_dlkm-y := $(RX_OBJS)
137
Laxminath Kasama0f84082018-05-31 10:42:50 +0530138# inject some build related information
139DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\"