blob: 5c2a8b33c20691e2bb87a7023ec901b7b0340e4e [file] [log] [blame]
Sudheer Papothi085a6542018-01-25 23:38:29 +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
9ifeq ($(KERNEL_BUILD), 1)
10 # These are configurable via Kconfig for kernel-based builds
11 # Need to explicitly configure for Android-based builds
Meng Wang19fa6de2018-12-20 11:25:47 +080012 AUDIO_BLD_DIR := $(shell pwd)/kernel/msm-4.19
Sudheer Papothi085a6542018-01-25 23:38:29 +053013 AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio
14endif
15
16ifeq ($(KERNEL_BUILD), 0)
17 # These are configurable via Kconfig for kernel-based builds
18 # Need to explicitly configure for Android-based builds
19
20 ifeq ($(CONFIG_ARCH_SDM670), y)
21 include $(AUDIO_ROOT)/config/sdm670auto.conf
Sudheer Papothi085a6542018-01-25 23:38:29 +053022 INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.h
23 endif
24
Banajit Goswamif58e5fc2018-04-11 14:10:09 -070025 ifeq ($(CONFIG_ARCH_SM8150), y)
Xiaoyu Ye60c105d2018-04-12 12:43:13 -070026 include $(AUDIO_ROOT)/config/sm8150auto.conf
Xiaoyu Ye60c105d2018-04-12 12:43:13 -070027 INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h
Sudheer Papothi085a6542018-01-25 23:38:29 +053028 endif
Sudheer Papothie3842cf2018-03-31 02:27:42 +053029
30 ifeq ($(CONFIG_ARCH_SDMSHRIKE), y)
Xiaoyu Ye60c105d2018-04-12 12:43:13 -070031 include $(AUDIO_ROOT)/config/sm8150auto.conf
Xiaoyu Ye60c105d2018-04-12 12:43:13 -070032 INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h
Sudheer Papothie3842cf2018-03-31 02:27:42 +053033 endif
Sudheer Papothi085a6542018-01-25 23:38:29 +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# for AQT1000 Codec
61ifeq ($(CONFIG_SND_SOC_AQT1000), m)
62 AQT1000_CDC_OBJS += aqt1000-regmap.o
63 AQT1000_CDC_OBJS += aqt1000-utils.o
64 AQT1000_CDC_OBJS += aqt1000-core.o
65 AQT1000_CDC_OBJS += aqt1000-irq.o
66 AQT1000_CDC_OBJS += aqt1000-clsh.o
67 AQT1000_CDC_OBJS += aqt1000.o
68 AQT1000_CDC_OBJS += aqt1000-mbhc.o
69endif
70
71LINUX_INC += -Iinclude/linux
72
Sudheer Papothi90d7b492018-02-22 14:42:41 +053073INCS += $(COMMON_INC) \
Sudheer Papothi085a6542018-01-25 23:38:29 +053074 $(UAPI_INC)
75
76EXTRA_CFLAGS += $(INCS)
77
78CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \
79 -DANI_LITTLE_BIT_ENDIAN \
80 -DDOT11F_LITTLE_ENDIAN_HOST \
81 -DANI_COMPILER_TYPE_GCC \
82 -DANI_OS_TYPE_ANDROID=6 \
83 -DPTT_SOCK_SVC_ENABLE \
84 -Wall\
Sudheer Papothi085a6542018-01-25 23:38:29 +053085 -D__linux__
86
87KBUILD_CPPFLAGS += $(CDEFINES)
88
89# Currently, for versions of gcc which support it, the kernel Makefile
90# is disabling the maybe-uninitialized warning. Re-enable it for the
91# AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it
92# will override the kernel settings.
93ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y)
94EXTRA_CFLAGS += -Wmaybe-uninitialized
95endif
96#EXTRA_CFLAGS += -Wmissing-prototypes
97
98ifeq ($(call cc-option-yn, -Wheader-guard),y)
99EXTRA_CFLAGS += -Wheader-guard
100endif
101
102ifeq ($(KERNEL_BUILD), 0)
103KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers
104KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers
105KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers
106KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers
107KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers
108KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/aqt1000/Module.symvers
109endif
110
111# Module information used by KBuild framework
112obj-$(CONFIG_SND_SOC_AQT1000) += aqt1000_cdc_dlkm.o
113aqt1000_cdc_dlkm-y := $(AQT1000_CDC_OBJS)