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