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