Mangesh Kunchamwar | 82f6168 | 2018-05-17 18:47:47 +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 := $(ANDROID_BUILD_TOP)/kernel/msm-4.14 |
| 14 | AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio |
| 15 | endif |
| 16 | |
| 17 | ifeq ($(KERNEL_BUILD), 0) |
| 18 | ifeq ($(CONFIG_ARCH_QCS405), y) |
| 19 | include $(AUDIO_ROOT)/config/qcs405auto.conf |
| 20 | export |
| 21 | INCS += -include $(AUDIO_ROOT)/config/qcs405autoconf.h |
| 22 | endif |
| 23 | endif |
| 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 ############ |
| 42 | UAPI_DIR := uapi |
| 43 | UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR) |
| 44 | |
| 45 | ############ COMMON ############ |
| 46 | COMMON_DIR := include |
| 47 | COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR) |
| 48 | |
| 49 | ############ CSRA66X0 ############ |
| 50 | |
| 51 | # for CSRA66X0 Codec |
| 52 | ifdef CONFIG_SND_SOC_CSRA66X0 |
| 53 | CSRA66X0_OBJS += csra66x0.o |
| 54 | endif |
| 55 | |
| 56 | LINUX_INC += -Iinclude/linux |
| 57 | |
| 58 | INCS += $(COMMON_INC) \ |
| 59 | $(UAPI_INC) |
| 60 | |
| 61 | #EXTRA_CFLAGS += $(INCS) |
| 62 | ccflags-y += $(INCS) |
| 63 | |
| 64 | |
| 65 | CDEFINES += -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\ |
| 72 | -Werror\ |
| 73 | -D__linux__ |
| 74 | |
| 75 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 76 | |
| 77 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 78 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 79 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 80 | # will override the kernel settings. |
| 81 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 82 | #EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 83 | ccflags-y += -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 | ccflags-y += -Wheader-guard |
| 90 | endif |
| 91 | |
| 92 | ifeq ($(KERNEL_BUILD), 0) |
| 93 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers |
| 94 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 95 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers |
| 96 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers |
| 97 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers |
| 98 | endif |
| 99 | |
| 100 | # Module information used by KBuild framework |
| 101 | obj-$(CONFIG_SND_SOC_CSRA66X0) += csra66x0_dlkm.o |
| 102 | csra66x0_dlkm-y := $(CSRA66X0_OBJS) |
| 103 | |
| 104 | # inject some build related information |
| 105 | DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\" |