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