Sudheer Papothi | c9443c2 | 2018-08-28 05:35:34 +0530 | [diff] [blame] | 1 | # We can build either as part of a standalone Kernel build or as |
| 2 | # an external module. Determine which mechanism is being used |
| 3 | ifeq ($(MODNAME),) |
| 4 | KERNEL_BUILD := 1 |
| 5 | else |
| 6 | KERNEL_BUILD := 0 |
| 7 | endif |
| 8 | |
| 9 | ifeq ($(KERNEL_BUILD), 1) |
| 10 | # These are configurable via Kconfig for kernel-based builds |
| 11 | # Need to explicitly configure for Android-based builds |
| 12 | AUDIO_BLD_DIR := $(shell pwd)/kernel/msm-4.19 |
| 13 | AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio |
| 14 | endif |
| 15 | |
| 16 | ifeq ($(KERNEL_BUILD), 0) |
| 17 | ifeq ($(CONFIG_ARCH_KONA), y) |
| 18 | include $(AUDIO_ROOT)/config/konaauto.conf |
Sudheer Papothi | c9443c2 | 2018-08-28 05:35:34 +0530 | [diff] [blame] | 19 | INCS += -include $(AUDIO_ROOT)/config/konaautoconf.h |
| 20 | endif |
Vatsal Bucha | d284ff1 | 2019-04-01 15:34:50 +0530 | [diff] [blame] | 21 | ifeq ($(CONFIG_ARCH_LITO), y) |
| 22 | include $(AUDIO_ROOT)/config/litoauto.conf |
Vatsal Bucha | d284ff1 | 2019-04-01 15:34:50 +0530 | [diff] [blame] | 23 | INCS += -include $(AUDIO_ROOT)/config/litoautoconf.h |
| 24 | endif |
Sudheer Papothi | c9443c2 | 2018-08-28 05:35:34 +0530 | [diff] [blame] | 25 | |
| 26 | endif |
| 27 | |
| 28 | # As per target team, build is done as follows: |
| 29 | # Defconfig : build with default flags |
| 30 | # Slub : defconfig + CONFIG_SLUB_DEBUG := y + |
| 31 | # CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y |
| 32 | # Perf : Using appropriate msmXXXX-perf_defconfig |
| 33 | # |
| 34 | # Shipment builds (user variants) should not have any debug feature |
| 35 | # enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds |
| 36 | # are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since |
| 37 | # there is no other way to identify defconfig builds, QTI internal |
| 38 | # representation of perf builds (identified using the string 'perf'), |
| 39 | # is used to identify if the build is a slub or defconfig one. This |
| 40 | # way no critical debug feature will be enabled for perf and shipment |
| 41 | # builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT |
| 42 | # config. |
| 43 | |
| 44 | ############ UAPI ############ |
| 45 | UAPI_DIR := uapi |
| 46 | UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR) |
| 47 | |
| 48 | ############ COMMON ############ |
| 49 | COMMON_DIR := include |
| 50 | COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR) |
| 51 | |
| 52 | ############ WCD938X ############ |
| 53 | |
| 54 | # for WCD938X Codec |
| 55 | ifdef CONFIG_SND_SOC_WCD938X |
| 56 | WCD938X_OBJS += wcd938x.o |
| 57 | WCD938X_OBJS += wcd938x-regmap.o |
| 58 | WCD938X_OBJS += wcd938x-tables.o |
| 59 | WCD938X_OBJS += wcd938x-mbhc.o |
| 60 | endif |
| 61 | |
| 62 | ifdef CONFIG_SND_SOC_WCD938X_SLAVE |
| 63 | WCD938X_SLAVE_OBJS += wcd938x-slave.o |
| 64 | endif |
| 65 | |
| 66 | LINUX_INC += -Iinclude/linux |
| 67 | |
| 68 | INCS += $(COMMON_INC) \ |
| 69 | $(UAPI_INC) |
| 70 | |
| 71 | EXTRA_CFLAGS += $(INCS) |
| 72 | |
| 73 | |
| 74 | CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ |
| 75 | -DANI_LITTLE_BIT_ENDIAN \ |
| 76 | -DDOT11F_LITTLE_ENDIAN_HOST \ |
| 77 | -DANI_COMPILER_TYPE_GCC \ |
| 78 | -DANI_OS_TYPE_ANDROID=6 \ |
| 79 | -DPTT_SOCK_SVC_ENABLE \ |
| 80 | -Wall\ |
Sudheer Papothi | c9443c2 | 2018-08-28 05:35:34 +0530 | [diff] [blame] | 81 | -D__linux__ |
| 82 | |
| 83 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 84 | |
| 85 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 86 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 87 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 88 | # will override the kernel settings. |
| 89 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 90 | EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 91 | endif |
| 92 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 93 | |
| 94 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 95 | EXTRA_CFLAGS += -Wheader-guard |
| 96 | endif |
| 97 | |
| 98 | ifeq ($(KERNEL_BUILD), 0) |
| 99 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers |
| 100 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 101 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers |
| 102 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers |
| 103 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers |
| 104 | endif |
| 105 | |
| 106 | # Module information used by KBuild framework |
| 107 | obj-$(CONFIG_SND_SOC_WCD938X) += wcd938x_dlkm.o |
| 108 | wcd938x_dlkm-y := $(WCD938X_OBJS) |
| 109 | |
| 110 | obj-$(CONFIG_SND_SOC_WCD938X_SLAVE) += wcd938x_slave_dlkm.o |
| 111 | wcd938x_slave_dlkm-y := $(WCD938X_SLAVE_OBJS) |