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