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