Soumya Managoli | d11d6f0 | 2020-05-27 17:25:12 +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 | |
| 10 | ifeq ($(KERNEL_BUILD), 1) |
| 11 | # These are configurable via Kconfig for kernel-based builds |
| 12 | # Need to explicitly configure for Android-based builds |
| 13 | AUDIO_BLD_DIR := $(shell pwd)/kernel/msm-4.19 |
| 14 | AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio |
| 15 | endif |
| 16 | |
| 17 | ifeq ($(KERNEL_BUILD), 0) |
| 18 | ifeq ($(CONFIG_ARCH_SDM660), y) |
| 19 | include $(AUDIO_ROOT)/config/sdm660auto.conf |
Soumya Managoli | d11d6f0 | 2020-05-27 17:25:12 +0530 | [diff] [blame] | 20 | INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h |
| 21 | endif |
| 22 | endif |
| 23 | |
| 24 | # As per target team, build is done as follows: |
| 25 | # Defconfig : build with default flags |
| 26 | # Slub : defconfig + CONFIG_SLUB_DEBUG := y + |
| 27 | # CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y |
| 28 | # Perf : Using appropriate msmXXXX-perf_defconfig |
| 29 | # |
| 30 | # Shipment builds (user variants) should not have any debug feature |
| 31 | # enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds |
| 32 | # are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since |
| 33 | # there is no other way to identify defconfig builds, QTI internal |
| 34 | # representation of perf builds (identified using the string 'perf'), |
| 35 | # is used to identify if the build is a slub or defconfig one. This |
| 36 | # way no critical debug feature will be enabled for perf and shipment |
| 37 | # builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT |
| 38 | # config. |
| 39 | |
| 40 | ############ UAPI ############ |
| 41 | UAPI_DIR := uapi |
| 42 | UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR) |
| 43 | |
| 44 | ############ COMMON ############ |
| 45 | COMMON_DIR := include |
| 46 | COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR) |
| 47 | |
| 48 | ############ MSM Soundwire ############ |
| 49 | |
| 50 | # for MSM Soundwire Codec |
| 51 | ifdef CONFIG_SND_SOC_MSM_SDW |
| 52 | MSM_SDW_OBJS += msm_sdw_cdc.o |
| 53 | MSM_SDW_OBJS += msm_sdw_regmap.o |
| 54 | MSM_SDW_OBJS += msm-sdw-tables.o |
| 55 | MSM_SDW_OBJS += msm_sdw_cdc_utils.o |
| 56 | endif |
| 57 | |
| 58 | LINUX_INC += -Iinclude/linux |
| 59 | |
| 60 | INCS += $(COMMON_INC) \ |
| 61 | $(UAPI_INC) |
| 62 | |
| 63 | EXTRA_CFLAGS += $(INCS) |
| 64 | |
| 65 | |
| 66 | CDEFINES += -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 | |
| 76 | KBUILD_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. |
| 82 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 83 | EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 84 | endif |
| 85 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 86 | |
| 87 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 88 | EXTRA_CFLAGS += -Wheader-guard |
| 89 | endif |
| 90 | |
| 91 | ifeq ($(KERNEL_BUILD), 0) |
| 92 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers |
| 93 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 94 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers |
| 95 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers |
| 96 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers |
| 97 | endif |
| 98 | |
| 99 | ifeq ($(CONFIG_SND_SOC_GCOV), y) |
| 100 | GCOV_PROFILE := y |
| 101 | endif |
| 102 | |
| 103 | # Module information used by KBuild framework |
| 104 | obj-$(CONFIG_SND_SOC_MSM_SDW) += msm_sdw_dlkm.o |
| 105 | msm_sdw_dlkm-y := $(MSM_SDW_OBJS) |