blob: 744c3b444428b55d1f04b28134d9b8cececfe0b9 [file] [log] [blame]
Ralf Herz5f302512018-06-21 18:50:09 +02001# 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 Wangb0e04792018-09-27 18:46:44 +080014 AUDIO_BLD_DIR := $(shell pwd)/kernel/msm-4.19
Ralf Herz5f302512018-06-21 18:50:09 +020015 AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio
16endif
17
18ifeq ($(KERNEL_BUILD), 0)
19 ifeq ($(CONFIG_ARCH_QCS405), y)
20 include $(AUDIO_ROOT)/config/qcs405auto.conf
Ralf Herz5f302512018-06-21 18:50:09 +020021 INCS += -include $(AUDIO_ROOT)/config/qcs405autoconf.h
22 endif
23endif
24
25# As per target team, build is done as follows:
26# Defconfig : build with default flags
27# Slub : defconfig + CONFIG_SLUB_DEBUG := y +
28# CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y
29# Perf : Using appropriate msmXXXX-perf_defconfig
30#
31# Shipment builds (user variants) should not have any debug feature
32# enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds
33# are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since
34# there is no other way to identify defconfig builds, QTI internal
35# representation of perf builds (identified using the string 'perf'),
36# is used to identify if the build is a slub or defconfig one. This
37# way no critical debug feature will be enabled for perf and shipment
38# builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT
39# config.
40
41############ UAPI ############
42UAPI_DIR := uapi
43UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR)
44
45############ COMMON ############
46COMMON_DIR := include
47COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR)
48
49############ EP92 ############
50
51# for EP92 Codec
52ifdef CONFIG_SND_SOC_EP92
53 EP92_OBJS += ep92.o
54endif
55
56LINUX_INC += -Iinclude/linux
57
58INCS += $(COMMON_INC) \
59 $(UAPI_INC)
60
61#EXTRA_CFLAGS += $(INCS)
62ccflags-y += $(INCS)
63
64
65CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \
66 -DANI_LITTLE_BIT_ENDIAN \
67 -DDOT11F_LITTLE_ENDIAN_HOST \
68 -DANI_COMPILER_TYPE_GCC \
69 -DANI_OS_TYPE_ANDROID=6 \
70 -DPTT_SOCK_SVC_ENABLE \
71 -Wall\
Ralf Herz5f302512018-06-21 18:50:09 +020072 -D__linux__
73
74KBUILD_CPPFLAGS += $(CDEFINES)
75
76# Currently, for versions of gcc which support it, the kernel Makefile
77# is disabling the maybe-uninitialized warning. Re-enable it for the
78# AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it
79# will override the kernel settings.
80ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y)
81#EXTRA_CFLAGS += -Wmaybe-uninitialized
82ccflags-y += -Wmaybe-uninitialized
83endif
84#EXTRA_CFLAGS += -Wmissing-prototypes
85
86ifeq ($(call cc-option-yn, -Wheader-guard),y)
87#EXTRA_CFLAGS += -Wheader-guard
88ccflags-y += -Wheader-guard
89endif
90
91ifeq ($(KERNEL_BUILD), 0)
92KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers
93KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers
94KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers
95KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers
96KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers
97endif
98
99# Module information used by KBuild framework
100obj-$(CONFIG_SND_SOC_EP92) += ep92_dlkm.o
101ep92_dlkm-y := $(EP92_OBJS)