blob: 87720854379c1f8d1939d8d2c589a8eadec4a6f7 [file] [log] [blame]
Laxminath Kasam8b1366a2017-10-05 01:44:16 +05301# We can build either as part of a standalone Kernel build or as
2# an external module. Determine which mechanism is being used
3KERNEL_BUILD := 0
4
5
6ifeq ($(KERNEL_BUILD), 0)
7 # These are configurable via Kconfig for kernel-based builds
8 # Need to explicitly configure for Android-based builds
9 ifeq ($(CONFIG_ARCH_SDM845), y)
10 include $(AUDIO_ROOT)/config/sdm845auto.conf
11 export
12 endif
13 ifeq ($(CONFIG_ARCH_SDM670), y)
14 include $(AUDIO_ROOT)/config/sdm670auto.conf
15 export
16 endif
17endif
18
19
20# As per target team, build is done as follows:
21# Defconfig : build with default flags
22# Slub : defconfig + CONFIG_SLUB_DEBUG := y +
23# CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y
24# Perf : Using appropriate msmXXXX-perf_defconfig
25#
26# Shipment builds (user variants) should not have any debug feature
27# enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds
28# are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since
29# there is no other way to identify defconfig builds, QTI internal
30# representation of perf builds (identified using the string 'perf'),
31# is used to identify if the build is a slub or defconfig one. This
32# way no critical debug feature will be enabled for perf and shipment
33# builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT
34# config.
35
36############ UAPI ############
37UAPI_DIR := uapi
38UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR)
39
40############ COMMON ############
41COMMON_DIR := include
42COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR)
43
44############ QDSP6V2 ############
45
46ifeq ($(CONFIG_SND_SOC_MSM_QDSP6V2_INTF), m)
47 Q6_OBJS += audio_calibration.o
48 Q6_OBJS += audio_cal_utils.o
49 Q6_OBJS += msm-dts-srs-tm-config.o
50 Q6_OBJS += q6adm.o
51 Q6_OBJS += q6afe.o
52 Q6_OBJS += q6asm.o
53 Q6_OBJS += q6audio-v2.o
54 Q6_OBJS += q6voice.o
55 Q6_OBJS += q6core.o
56 Q6_OBJS += rtac.o
57 Q6_OBJS += q6lsm.o
58 Q6_OBJS += audio_slimslave.o
59 Q6_OBJS += adsp_err.o
60 Q6_OBJS += msm_audio_ion.o
61 Q6_OBJS += avtimer.o
62 Q6_OBJS += q6_init.o
63endif
64ifeq ($(CONFIG_MSM_ADSP_LOADER), m)
65ADSP_LOADER_OBJS += adsp-loader.o
66endif
67
68ifeq ($(CONFIG_MSM_QDSP6_NOTIFIER), m)
69QDSP6_NOTIFIER_OBJS += audio_notifier.o audio_ssr.o
70endif
71
72ifeq ($(CONFIG_MSM_QDSP6_PDR), m)
73QDSP6_PDR_OBJS += audio_pdr.o
74endif
75
76ifeq ($(CONFIG_MSM_ULTRASOUND), m)
77USF_OBJS += usf.o usfcdev.o q6usm.o
78endif
79
80LINUX_INC += -Iinclude/linux
81
82INCS := $(COMMON_INC) \
83 $(UAPI_INC)
84
85ifeq ($(CONFIG_ARCH_SDM845), y)
86INCS += -include $(AUDIO_ROOT)/config/sdm845autoconf.h
87endif
88ifeq ($(CONFIG_ARCH_SDM670), y)
89INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.h
90endif
91
92EXTRA_CFLAGS += $(INCS)
93
94
95CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \
96 -DANI_LITTLE_BIT_ENDIAN \
97 -DDOT11F_LITTLE_ENDIAN_HOST \
98 -DANI_COMPILER_TYPE_GCC \
99 -DANI_OS_TYPE_ANDROID=6 \
100 -DPTT_SOCK_SVC_ENABLE \
101 -Wall\
102 -Werror\
103 -D__linux__
104
105KBUILD_CPPFLAGS += $(CDEFINES)
106
107# Currently, for versions of gcc which support it, the kernel Makefile
108# is disabling the maybe-uninitialized warning. Re-enable it for the
109# AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it
110# will override the kernel settings.
111ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y)
112EXTRA_CFLAGS += -Wmaybe-uninitialized
113endif
114#EXTRA_CFLAGS += -Wmissing-prototypes
115
116ifeq ($(call cc-option-yn, -Wheader-guard),y)
117EXTRA_CFLAGS += -Wheader-guard
118endif
119
120# If the module name is not "wlan", then the define MULTI_IF_NAME to be the
121# same a the QCA CHIP name. The host driver will then append MULTI_IF_NAME to
122# any string that must be unique for all instances of the driver on the system.
123# This allows multiple instances of the driver with different module names.
124# If the module name is wlan, leave MULTI_IF_NAME undefined and the code will
125# treat the driver as the primary driver.
126ifneq ($(MODNAME), qdsp6v2)
127CHIP_NAME ?= $(MODNAME)
128CDEFINES += -DMULTI_IF_NAME=\"$(CHIP_NAME)\"
129endif
130
131KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers
132
133obj-$(CONFIG_SND_SOC_MSM_QDSP6V2_INTF) += q6_dlkm.o
134q6_dlkm-y := $(Q6_OBJS)
135
136obj-$(CONFIG_MSM_ULTRASOUND) += usf_dlkm.o
137usf_dlkm-y := $(USF_OBJS)
138
139obj-$(CONFIG_MSM_ADSP_LOADER) += adsp_loader_dlkm.o
140adsp_loader_dlkm-y := $(ADSP_LOADER_OBJS)
141
142obj-$(CONFIG_MSM_QDSP6_NOTIFIER) += q6_notifier_dlkm.o
143q6_notifier_dlkm-y := $(QDSP6_NOTIFIER_OBJS)
144
145obj-$(CONFIG_MSM_QDSP6_PDR) += q6_pdr_dlkm.o
146q6_pdr_dlkm-y := $(QDSP6_PDR_OBJS)
147
148# inject some build related information
149DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\"