blob: 25d788170f4c409104d7ccb4fb954b7175c84f9f [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
Meng Wang19fa6de2018-12-20 11:25:47 +080014 AUDIO_BLD_DIR := $(shell pwd)/kernel/msm-4.19
Laxminath Kasama0f84082018-05-31 10:42:50 +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
21 export
22 INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h
23 endif
Hari Veerubhotladcab67c2018-10-14 17:08:35 +053024 ifeq ($(CONFIG_ARCH_TRINKET), y)
25 include $(AUDIO_ROOT)/config/sm6150auto.conf
26 export
27 INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h
28 endif
Meng Wangb0e04792018-09-27 18:46:44 +080029 ifeq ($(CONFIG_ARCH_KONA), y)
30 include $(AUDIO_ROOT)/config/konaauto.conf
31 export
32 INCS += -include $(AUDIO_ROOT)/config/konaautoconf.h
33 endif
Mangesh Kunchamwar0bf1f572018-05-24 19:58:42 +053034 ifeq ($(CONFIG_ARCH_QCS405), y)
35 include $(AUDIO_ROOT)/config/qcs405auto.conf
36 export
37 INCS += -include $(AUDIO_ROOT)/config/qcs405autoconf.h
38 endif
Laxminath Kasama0f84082018-05-31 10:42:50 +053039endif
40
41# As per target team, build is done as follows:
42# Defconfig : build with default flags
43# Slub : defconfig + CONFIG_SLUB_DEBUG := y +
44# CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y
45# Perf : Using appropriate msmXXXX-perf_defconfig
46#
47# Shipment builds (user variants) should not have any debug feature
48# enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds
49# are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since
50# there is no other way to identify defconfig builds, QTI internal
51# representation of perf builds (identified using the string 'perf'),
52# is used to identify if the build is a slub or defconfig one. This
53# way no critical debug feature will be enabled for perf and shipment
54# builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT
55# config.
56
57############ UAPI ############
58UAPI_DIR := uapi
59UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR)
60
61############ COMMON ############
62COMMON_DIR := include
63COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR)
64
65############ BOLERO ############
66
67# for BOLERO Codec
68ifdef CONFIG_SND_SOC_BOLERO
69 BOLERO_OBJS += bolero-cdc.o
70 BOLERO_OBJS += bolero-cdc-utils.o
71 BOLERO_OBJS += bolero-cdc-regmap.o
72 BOLERO_OBJS += bolero-cdc-tables.o
Vidyakumar Athota5d45f4c2019-03-10 22:35:07 -070073 BOLERO_OBJS += bolero-clk-rsc.o
Laxminath Kasama0f84082018-05-31 10:42:50 +053074endif
75
76ifdef CONFIG_WSA_MACRO
77 WSA_OBJS += wsa-macro.o
78endif
79
80ifdef CONFIG_VA_MACRO
81 VA_OBJS += va-macro.o
82endif
83
Laxminath Kasamf8ef43e2018-06-15 16:57:46 +053084ifdef CONFIG_TX_MACRO
85 TX_OBJS += tx-macro.o
86endif
87
88ifdef CONFIG_RX_MACRO
89 RX_OBJS += rx-macro.o
90endif
91
Laxminath Kasama0f84082018-05-31 10:42:50 +053092LINUX_INC += -Iinclude/linux
93
94INCS += $(COMMON_INC) \
95 $(UAPI_INC)
96
97EXTRA_CFLAGS += $(INCS)
98
99
100CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \
101 -DANI_LITTLE_BIT_ENDIAN \
102 -DDOT11F_LITTLE_ENDIAN_HOST \
103 -DANI_COMPILER_TYPE_GCC \
104 -DANI_OS_TYPE_ANDROID=6 \
105 -DPTT_SOCK_SVC_ENABLE \
106 -Wall\
107 -Werror\
108 -D__linux__
109
110KBUILD_CPPFLAGS += $(CDEFINES)
111
112# Currently, for versions of gcc which support it, the kernel Makefile
113# is disabling the maybe-uninitialized warning. Re-enable it for the
114# AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it
115# will override the kernel settings.
116ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y)
117EXTRA_CFLAGS += -Wmaybe-uninitialized
118endif
119#EXTRA_CFLAGS += -Wmissing-prototypes
120
121ifeq ($(call cc-option-yn, -Wheader-guard),y)
122EXTRA_CFLAGS += -Wheader-guard
123endif
124
125ifeq ($(KERNEL_BUILD), 0)
126KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers
127KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers
128KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers
129KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers
130KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers
131endif
132
133# Module information used by KBuild framework
134obj-$(CONFIG_SND_SOC_BOLERO) += bolero_cdc_dlkm.o
135bolero_cdc_dlkm-y := $(BOLERO_OBJS)
136
137obj-$(CONFIG_WSA_MACRO) += wsa_macro_dlkm.o
138wsa_macro_dlkm-y := $(WSA_OBJS)
139
140obj-$(CONFIG_VA_MACRO) += va_macro_dlkm.o
141va_macro_dlkm-y := $(VA_OBJS)
142
Laxminath Kasamf8ef43e2018-06-15 16:57:46 +0530143obj-$(CONFIG_TX_MACRO) += tx_macro_dlkm.o
144tx_macro_dlkm-y := $(TX_OBJS)
145
146obj-$(CONFIG_RX_MACRO) += rx_macro_dlkm.o
147rx_macro_dlkm-y := $(RX_OBJS)
148
Laxminath Kasama0f84082018-05-31 10:42:50 +0530149# inject some build related information
150DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\"