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