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 |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 3 | ifeq ($(MODNAME),) |
| 4 | KERNEL_BUILD := 1 |
| 5 | else |
| 6 | KERNEL_BUILD := 0 |
| 7 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 8 | |
| 9 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 10 | ifeq ($(KERNEL_BUILD), 1) |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 11 | # These are configurable via Kconfig for kernel-based builds |
| 12 | # Need to explicitly configure for Android-based builds |
Piyush Balwani | f9d9d1e | 2018-11-30 19:13:42 +0530 | [diff] [blame] | 13 | AUDIO_BLD_DIR := $(shell pwd)/kernel/msm-4.9 |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 14 | AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio |
| 15 | endif |
| 16 | |
| 17 | ifeq ($(KERNEL_BUILD), 0) |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 18 | ifeq ($(CONFIG_ARCH_SDM845), y) |
| 19 | include $(AUDIO_ROOT)/config/sdm845auto.conf |
| 20 | export |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 21 | INCS += -include $(AUDIO_ROOT)/config/sdm845autoconf.h |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 22 | endif |
| 23 | ifeq ($(CONFIG_ARCH_SDM670), y) |
Aditya Bavanari | 68d3ed8 | 2018-04-08 14:34:47 +0530 | [diff] [blame] | 24 | include $(AUDIO_ROOT)/config/sdm710auto.conf |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 25 | export |
Aditya Bavanari | 68d3ed8 | 2018-04-08 14:34:47 +0530 | [diff] [blame] | 26 | INCS += -include $(AUDIO_ROOT)/config/sdm710autoconf.h |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 27 | endif |
Laxminath Kasam | 942d1c6 | 2017-12-29 11:02:22 +0530 | [diff] [blame] | 28 | ifeq ($(CONFIG_ARCH_SDM450), y) |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 29 | include $(AUDIO_ROOT)/config/sdm450auto.conf |
Laxminath Kasam | 942d1c6 | 2017-12-29 11:02:22 +0530 | [diff] [blame] | 30 | export |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 31 | INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h |
Laxminath Kasam | 942d1c6 | 2017-12-29 11:02:22 +0530 | [diff] [blame] | 32 | endif |
Vaishnavi Kommaraju | 59562a1 | 2018-04-25 19:33:46 +0530 | [diff] [blame] | 33 | ifeq ($(CONFIG_ARCH_SDM439), y) |
| 34 | include $(AUDIO_ROOT)/config/sdm450auto.conf |
| 35 | export |
| 36 | INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h |
| 37 | endif |
Xiaoyu Ye | e7df5cc | 2017-10-02 18:47:29 -0700 | [diff] [blame] | 38 | ifeq ($(CONFIG_ARCH_SDXPOORWILLS), y) |
| 39 | include $(AUDIO_ROOT)/config/sdxpoorwillsauto.conf |
| 40 | export |
| 41 | INCS += -include $(AUDIO_ROOT)/config/sdxpoorwillsautoconf.h |
| 42 | endif |
Sundara Vinayagam | 43ce7c9 | 2018-05-21 16:34:47 +0530 | [diff] [blame] | 43 | ifeq ($(CONFIG_ARCH_MSM8909), y) |
Manjunatha Madana | 58ebedb | 2020-02-19 17:39:05 +0530 | [diff] [blame] | 44 | ifeq ($(CONFIG_MSM_BGCOM), y) |
| 45 | include $(AUDIO_ROOT)/config/msm8909auto.conf |
| 46 | export |
| 47 | INCS += -include $(AUDIO_ROOT)/config/msm8909autoconf.h |
| 48 | endif |
| 49 | ifeq ($(CONFIG_MSM_8905), m) |
| 50 | include $(AUDIO_ROOT)/config/msm8905auto.conf |
| 51 | export |
| 52 | INCS += -include $(AUDIO_ROOT)/config/msm8905autoconf.h |
| 53 | endif |
Sundara Vinayagam | 43ce7c9 | 2018-05-21 16:34:47 +0530 | [diff] [blame] | 54 | endif |
Soumya Managoli | d63fb8e | 2018-05-08 17:28:01 +0530 | [diff] [blame] | 55 | ifeq ($(CONFIG_ARCH_MSM8917), y) |
| 56 | include $(AUDIO_ROOT)/config/sdm450auto.conf |
| 57 | export |
| 58 | INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h |
| 59 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 60 | endif |
| 61 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 62 | # As per target team, build is done as follows: |
| 63 | # Defconfig : build with default flags |
| 64 | # Slub : defconfig + CONFIG_SLUB_DEBUG := y + |
| 65 | # CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y |
| 66 | # Perf : Using appropriate msmXXXX-perf_defconfig |
| 67 | # |
| 68 | # Shipment builds (user variants) should not have any debug feature |
| 69 | # enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds |
| 70 | # are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since |
| 71 | # there is no other way to identify defconfig builds, QTI internal |
| 72 | # representation of perf builds (identified using the string 'perf'), |
| 73 | # is used to identify if the build is a slub or defconfig one. This |
| 74 | # way no critical debug feature will be enabled for perf and shipment |
| 75 | # builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT |
| 76 | # config. |
| 77 | |
| 78 | ############ UAPI ############ |
| 79 | UAPI_DIR := uapi |
| 80 | UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR) |
| 81 | |
| 82 | ############ COMMON ############ |
| 83 | COMMON_DIR := include |
| 84 | COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR) |
| 85 | |
| 86 | ############ ASoC Drivers ############ |
| 87 | |
| 88 | |
| 89 | # for SDM6xx sound card driver |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 90 | ifdef CONFIG_SND_SOC_SDM670 |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 91 | MACHINE_OBJS += sdm660-common.o |
| 92 | endif |
| 93 | |
| 94 | # for SDM6xx sound card driver |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 95 | ifdef CONFIG_SND_SOC_INT_CODEC |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 96 | MACHINE_OBJS += sdm660-internal.o |
| 97 | endif |
| 98 | |
| 99 | # for SDM6xx sound card driver |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 100 | ifdef CONFIG_SND_SOC_EXT_CODEC |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 101 | MACHINE_OBJS += sdm660-external.o |
| 102 | MACHINE_OBJS += sdm660-ext-dai-links.o |
| 103 | endif |
| 104 | |
| 105 | # for SDM845 sound card driver |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 106 | ifdef CONFIG_SND_SOC_MACHINE_SDM845 |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 107 | MACHINE_OBJS += sdm845.o |
| 108 | endif |
| 109 | |
Xiaoyu Ye | e7df5cc | 2017-10-02 18:47:29 -0700 | [diff] [blame] | 110 | # for SDXPOORWILLS sound card driver |
| 111 | ifdef CONFIG_SND_SOC_MACHINE_SDXPOORWILLS |
| 112 | MACHINE_OBJS += sdxpoorwills.o |
| 113 | endif |
| 114 | |
Raja Mallik | dc60da5 | 2018-05-21 16:41:24 +0530 | [diff] [blame] | 115 | # for APQ8009 external codec sound card driver |
| 116 | ifdef CONFIG_SND_SOC_EXT_CODEC_8909 |
| 117 | MACHINE_EXT_OBJS += apq8009-i2s-ext-codec.o |
| 118 | endif |
| 119 | |
Soumya Managoli | 91b8c3f | 2018-02-24 18:36:15 +0530 | [diff] [blame] | 120 | # for SDM450 internal codec sound card driver |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 121 | ifdef CONFIG_SND_SOC_SDM450 |
| 122 | MACHINE_OBJS += msm8952.o |
| 123 | endif |
| 124 | |
yang liu | 0e16b0c | 2018-08-10 12:09:21 +0800 | [diff] [blame] | 125 | ifdef CONFIG_SND_SOC_MSM8909 |
| 126 | MACHINE_INT_OBJS += msm8952.o |
| 127 | endif |
| 128 | |
Soumya Managoli | 91b8c3f | 2018-02-24 18:36:15 +0530 | [diff] [blame] | 129 | # for SDM450 external codec sound card driver |
| 130 | ifdef CONFIG_SND_SOC_EXT_CODEC_SDM450 |
| 131 | MACHINE_EXT_OBJS += msm8952-slimbus.o |
| 132 | MACHINE_EXT_OBJS += msm8952-dai-links.o |
| 133 | endif |
| 134 | |
Sundara Vinayagam | 43ce7c9 | 2018-05-21 16:34:47 +0530 | [diff] [blame] | 135 | # for MSM8909 sound card driver |
| 136 | ifdef CONFIG_SND_SOC_BG_8909 |
| 137 | MACHINE_OBJS += msm_bg.o |
| 138 | endif |
| 139 | |
Manjunatha Madana | 80e8ffa | 2018-12-17 14:13:08 +0530 | [diff] [blame] | 140 | ifdef CONFIG_SND_SOC_8909_DIG_CDC |
| 141 | MACHINE_DIGCDC_OBJS += msm8909.o |
| 142 | endif |
| 143 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 144 | ifdef CONFIG_SND_SOC_CPE |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 145 | CPE_LSM_OBJS += msm-cpe-lsm.o |
| 146 | endif |
| 147 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 148 | ifdef CONFIG_SND_SOC_QDSP6V2 |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 149 | PLATFORM_OBJS += msm-audio-effects-q6-v2.o |
| 150 | PLATFORM_OBJS += msm-compress-q6-v2.o |
| 151 | PLATFORM_OBJS += msm-dai-fe.o |
| 152 | PLATFORM_OBJS += msm-dai-q6-hdmi-v2.o |
| 153 | PLATFORM_OBJS += msm-dai-q6-v2.o |
| 154 | PLATFORM_OBJS += msm-dai-slim.o |
| 155 | PLATFORM_OBJS += msm-dai-stub-v2.o |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 156 | PLATFORM_OBJS += msm-lsm-client.o |
| 157 | PLATFORM_OBJS += msm-pcm-afe-v2.o |
| 158 | PLATFORM_OBJS += msm-pcm-dtmf-v2.o |
| 159 | PLATFORM_OBJS += msm-pcm-hostless.o |
| 160 | PLATFORM_OBJS += msm-pcm-host-voice-v2.o |
| 161 | PLATFORM_OBJS += msm-pcm-loopback-v2.o |
| 162 | PLATFORM_OBJS += msm-pcm-q6-noirq.o |
| 163 | PLATFORM_OBJS += msm-pcm-q6-v2.o |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 164 | PLATFORM_OBJS += msm-pcm-routing-v2.o |
| 165 | PLATFORM_OBJS += msm-pcm-voice-v2.o |
| 166 | PLATFORM_OBJS += msm-pcm-voip-v2.o |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 167 | PLATFORM_OBJS += msm-transcode-loopback-q6-v2.o |
| 168 | PLATFORM_OBJS += platform_init.o |
| 169 | endif |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 170 | ifdef CONFIG_DOLBY_DS2 |
| 171 | PLATFORM_OBJS += msm-ds2-dap-config.o |
| 172 | endif |
| 173 | ifdef CONFIG_DOLBY_LICENSE |
| 174 | PLATFORM_OBJS += msm-ds2-dap-config.o |
| 175 | endif |
Laxminath Kasam | 27c8dcf | 2018-01-03 21:13:17 +0530 | [diff] [blame] | 176 | ifdef CONFIG_SND_HWDEP_ROUTING |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 177 | PLATFORM_OBJS += msm-pcm-routing-devdep.o |
| 178 | endif |
| 179 | ifdef CONFIG_QTI_PP |
| 180 | PLATFORM_OBJS += msm-qti-pp-config.o |
| 181 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 182 | |
| 183 | LINUX_INC += -Iinclude/linux |
| 184 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 185 | INCS += $(COMMON_INC) \ |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 186 | $(UAPI_INC) |
| 187 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 188 | EXTRA_CFLAGS += $(INCS) |
| 189 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 190 | CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ |
| 191 | -DANI_LITTLE_BIT_ENDIAN \ |
| 192 | -DDOT11F_LITTLE_ENDIAN_HOST \ |
| 193 | -DANI_COMPILER_TYPE_GCC \ |
| 194 | -DANI_OS_TYPE_ANDROID=6 \ |
| 195 | -DPTT_SOCK_SVC_ENABLE \ |
| 196 | -Wall\ |
| 197 | -Werror\ |
| 198 | -D__linux__ |
| 199 | |
| 200 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 201 | |
| 202 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 203 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 204 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 205 | # will override the kernel settings. |
| 206 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 207 | EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 208 | endif |
| 209 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 210 | |
| 211 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 212 | EXTRA_CFLAGS += -Wheader-guard |
| 213 | endif |
| 214 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 215 | ifeq ($(KERNEL_BUILD), 0) |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 216 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 217 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers |
| 218 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd934x/Module.symvers |
| 219 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/sdm660_cdc/Module.symvers |
| 220 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/msm_sdw/Module.symvers |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 221 | endif |
| 222 | ifeq ($(KERNEL_BUILD), 1) |
| 223 | obj-y += codecs/ |
| 224 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 225 | # Module information used by KBuild framework |
| 226 | obj-$(CONFIG_SND_SOC_QDSP6V2) += platform_dlkm.o |
| 227 | platform_dlkm-y := $(PLATFORM_OBJS) |
| 228 | |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 229 | obj-$(CONFIG_SND_SOC_SDM450) += machine_dlkm.o |
| 230 | machine_dlkm-y := $(MACHINE_OBJS) |
| 231 | |
yang liu | 0e16b0c | 2018-08-10 12:09:21 +0800 | [diff] [blame] | 232 | obj-$(CONFIG_SND_SOC_MSM8909) += machine_int_dlkm.o |
| 233 | machine_int_dlkm-y := $(MACHINE_INT_OBJS) |
| 234 | |
Raja Mallik | dc60da5 | 2018-05-21 16:41:24 +0530 | [diff] [blame] | 235 | obj-$(CONFIG_SND_SOC_EXT_CODEC_8909) += machine_ext_dlkm.o |
| 236 | machine_ext_dlkm-y := $(MACHINE_EXT_OBJS) |
| 237 | |
Soumya Managoli | 91b8c3f | 2018-02-24 18:36:15 +0530 | [diff] [blame] | 238 | obj-$(CONFIG_SND_SOC_EXT_CODEC_SDM450) += machine_ext_dlkm.o |
| 239 | machine_ext_dlkm-y := $(MACHINE_EXT_OBJS) |
| 240 | |
Sundara Vinayagam | 43ce7c9 | 2018-05-21 16:34:47 +0530 | [diff] [blame] | 241 | obj-$(CONFIG_SND_SOC_BG_8909) += machine_dlkm.o |
| 242 | machine_dlkm-y := $(MACHINE_OBJS) |
| 243 | |
Manjunatha Madana | 80e8ffa | 2018-12-17 14:13:08 +0530 | [diff] [blame] | 244 | obj-$(CONFIG_SND_SOC_8909_DIG_CDC) += machine_digcdc_dlkm.o |
| 245 | machine_digcdc_dlkm-y := $(MACHINE_DIGCDC_OBJS) |
| 246 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 247 | obj-$(CONFIG_SND_SOC_MACHINE_SDM845) += machine_dlkm.o |
| 248 | machine_dlkm-y := $(MACHINE_OBJS) |
| 249 | |
| 250 | obj-$(CONFIG_SND_SOC_EXT_CODEC) += machine_dlkm.o |
| 251 | machine_dlkm-y := $(MACHINE_OBJS) |
| 252 | |
| 253 | obj-$(CONFIG_SND_SOC_INT_CODEC) += machine_dlkm.o |
| 254 | machine_dlkm-y := $(MACHINE_OBJS) |
| 255 | |
| 256 | obj-$(CONFIG_SND_SOC_CPE) += cpe_lsm_dlkm.o |
| 257 | cpe_lsm_dlkm-y := $(CPE_LSM_OBJS) |
| 258 | |
| 259 | # inject some build related information |
| 260 | DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\" |