Laxminath Kasam | a0f8408 | 2018-05-31 10:42:50 +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 | |
| 11 | ifeq ($(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 |
| 16 | endif |
| 17 | |
| 18 | ifeq ($(KERNEL_BUILD), 0) |
| 19 | ifeq ($(CONFIG_ARCH_SM6150), y) |
| 20 | include $(AUDIO_ROOT)/config/sm6150auto.conf |
| 21 | export |
| 22 | INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h |
| 23 | endif |
Mangesh Kunchamwar | 0bf1f57 | 2018-05-24 19:58:42 +0530 | [diff] [blame] | 24 | ifeq ($(CONFIG_ARCH_QCS405), y) |
| 25 | include $(AUDIO_ROOT)/config/qcs405auto.conf |
| 26 | export |
| 27 | INCS += -include $(AUDIO_ROOT)/config/qcs405autoconf.h |
| 28 | endif |
Laxminath Kasam | a0f8408 | 2018-05-31 10:42:50 +0530 | [diff] [blame] | 29 | endif |
| 30 | |
| 31 | # As per target team, build is done as follows: |
| 32 | # Defconfig : build with default flags |
| 33 | # Slub : defconfig + CONFIG_SLUB_DEBUG := y + |
| 34 | # CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y |
| 35 | # Perf : Using appropriate msmXXXX-perf_defconfig |
| 36 | # |
| 37 | # Shipment builds (user variants) should not have any debug feature |
| 38 | # enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds |
| 39 | # are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since |
| 40 | # there is no other way to identify defconfig builds, QTI internal |
| 41 | # representation of perf builds (identified using the string 'perf'), |
| 42 | # is used to identify if the build is a slub or defconfig one. This |
| 43 | # way no critical debug feature will be enabled for perf and shipment |
| 44 | # builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT |
| 45 | # config. |
| 46 | |
| 47 | ############ UAPI ############ |
| 48 | UAPI_DIR := uapi |
| 49 | UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR) |
| 50 | |
| 51 | ############ COMMON ############ |
| 52 | COMMON_DIR := include |
| 53 | COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR) |
| 54 | |
| 55 | ############ BOLERO ############ |
| 56 | |
| 57 | # for BOLERO Codec |
| 58 | ifdef CONFIG_SND_SOC_BOLERO |
| 59 | BOLERO_OBJS += bolero-cdc.o |
| 60 | BOLERO_OBJS += bolero-cdc-utils.o |
| 61 | BOLERO_OBJS += bolero-cdc-regmap.o |
| 62 | BOLERO_OBJS += bolero-cdc-tables.o |
| 63 | endif |
| 64 | |
| 65 | ifdef CONFIG_WSA_MACRO |
| 66 | WSA_OBJS += wsa-macro.o |
| 67 | endif |
| 68 | |
| 69 | ifdef CONFIG_VA_MACRO |
| 70 | VA_OBJS += va-macro.o |
| 71 | endif |
| 72 | |
| 73 | LINUX_INC += -Iinclude/linux |
| 74 | |
| 75 | INCS += $(COMMON_INC) \ |
| 76 | $(UAPI_INC) |
| 77 | |
| 78 | EXTRA_CFLAGS += $(INCS) |
| 79 | |
| 80 | |
| 81 | CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ |
| 82 | -DANI_LITTLE_BIT_ENDIAN \ |
| 83 | -DDOT11F_LITTLE_ENDIAN_HOST \ |
| 84 | -DANI_COMPILER_TYPE_GCC \ |
| 85 | -DANI_OS_TYPE_ANDROID=6 \ |
| 86 | -DPTT_SOCK_SVC_ENABLE \ |
| 87 | -Wall\ |
| 88 | -Werror\ |
| 89 | -D__linux__ |
| 90 | |
| 91 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 92 | |
| 93 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 94 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 95 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 96 | # will override the kernel settings. |
| 97 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 98 | EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 99 | endif |
| 100 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 101 | |
| 102 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 103 | EXTRA_CFLAGS += -Wheader-guard |
| 104 | endif |
| 105 | |
| 106 | ifeq ($(KERNEL_BUILD), 0) |
| 107 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers |
| 108 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 109 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers |
| 110 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers |
| 111 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers |
| 112 | endif |
| 113 | |
| 114 | # Module information used by KBuild framework |
| 115 | obj-$(CONFIG_SND_SOC_BOLERO) += bolero_cdc_dlkm.o |
| 116 | bolero_cdc_dlkm-y := $(BOLERO_OBJS) |
| 117 | |
| 118 | obj-$(CONFIG_WSA_MACRO) += wsa_macro_dlkm.o |
| 119 | wsa_macro_dlkm-y := $(WSA_OBJS) |
| 120 | |
| 121 | obj-$(CONFIG_VA_MACRO) += va_macro_dlkm.o |
| 122 | va_macro_dlkm-y := $(VA_OBJS) |
| 123 | |
| 124 | # inject some build related information |
| 125 | DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\" |