blob: 80784a2499a13a865b669a821950d0862b5ca8b5 [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
Asish Bhattacharya5faacb32017-12-04 17:23:15 +05303ifeq ($(MODNAME),)
4 KERNEL_BUILD := 1
5else
6 KERNEL_BUILD := 0
7endif
Laxminath Kasam8b1366a2017-10-05 01:44:16 +05308
9
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053010
11ifeq ($(KERNEL_BUILD), 1)
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053012 # 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
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053015 AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio
16endif
17
18ifeq ($(KERNEL_BUILD), 0)
Salendarsingh Gaudad978892018-05-14 16:53:09 +053019 ifeq ($(CONFIG_ARCH_SM6150), y)
Laxminath Kasam144eabc2018-05-31 10:44:53 +053020 include $(AUDIO_ROOT)/config/sm6150auto.conf
Laxminath Kasam144eabc2018-05-31 10:44:53 +053021 INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h
Abhishek Arpure6d74b702018-04-05 13:50:25 +053022 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
Banajit Goswamif58e5fc2018-04-11 14:10:09 -070027 ifeq ($(CONFIG_ARCH_SM8150), y)
Xiaoyu Ye60c105d2018-04-12 12:43:13 -070028 include $(AUDIO_ROOT)/config/sm8150auto.conf
Xiaoyu Ye60c105d2018-04-12 12:43:13 -070029 INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h
Sudheer Papothicc0a22d2018-03-02 06:29:57 +053030 endif
Sudheer Papothie3842cf2018-03-31 02:27:42 +053031 ifeq ($(CONFIG_ARCH_SDMSHRIKE), y)
Xiaoyu Ye60c105d2018-04-12 12:43:13 -070032 include $(AUDIO_ROOT)/config/sm8150auto.conf
Xiaoyu Ye60c105d2018-04-12 12:43:13 -070033 INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h
Sudheer Papothie3842cf2018-03-31 02:27:42 +053034 endif
Soumya Managolid11d6f02020-05-27 17:25:12 +053035 ifeq ($(CONFIG_ARCH_SDM660), y)
36 include $(AUDIO_ROOT)/config/sdm660auto.conf
Soumya Managolid11d6f02020-05-27 17:25:12 +053037 INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h
38 endif
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053039endif
40
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053041# As per target team, build is done as follows:
42# Defconfig : build with default flags
43# Slub : defconfig + CONFIG_SLUB_DEBUG := y +
44# CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y
45# Perf : Using appropriate msmXXXX-perf_defconfig
46#
47# Shipment builds (user variants) should not have any debug feature
48# enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds
49# are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since
50# there is no other way to identify defconfig builds, QTI internal
51# representation of perf builds (identified using the string 'perf'),
52# is used to identify if the build is a slub or defconfig one. This
53# way no critical debug feature will be enabled for perf and shipment
54# builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT
55# config.
56
57############ UAPI ############
58UAPI_DIR := uapi
59UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR)
60
61############ COMMON ############
62COMMON_DIR := include
63COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR)
64
65############ WCD934X ############
66
67# for WCD934X Codec
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053068ifdef CONFIG_SND_SOC_WCD934X
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053069 WCD934X_OBJS += wcd934x.o
70 WCD934X_OBJS += wcd934x-dsp-cntl.o
71 WCD934X_OBJS += wcd934x-mbhc.o
72 WCD934X_OBJS += wcd934x-dsd.o
73endif
74
75LINUX_INC += -Iinclude/linux
76
Asish Bhattacharya5faacb32017-12-04 17:23:15 +053077INCS += $(COMMON_INC) \
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053078 $(UAPI_INC)
79
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053080EXTRA_CFLAGS += $(INCS)
81
82
83CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \
84 -DANI_LITTLE_BIT_ENDIAN \
85 -DDOT11F_LITTLE_ENDIAN_HOST \
86 -DANI_COMPILER_TYPE_GCC \
87 -DANI_OS_TYPE_ANDROID=6 \
88 -DPTT_SOCK_SVC_ENABLE \
89 -Wall\
Laxminath Kasam8b1366a2017-10-05 01:44:16 +053090 -D__linux__
91
92KBUILD_CPPFLAGS += $(CDEFINES)
93
94# Currently, for versions of gcc which support it, the kernel Makefile
95# is disabling the maybe-uninitialized warning. Re-enable it for the
96# AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it
97# will override the kernel settings.
98ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y)
99EXTRA_CFLAGS += -Wmaybe-uninitialized
100endif
101#EXTRA_CFLAGS += -Wmissing-prototypes
102
103ifeq ($(call cc-option-yn, -Wheader-guard),y)
104EXTRA_CFLAGS += -Wheader-guard
105endif
106
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530107ifeq ($(KERNEL_BUILD), 0)
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530108KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers
109KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers
110KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers
111KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers
112KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers
Asish Bhattacharya5faacb32017-12-04 17:23:15 +0530113endif
114
Laxminath Kasam8b1366a2017-10-05 01:44:16 +0530115# Module information used by KBuild framework
116obj-$(CONFIG_SND_SOC_WCD934X) += wcd934x_dlkm.o
117wcd934x_dlkm-y := $(WCD934X_OBJS)