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 |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 13 | AUDIO_BLD_DIR := $(ANDROID_BUILD_TOP)/kernel/msm-4.9 |
| 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) |
| 24 | include $(AUDIO_ROOT)/config/sdm670auto.conf |
| 25 | export |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 26 | INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.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 |
Xiaoyu Ye | e7df5cc | 2017-10-02 18:47:29 -0700 | [diff] [blame] | 33 | ifeq ($(CONFIG_ARCH_SDXPOORWILLS), y) |
| 34 | include $(AUDIO_ROOT)/config/sdxpoorwillsauto.conf |
| 35 | export |
| 36 | INCS += -include $(AUDIO_ROOT)/config/sdxpoorwillsautoconf.h |
| 37 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 38 | endif |
| 39 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 40 | # As per target team, build is done as follows: |
| 41 | # Defconfig : build with default flags |
| 42 | # Slub : defconfig + CONFIG_SLUB_DEBUG := y + |
| 43 | # CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y |
| 44 | # Perf : Using appropriate msmXXXX-perf_defconfig |
| 45 | # |
| 46 | # Shipment builds (user variants) should not have any debug feature |
| 47 | # enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds |
| 48 | # are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since |
| 49 | # there is no other way to identify defconfig builds, QTI internal |
| 50 | # representation of perf builds (identified using the string 'perf'), |
| 51 | # is used to identify if the build is a slub or defconfig one. This |
| 52 | # way no critical debug feature will be enabled for perf and shipment |
| 53 | # builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT |
| 54 | # config. |
| 55 | |
| 56 | ############ UAPI ############ |
| 57 | UAPI_DIR := uapi |
| 58 | UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR) |
| 59 | |
| 60 | ############ COMMON ############ |
| 61 | COMMON_DIR := include |
| 62 | COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR) |
| 63 | |
| 64 | ############ ASoC Drivers ############ |
| 65 | |
| 66 | |
| 67 | # for SDM6xx sound card driver |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 68 | ifdef CONFIG_SND_SOC_SDM670 |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 69 | MACHINE_OBJS += sdm660-common.o |
| 70 | endif |
| 71 | |
| 72 | # for SDM6xx sound card driver |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 73 | ifdef CONFIG_SND_SOC_INT_CODEC |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 74 | MACHINE_OBJS += sdm660-internal.o |
| 75 | endif |
| 76 | |
| 77 | # for SDM6xx sound card driver |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 78 | ifdef CONFIG_SND_SOC_EXT_CODEC |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 79 | MACHINE_OBJS += sdm660-external.o |
| 80 | MACHINE_OBJS += sdm660-ext-dai-links.o |
| 81 | endif |
| 82 | |
| 83 | # for SDM845 sound card driver |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 84 | ifdef CONFIG_SND_SOC_MACHINE_SDM845 |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 85 | MACHINE_OBJS += sdm845.o |
| 86 | endif |
| 87 | |
Xiaoyu Ye | e7df5cc | 2017-10-02 18:47:29 -0700 | [diff] [blame] | 88 | # for SDXPOORWILLS sound card driver |
| 89 | ifdef CONFIG_SND_SOC_MACHINE_SDXPOORWILLS |
| 90 | MACHINE_OBJS += sdxpoorwills.o |
| 91 | endif |
| 92 | |
Soumya Managoli | 91b8c3f | 2018-02-24 18:36:15 +0530 | [diff] [blame] | 93 | # for SDM450 internal codec sound card driver |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 94 | ifdef CONFIG_SND_SOC_SDM450 |
| 95 | MACHINE_OBJS += msm8952.o |
| 96 | endif |
| 97 | |
Soumya Managoli | 91b8c3f | 2018-02-24 18:36:15 +0530 | [diff] [blame] | 98 | # for SDM450 external codec sound card driver |
| 99 | ifdef CONFIG_SND_SOC_EXT_CODEC_SDM450 |
| 100 | MACHINE_EXT_OBJS += msm8952-slimbus.o |
| 101 | MACHINE_EXT_OBJS += msm8952-dai-links.o |
| 102 | endif |
| 103 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 104 | ifdef CONFIG_SND_SOC_CPE |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 105 | CPE_LSM_OBJS += msm-cpe-lsm.o |
| 106 | endif |
| 107 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 108 | ifdef CONFIG_SND_SOC_QDSP6V2 |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 109 | PLATFORM_OBJS += msm-audio-effects-q6-v2.o |
| 110 | PLATFORM_OBJS += msm-compress-q6-v2.o |
| 111 | PLATFORM_OBJS += msm-dai-fe.o |
| 112 | PLATFORM_OBJS += msm-dai-q6-hdmi-v2.o |
| 113 | PLATFORM_OBJS += msm-dai-q6-v2.o |
| 114 | PLATFORM_OBJS += msm-dai-slim.o |
| 115 | PLATFORM_OBJS += msm-dai-stub-v2.o |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 116 | PLATFORM_OBJS += msm-lsm-client.o |
| 117 | PLATFORM_OBJS += msm-pcm-afe-v2.o |
| 118 | PLATFORM_OBJS += msm-pcm-dtmf-v2.o |
| 119 | PLATFORM_OBJS += msm-pcm-hostless.o |
| 120 | PLATFORM_OBJS += msm-pcm-host-voice-v2.o |
| 121 | PLATFORM_OBJS += msm-pcm-loopback-v2.o |
| 122 | PLATFORM_OBJS += msm-pcm-q6-noirq.o |
| 123 | PLATFORM_OBJS += msm-pcm-q6-v2.o |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 124 | PLATFORM_OBJS += msm-pcm-routing-v2.o |
| 125 | PLATFORM_OBJS += msm-pcm-voice-v2.o |
| 126 | PLATFORM_OBJS += msm-pcm-voip-v2.o |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 127 | PLATFORM_OBJS += msm-transcode-loopback-q6-v2.o |
| 128 | PLATFORM_OBJS += platform_init.o |
| 129 | endif |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 130 | ifdef CONFIG_DOLBY_DS2 |
| 131 | PLATFORM_OBJS += msm-ds2-dap-config.o |
| 132 | endif |
| 133 | ifdef CONFIG_DOLBY_LICENSE |
| 134 | PLATFORM_OBJS += msm-ds2-dap-config.o |
| 135 | endif |
Laxminath Kasam | 27c8dcf | 2018-01-03 21:13:17 +0530 | [diff] [blame] | 136 | ifdef CONFIG_SND_HWDEP_ROUTING |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 137 | PLATFORM_OBJS += msm-pcm-routing-devdep.o |
| 138 | endif |
| 139 | ifdef CONFIG_QTI_PP |
| 140 | PLATFORM_OBJS += msm-qti-pp-config.o |
| 141 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 142 | |
| 143 | LINUX_INC += -Iinclude/linux |
| 144 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 145 | INCS += $(COMMON_INC) \ |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 146 | $(UAPI_INC) |
| 147 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 148 | EXTRA_CFLAGS += $(INCS) |
| 149 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 150 | CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ |
| 151 | -DANI_LITTLE_BIT_ENDIAN \ |
| 152 | -DDOT11F_LITTLE_ENDIAN_HOST \ |
| 153 | -DANI_COMPILER_TYPE_GCC \ |
| 154 | -DANI_OS_TYPE_ANDROID=6 \ |
| 155 | -DPTT_SOCK_SVC_ENABLE \ |
| 156 | -Wall\ |
| 157 | -Werror\ |
| 158 | -D__linux__ |
| 159 | |
| 160 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 161 | |
| 162 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 163 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 164 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 165 | # will override the kernel settings. |
| 166 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 167 | EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 168 | endif |
| 169 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 170 | |
| 171 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 172 | EXTRA_CFLAGS += -Wheader-guard |
| 173 | endif |
| 174 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 175 | ifeq ($(KERNEL_BUILD), 0) |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 176 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 177 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers |
| 178 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd934x/Module.symvers |
| 179 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/sdm660_cdc/Module.symvers |
| 180 | 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] | 181 | endif |
| 182 | ifeq ($(KERNEL_BUILD), 1) |
| 183 | obj-y += codecs/ |
| 184 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 185 | # Module information used by KBuild framework |
| 186 | obj-$(CONFIG_SND_SOC_QDSP6V2) += platform_dlkm.o |
| 187 | platform_dlkm-y := $(PLATFORM_OBJS) |
| 188 | |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 189 | obj-$(CONFIG_SND_SOC_SDM450) += machine_dlkm.o |
| 190 | machine_dlkm-y := $(MACHINE_OBJS) |
| 191 | |
Soumya Managoli | 91b8c3f | 2018-02-24 18:36:15 +0530 | [diff] [blame] | 192 | obj-$(CONFIG_SND_SOC_EXT_CODEC_SDM450) += machine_ext_dlkm.o |
| 193 | machine_ext_dlkm-y := $(MACHINE_EXT_OBJS) |
| 194 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 195 | obj-$(CONFIG_SND_SOC_MACHINE_SDM845) += machine_dlkm.o |
| 196 | machine_dlkm-y := $(MACHINE_OBJS) |
| 197 | |
| 198 | obj-$(CONFIG_SND_SOC_EXT_CODEC) += machine_dlkm.o |
| 199 | machine_dlkm-y := $(MACHINE_OBJS) |
| 200 | |
| 201 | obj-$(CONFIG_SND_SOC_INT_CODEC) += machine_dlkm.o |
| 202 | machine_dlkm-y := $(MACHINE_OBJS) |
| 203 | |
| 204 | obj-$(CONFIG_SND_SOC_CPE) += cpe_lsm_dlkm.o |
| 205 | cpe_lsm_dlkm-y := $(CPE_LSM_OBJS) |
| 206 | |
| 207 | # inject some build related information |
| 208 | DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\" |