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 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 9 | ifeq ($(KERNEL_BUILD), 1) |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 10 | # These are configurable via Kconfig for kernel-based builds |
| 11 | # Need to explicitly configure for Android-based builds |
Sudheer Papothi | 8d34b2e | 2018-05-23 06:34:36 +0530 | [diff] [blame] | 12 | AUDIO_BLD_DIR := $(ANDROID_BUILD_TOP)/kernel/msm-4.14 |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 13 | AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio |
| 14 | endif |
| 15 | |
| 16 | ifeq ($(KERNEL_BUILD), 0) |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 17 | ifeq ($(CONFIG_ARCH_SDM845), y) |
| 18 | include $(AUDIO_ROOT)/config/sdm845auto.conf |
| 19 | export |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 20 | INCS += -include $(AUDIO_ROOT)/config/sdm845autoconf.h |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 21 | endif |
| 22 | ifeq ($(CONFIG_ARCH_SDM670), y) |
| 23 | include $(AUDIO_ROOT)/config/sdm670auto.conf |
| 24 | export |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 25 | INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.h |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 26 | endif |
Laxminath Kasam | 942d1c6 | 2017-12-29 11:02:22 +0530 | [diff] [blame] | 27 | ifeq ($(CONFIG_ARCH_SDM450), y) |
| 28 | include $(AUDIO_ROOT)/config/sdm670auto.conf |
| 29 | export |
| 30 | INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.h |
| 31 | endif |
Banajit Goswami | f58e5fc | 2018-04-11 14:10:09 -0700 | [diff] [blame] | 32 | ifeq ($(CONFIG_ARCH_SM8150), y) |
Xiaoyu Ye | 60c105d | 2018-04-12 12:43:13 -0700 | [diff] [blame] | 33 | include $(AUDIO_ROOT)/config/sm8150auto.conf |
Meng Wang | 5fddb8d | 2018-01-23 16:56:56 +0800 | [diff] [blame] | 34 | export |
Xiaoyu Ye | 60c105d | 2018-04-12 12:43:13 -0700 | [diff] [blame] | 35 | INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h |
Meng Wang | 5fddb8d | 2018-01-23 16:56:56 +0800 | [diff] [blame] | 36 | endif |
Salendarsingh Gaud | ad97889 | 2018-05-14 16:53:09 +0530 | [diff] [blame] | 37 | ifeq ($(CONFIG_ARCH_SM6150), y) |
Laxminath Kasam | 144eabc | 2018-05-31 10:44:53 +0530 | [diff] [blame] | 38 | include $(AUDIO_ROOT)/config/sm6150auto.conf |
Abhishek Arpure | 6d74b70 | 2018-04-05 13:50:25 +0530 | [diff] [blame] | 39 | export |
Laxminath Kasam | 144eabc | 2018-05-31 10:44:53 +0530 | [diff] [blame] | 40 | INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h |
Abhishek Arpure | 6d74b70 | 2018-04-05 13:50:25 +0530 | [diff] [blame] | 41 | endif |
Sudheer Papothi | e3842cf | 2018-03-31 02:27:42 +0530 | [diff] [blame] | 42 | ifeq ($(CONFIG_ARCH_SDMSHRIKE), y) |
Xiaoyu Ye | 60c105d | 2018-04-12 12:43:13 -0700 | [diff] [blame] | 43 | include $(AUDIO_ROOT)/config/sm8150auto.conf |
Sudheer Papothi | e3842cf | 2018-03-31 02:27:42 +0530 | [diff] [blame] | 44 | export |
Xiaoyu Ye | 60c105d | 2018-04-12 12:43:13 -0700 | [diff] [blame] | 45 | INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h |
Sudheer Papothi | e3842cf | 2018-03-31 02:27:42 +0530 | [diff] [blame] | 46 | endif |
Mangesh Kunchamwar | 0bf1f57 | 2018-05-24 19:58:42 +0530 | [diff] [blame] | 47 | ifeq ($(CONFIG_ARCH_QCS405), y) |
| 48 | include $(AUDIO_ROOT)/config/qcs405auto.conf |
| 49 | export |
| 50 | INCS += -include $(AUDIO_ROOT)/config/qcs405autoconf.h |
| 51 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 52 | endif |
| 53 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 54 | # As per target team, build is done as follows: |
| 55 | # Defconfig : build with default flags |
| 56 | # Slub : defconfig + CONFIG_SLUB_DEBUG := y + |
| 57 | # CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y |
| 58 | # Perf : Using appropriate msmXXXX-perf_defconfig |
| 59 | # |
| 60 | # Shipment builds (user variants) should not have any debug feature |
| 61 | # enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds |
| 62 | # are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since |
| 63 | # there is no other way to identify defconfig builds, QTI internal |
| 64 | # representation of perf builds (identified using the string 'perf'), |
| 65 | # is used to identify if the build is a slub or defconfig one. This |
| 66 | # way no critical debug feature will be enabled for perf and shipment |
| 67 | # builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT |
| 68 | # config. |
| 69 | |
| 70 | ############ UAPI ############ |
| 71 | UAPI_DIR := uapi |
| 72 | UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR) |
| 73 | |
| 74 | ############ COMMON ############ |
| 75 | COMMON_DIR := include |
| 76 | COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR) |
| 77 | |
| 78 | ############ ASoC Drivers ############ |
| 79 | |
| 80 | |
| 81 | # for SDM6xx sound card driver |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 82 | ifdef CONFIG_SND_SOC_SDM670 |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 83 | MACHINE_OBJS += sdm660-common.o |
| 84 | endif |
| 85 | |
| 86 | # for SDM6xx sound card driver |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 87 | ifdef CONFIG_SND_SOC_INT_CODEC |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 88 | MACHINE_OBJS += sdm660-internal.o |
| 89 | endif |
| 90 | |
| 91 | # for SDM6xx sound card driver |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 92 | ifdef CONFIG_SND_SOC_EXT_CODEC |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 93 | MACHINE_OBJS += sdm660-external.o |
| 94 | MACHINE_OBJS += sdm660-ext-dai-links.o |
| 95 | endif |
| 96 | |
| 97 | # for SDM845 sound card driver |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 98 | ifdef CONFIG_SND_SOC_MACHINE_SDM845 |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 99 | MACHINE_OBJS += sdm845.o |
| 100 | endif |
| 101 | |
Xiaoyu Ye | 60c105d | 2018-04-12 12:43:13 -0700 | [diff] [blame] | 102 | # for SM8150 sound card driver |
| 103 | ifdef CONFIG_SND_SOC_SM8150 |
Derek Chen | 3995547 | 2018-06-26 21:52:59 -0400 | [diff] [blame] | 104 | MACHINE_OBJS += sa8155.o |
Xiaoyu Ye | 60c105d | 2018-04-12 12:43:13 -0700 | [diff] [blame] | 105 | MACHINE_OBJS += sm8150.o |
Derek Chen | 3995547 | 2018-06-26 21:52:59 -0400 | [diff] [blame] | 106 | MACHINE_OBJS += machine_815x_init.o |
Meng Wang | 5fddb8d | 2018-01-23 16:56:56 +0800 | [diff] [blame] | 107 | endif |
| 108 | |
Laxminath Kasam | 144eabc | 2018-05-31 10:44:53 +0530 | [diff] [blame] | 109 | # for SM6150 sound card driver |
| 110 | ifdef CONFIG_SND_SOC_SM6150 |
| 111 | MACHINE_OBJS += sm6150.o |
| 112 | endif |
| 113 | |
Mangesh Kunchamwar | 0bf1f57 | 2018-05-24 19:58:42 +0530 | [diff] [blame] | 114 | # for qcs405 sound card driver |
| 115 | ifdef CONFIG_SND_SOC_QCS405 |
| 116 | MACHINE_OBJS += qcs405.o |
| 117 | endif |
| 118 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 119 | ifdef CONFIG_SND_SOC_CPE |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 120 | CPE_LSM_OBJS += msm-cpe-lsm.o |
| 121 | endif |
| 122 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 123 | ifdef CONFIG_SND_SOC_QDSP6V2 |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 124 | PLATFORM_OBJS += msm-audio-effects-q6-v2.o |
| 125 | PLATFORM_OBJS += msm-compress-q6-v2.o |
| 126 | PLATFORM_OBJS += msm-dai-fe.o |
| 127 | PLATFORM_OBJS += msm-dai-q6-hdmi-v2.o |
| 128 | PLATFORM_OBJS += msm-dai-q6-v2.o |
| 129 | PLATFORM_OBJS += msm-dai-slim.o |
| 130 | PLATFORM_OBJS += msm-dai-stub-v2.o |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 131 | PLATFORM_OBJS += msm-lsm-client.o |
| 132 | PLATFORM_OBJS += msm-pcm-afe-v2.o |
| 133 | PLATFORM_OBJS += msm-pcm-dtmf-v2.o |
| 134 | PLATFORM_OBJS += msm-pcm-hostless.o |
| 135 | PLATFORM_OBJS += msm-pcm-host-voice-v2.o |
| 136 | PLATFORM_OBJS += msm-pcm-loopback-v2.o |
| 137 | PLATFORM_OBJS += msm-pcm-q6-noirq.o |
| 138 | PLATFORM_OBJS += msm-pcm-q6-v2.o |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 139 | PLATFORM_OBJS += msm-pcm-routing-v2.o |
| 140 | PLATFORM_OBJS += msm-pcm-voice-v2.o |
| 141 | PLATFORM_OBJS += msm-pcm-voip-v2.o |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 142 | PLATFORM_OBJS += msm-transcode-loopback-q6-v2.o |
| 143 | PLATFORM_OBJS += platform_init.o |
| 144 | endif |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 145 | ifdef CONFIG_DOLBY_DS2 |
| 146 | PLATFORM_OBJS += msm-ds2-dap-config.o |
| 147 | endif |
| 148 | ifdef CONFIG_DOLBY_LICENSE |
| 149 | PLATFORM_OBJS += msm-ds2-dap-config.o |
| 150 | endif |
Laxminath Kasam | 9a8caf4 | 2018-01-03 21:13:17 +0530 | [diff] [blame] | 151 | ifdef CONFIG_SND_HWDEP_ROUTING |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 152 | PLATFORM_OBJS += msm-pcm-routing-devdep.o |
| 153 | endif |
| 154 | ifdef CONFIG_QTI_PP |
| 155 | PLATFORM_OBJS += msm-qti-pp-config.o |
| 156 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 157 | |
| 158 | LINUX_INC += -Iinclude/linux |
| 159 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 160 | INCS += $(COMMON_INC) \ |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 161 | $(UAPI_INC) |
| 162 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 163 | EXTRA_CFLAGS += $(INCS) |
| 164 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 165 | CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ |
| 166 | -DANI_LITTLE_BIT_ENDIAN \ |
| 167 | -DDOT11F_LITTLE_ENDIAN_HOST \ |
| 168 | -DANI_COMPILER_TYPE_GCC \ |
| 169 | -DANI_OS_TYPE_ANDROID=6 \ |
| 170 | -DPTT_SOCK_SVC_ENABLE \ |
| 171 | -Wall\ |
| 172 | -Werror\ |
| 173 | -D__linux__ |
| 174 | |
| 175 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 176 | |
| 177 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 178 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 179 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 180 | # will override the kernel settings. |
| 181 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 182 | EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 183 | endif |
| 184 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 185 | |
| 186 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 187 | EXTRA_CFLAGS += -Wheader-guard |
| 188 | endif |
| 189 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 190 | ifeq ($(KERNEL_BUILD), 0) |
Meng Wang | e61ddb0 | 2018-03-07 11:18:35 +0800 | [diff] [blame] | 191 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 192 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers |
| 193 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd934x/Module.symvers |
Ramprasad Katkam | 997da40 | 2018-08-17 20:20:06 +0530 | [diff] [blame^] | 194 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd937x/Module.symvers |
Meng Wang | e61ddb0 | 2018-03-07 11:18:35 +0800 | [diff] [blame] | 195 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/sdm660_cdc/Module.symvers |
| 196 | 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] | 197 | endif |
| 198 | ifeq ($(KERNEL_BUILD), 1) |
| 199 | obj-y += codecs/ |
| 200 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 201 | # Module information used by KBuild framework |
| 202 | obj-$(CONFIG_SND_SOC_QDSP6V2) += platform_dlkm.o |
| 203 | platform_dlkm-y := $(PLATFORM_OBJS) |
| 204 | |
| 205 | obj-$(CONFIG_SND_SOC_MACHINE_SDM845) += machine_dlkm.o |
| 206 | machine_dlkm-y := $(MACHINE_OBJS) |
| 207 | |
Xiaoyu Ye | 60c105d | 2018-04-12 12:43:13 -0700 | [diff] [blame] | 208 | obj-$(CONFIG_SND_SOC_SM8150) += machine_dlkm.o |
Meng Wang | 5fddb8d | 2018-01-23 16:56:56 +0800 | [diff] [blame] | 209 | machine_dlkm-y := $(MACHINE_OBJS) |
| 210 | |
Laxminath Kasam | 144eabc | 2018-05-31 10:44:53 +0530 | [diff] [blame] | 211 | obj-$(CONFIG_SND_SOC_SM6150) += machine_dlkm.o |
| 212 | machine_dlkm-y := $(MACHINE_OBJS) |
| 213 | |
Mangesh Kunchamwar | 0bf1f57 | 2018-05-24 19:58:42 +0530 | [diff] [blame] | 214 | obj-$(CONFIG_SND_SOC_QCS405) += machine_dlkm.o |
| 215 | machine_dlkm-y := $(MACHINE_OBJS) |
| 216 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 217 | obj-$(CONFIG_SND_SOC_EXT_CODEC) += machine_dlkm.o |
| 218 | machine_dlkm-y := $(MACHINE_OBJS) |
| 219 | |
| 220 | obj-$(CONFIG_SND_SOC_INT_CODEC) += machine_dlkm.o |
| 221 | machine_dlkm-y := $(MACHINE_OBJS) |
| 222 | |
| 223 | obj-$(CONFIG_SND_SOC_CPE) += cpe_lsm_dlkm.o |
| 224 | cpe_lsm_dlkm-y := $(CPE_LSM_OBJS) |
| 225 | |
| 226 | # inject some build related information |
| 227 | DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\" |