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 |
Meng Wang | 19fa6de | 2018-12-20 11:25:47 +0800 | [diff] [blame] | 14 | AUDIO_BLD_DIR := $(shell pwd)/kernel/msm-4.19 |
Laxminath Kasam | a0f8408 | 2018-05-31 10:42:50 +0530 | [diff] [blame] | 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 |
Laxminath Kasam | a0f8408 | 2018-05-31 10:42:50 +0530 | [diff] [blame] | 21 | INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h |
| 22 | endif |
Hari Veerubhotla | dcab67c | 2018-10-14 17:08:35 +0530 | [diff] [blame] | 23 | ifeq ($(CONFIG_ARCH_TRINKET), y) |
| 24 | include $(AUDIO_ROOT)/config/sm6150auto.conf |
Hari Veerubhotla | dcab67c | 2018-10-14 17:08:35 +0530 | [diff] [blame] | 25 | INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h |
| 26 | endif |
Meng Wang | b0e0479 | 2018-09-27 18:46:44 +0800 | [diff] [blame] | 27 | ifeq ($(CONFIG_ARCH_KONA), y) |
| 28 | include $(AUDIO_ROOT)/config/konaauto.conf |
Meng Wang | b0e0479 | 2018-09-27 18:46:44 +0800 | [diff] [blame] | 29 | INCS += -include $(AUDIO_ROOT)/config/konaautoconf.h |
| 30 | endif |
Vatsal Bucha | d284ff1 | 2019-04-01 15:34:50 +0530 | [diff] [blame] | 31 | ifeq ($(CONFIG_ARCH_LITO), y) |
| 32 | include $(AUDIO_ROOT)/config/litoauto.conf |
Vatsal Bucha | d284ff1 | 2019-04-01 15:34:50 +0530 | [diff] [blame] | 33 | INCS += -include $(AUDIO_ROOT)/config/litoautoconf.h |
| 34 | endif |
Laxminath Kasam | fdda2d8 | 2019-07-31 21:26:30 +0530 | [diff] [blame] | 35 | ifeq ($(CONFIG_ARCH_BENGAL), y) |
Laxminath Kasam | 00f60ba | 2019-10-04 09:37:07 +0530 | [diff] [blame] | 36 | include $(AUDIO_ROOT)/config/bengalauto.conf |
Laxminath Kasam | 00f60ba | 2019-10-04 09:37:07 +0530 | [diff] [blame] | 37 | INCS += -include $(AUDIO_ROOT)/config/bengalautoconf.h |
Laxminath Kasam | fdda2d8 | 2019-07-31 21:26:30 +0530 | [diff] [blame] | 38 | endif |
Mangesh Kunchamwar | 0bf1f57 | 2018-05-24 19:58:42 +0530 | [diff] [blame] | 39 | ifeq ($(CONFIG_ARCH_QCS405), y) |
| 40 | include $(AUDIO_ROOT)/config/qcs405auto.conf |
Mangesh Kunchamwar | 0bf1f57 | 2018-05-24 19:58:42 +0530 | [diff] [blame] | 41 | INCS += -include $(AUDIO_ROOT)/config/qcs405autoconf.h |
| 42 | endif |
Laxminath Kasam | a0f8408 | 2018-05-31 10:42:50 +0530 | [diff] [blame] | 43 | endif |
| 44 | |
| 45 | # As per target team, build is done as follows: |
| 46 | # Defconfig : build with default flags |
| 47 | # Slub : defconfig + CONFIG_SLUB_DEBUG := y + |
| 48 | # CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y |
| 49 | # Perf : Using appropriate msmXXXX-perf_defconfig |
| 50 | # |
| 51 | # Shipment builds (user variants) should not have any debug feature |
| 52 | # enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds |
| 53 | # are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since |
| 54 | # there is no other way to identify defconfig builds, QTI internal |
| 55 | # representation of perf builds (identified using the string 'perf'), |
| 56 | # is used to identify if the build is a slub or defconfig one. This |
| 57 | # way no critical debug feature will be enabled for perf and shipment |
| 58 | # builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT |
| 59 | # config. |
| 60 | |
| 61 | ############ UAPI ############ |
| 62 | UAPI_DIR := uapi |
| 63 | UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR) |
| 64 | |
| 65 | ############ COMMON ############ |
| 66 | COMMON_DIR := include |
| 67 | COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR) |
| 68 | |
| 69 | ############ BOLERO ############ |
| 70 | |
| 71 | # for BOLERO Codec |
| 72 | ifdef CONFIG_SND_SOC_BOLERO |
| 73 | BOLERO_OBJS += bolero-cdc.o |
| 74 | BOLERO_OBJS += bolero-cdc-utils.o |
| 75 | BOLERO_OBJS += bolero-cdc-regmap.o |
| 76 | BOLERO_OBJS += bolero-cdc-tables.o |
Vidyakumar Athota | 5d45f4c | 2019-03-10 22:35:07 -0700 | [diff] [blame] | 77 | BOLERO_OBJS += bolero-clk-rsc.o |
Laxminath Kasam | a0f8408 | 2018-05-31 10:42:50 +0530 | [diff] [blame] | 78 | endif |
| 79 | |
| 80 | ifdef CONFIG_WSA_MACRO |
| 81 | WSA_OBJS += wsa-macro.o |
| 82 | endif |
| 83 | |
| 84 | ifdef CONFIG_VA_MACRO |
| 85 | VA_OBJS += va-macro.o |
| 86 | endif |
| 87 | |
Laxminath Kasam | f8ef43e | 2018-06-15 16:57:46 +0530 | [diff] [blame] | 88 | ifdef CONFIG_TX_MACRO |
| 89 | TX_OBJS += tx-macro.o |
| 90 | endif |
| 91 | |
| 92 | ifdef CONFIG_RX_MACRO |
| 93 | RX_OBJS += rx-macro.o |
| 94 | endif |
| 95 | |
Laxminath Kasam | a0f8408 | 2018-05-31 10:42:50 +0530 | [diff] [blame] | 96 | LINUX_INC += -Iinclude/linux |
| 97 | |
| 98 | INCS += $(COMMON_INC) \ |
| 99 | $(UAPI_INC) |
| 100 | |
| 101 | EXTRA_CFLAGS += $(INCS) |
| 102 | |
| 103 | |
| 104 | CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ |
| 105 | -DANI_LITTLE_BIT_ENDIAN \ |
| 106 | -DDOT11F_LITTLE_ENDIAN_HOST \ |
| 107 | -DANI_COMPILER_TYPE_GCC \ |
| 108 | -DANI_OS_TYPE_ANDROID=6 \ |
| 109 | -DPTT_SOCK_SVC_ENABLE \ |
| 110 | -Wall\ |
Laxminath Kasam | a0f8408 | 2018-05-31 10:42:50 +0530 | [diff] [blame] | 111 | -D__linux__ |
| 112 | |
| 113 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 114 | |
| 115 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 116 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 117 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 118 | # will override the kernel settings. |
| 119 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 120 | EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 121 | endif |
| 122 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 123 | |
| 124 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 125 | EXTRA_CFLAGS += -Wheader-guard |
| 126 | endif |
| 127 | |
| 128 | ifeq ($(KERNEL_BUILD), 0) |
| 129 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers |
| 130 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 131 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers |
| 132 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers |
| 133 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers |
| 134 | endif |
| 135 | |
| 136 | # Module information used by KBuild framework |
| 137 | obj-$(CONFIG_SND_SOC_BOLERO) += bolero_cdc_dlkm.o |
| 138 | bolero_cdc_dlkm-y := $(BOLERO_OBJS) |
| 139 | |
| 140 | obj-$(CONFIG_WSA_MACRO) += wsa_macro_dlkm.o |
| 141 | wsa_macro_dlkm-y := $(WSA_OBJS) |
| 142 | |
| 143 | obj-$(CONFIG_VA_MACRO) += va_macro_dlkm.o |
| 144 | va_macro_dlkm-y := $(VA_OBJS) |
| 145 | |
Laxminath Kasam | f8ef43e | 2018-06-15 16:57:46 +0530 | [diff] [blame] | 146 | obj-$(CONFIG_TX_MACRO) += tx_macro_dlkm.o |
| 147 | tx_macro_dlkm-y := $(TX_OBJS) |
| 148 | |
| 149 | obj-$(CONFIG_RX_MACRO) += rx_macro_dlkm.o |
| 150 | rx_macro_dlkm-y := $(RX_OBJS) |