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 |
Piyush Balwani | f9d9d1e | 2018-11-30 19:13:42 +0530 | [diff] [blame] | 12 | AUDIO_BLD_DIR := $(shell pwd)/kernel/msm-4.9 |
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) |
Aditya Bavanari | 68d3ed8 | 2018-04-08 14:34:47 +0530 | [diff] [blame] | 23 | include $(AUDIO_ROOT)/config/sdm710auto.conf |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 24 | export |
Aditya Bavanari | 68d3ed8 | 2018-04-08 14:34:47 +0530 | [diff] [blame] | 25 | INCS += -include $(AUDIO_ROOT)/config/sdm710autoconf.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) |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 28 | include $(AUDIO_ROOT)/config/sdm450auto.conf |
Laxminath Kasam | 942d1c6 | 2017-12-29 11:02:22 +0530 | [diff] [blame] | 29 | export |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 30 | INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h |
Laxminath Kasam | 942d1c6 | 2017-12-29 11:02:22 +0530 | [diff] [blame] | 31 | endif |
Vaishnavi Kommaraju | 59562a1 | 2018-04-25 19:33:46 +0530 | [diff] [blame] | 32 | ifeq ($(CONFIG_ARCH_SDM439), y) |
| 33 | include $(AUDIO_ROOT)/config/sdm450auto.conf |
| 34 | export |
| 35 | INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h |
| 36 | endif |
Sundara Vinayagam | 3983833 | 2018-05-23 12:04:25 +0530 | [diff] [blame] | 37 | ifeq ($(CONFIG_ARCH_MSM8909), y) |
Manjunatha Madana | 58ebedb | 2020-02-19 17:39:05 +0530 | [diff] [blame] | 38 | ifeq ($(CONFIG_MSM_BGCOM), y) |
| 39 | include $(AUDIO_ROOT)/config/msm8909auto.conf |
| 40 | export |
| 41 | INCS += -include $(AUDIO_ROOT)/config/msm8909autoconf.h |
| 42 | endif |
| 43 | ifeq ($(CONFIG_MSM_8905), m) |
| 44 | include $(AUDIO_ROOT)/config/msm8905auto.conf |
| 45 | export |
| 46 | INCS += -include $(AUDIO_ROOT)/config/msm8905autoconf.h |
| 47 | endif |
Sundara Vinayagam | 3983833 | 2018-05-23 12:04:25 +0530 | [diff] [blame] | 48 | endif |
Soumya Managoli | d63fb8e | 2018-05-08 17:28:01 +0530 | [diff] [blame] | 49 | ifeq ($(CONFIG_ARCH_MSM8917), y) |
| 50 | include $(AUDIO_ROOT)/config/sdm450auto.conf |
| 51 | export |
| 52 | INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h |
| 53 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 54 | endif |
| 55 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 56 | # As per target team, build is done as follows: |
| 57 | # Defconfig : build with default flags |
| 58 | # Slub : defconfig + CONFIG_SLUB_DEBUG := y + |
| 59 | # CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y |
| 60 | # Perf : Using appropriate msmXXXX-perf_defconfig |
| 61 | # |
| 62 | # Shipment builds (user variants) should not have any debug feature |
| 63 | # enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds |
| 64 | # are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since |
| 65 | # there is no other way to identify defconfig builds, QTI internal |
| 66 | # representation of perf builds (identified using the string 'perf'), |
| 67 | # is used to identify if the build is a slub or defconfig one. This |
| 68 | # way no critical debug feature will be enabled for perf and shipment |
| 69 | # builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT |
| 70 | # config. |
| 71 | |
| 72 | ############ UAPI ############ |
| 73 | UAPI_DIR := uapi |
| 74 | UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR) |
| 75 | |
| 76 | ############ COMMON ############ |
| 77 | COMMON_DIR := include |
| 78 | COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR) |
| 79 | |
| 80 | ############ ASoC Codecs ############ |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 81 | ifdef CONFIG_WCD9XXX_CODEC_CORE |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 82 | CORE_OBJS += wcd9xxx-rst.o |
| 83 | CORE_OBJS += wcd9xxx-core-init.o |
| 84 | CORE_OBJS += wcd9xxx-core.o |
| 85 | CORE_OBJS += wcd9xxx-irq.o |
| 86 | CORE_OBJS += wcd9xxx-slimslave.o |
| 87 | CORE_OBJS += wcd9xxx-utils.o |
| 88 | CORE_OBJS += wcd9335-regmap.o |
| 89 | CORE_OBJS += wcd9335-tables.o |
| 90 | CORE_OBJS += msm-cdc-pinctrl.o |
| 91 | CORE_OBJS += msm-cdc-supply.o |
| 92 | CORE_OBJS += wcd934x/wcd934x-regmap.o |
| 93 | CORE_OBJS += wcd934x/wcd934x-tables.o |
| 94 | endif |
| 95 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 96 | ifdef CONFIG_SND_SOC_WCD9XXX_V2 |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 97 | WCD9XXX_OBJS += wcd9xxx-common-v2.o |
| 98 | WCD9XXX_OBJS += wcd9xxx-resmgr-v2.o |
| 99 | WCD9XXX_OBJS += wcdcal-hwdep.o |
| 100 | WCD9XXX_OBJS += wcd9xxx-soc-init.o |
| 101 | WCD9XXX_OBJS += wcd-dsp-utils.o |
| 102 | WCD9XXX_OBJS += wcd-dsp-mgr.o |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 103 | endif |
| 104 | |
| 105 | ifdef CONFIG_COMMON_CLK_QCOM |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 106 | WCD9XXX_OBJS += audio-ext-clk-up.o |
| 107 | endif |
| 108 | |
Soumya Managoli | 91b8c3f | 2018-02-24 18:36:15 +0530 | [diff] [blame] | 109 | ifdef CONFIG_COMMON_CLK_MSM |
| 110 | WCD9XXX_OBJS += audio-ext-clk.o |
| 111 | endif |
| 112 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 113 | ifdef CONFIG_SND_SOC_WCD9335 |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 114 | WCD9335_OBJS += wcd9335.o |
| 115 | endif |
| 116 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 117 | ifdef CONFIG_SND_SOC_WSA881X |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 118 | WSA881X_OBJS += wsa881x.o |
| 119 | WSA881X_OBJS += wsa881x-tables.o |
| 120 | WSA881X_OBJS += wsa881x-regmap.o |
| 121 | WSA881X_OBJS += wsa881x-temp-sensor.o |
| 122 | endif |
| 123 | |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 124 | ifdef CONFIG_SND_SOC_WSA881X_ANALOG |
| 125 | WSA881X_ANALOG_OBJS += wsa881x-analog.o |
| 126 | WSA881X_ANALOG_OBJS += wsa881x-tables-analog.o |
| 127 | WSA881X_ANALOG_OBJS += wsa881x-regmap-analog.o |
| 128 | endif |
| 129 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 130 | ifdef CONFIG_SND_SOC_MSM_STUB |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 131 | STUB_OBJS += msm_stub.o |
| 132 | endif |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 133 | ifdef CONFIG_SND_SOC_WCD_SPI |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 134 | SPI_OBJS += wcd-spi.o |
| 135 | endif |
| 136 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 137 | ifdef CONFIG_SND_SOC_WCD_CPE |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 138 | WCD_CPE_OBJS += wcd_cpe_core.o |
| 139 | WCD_CPE_OBJS += wcd_cpe_services.o |
| 140 | endif |
| 141 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 142 | ifdef CONFIG_SND_SOC_WCD_MBHC |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 143 | MBHC_OBJS += wcd-mbhc-v2.o |
| 144 | endif |
| 145 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 146 | ifdef CONFIG_SND_SOC_WCD_MBHC_ADC |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 147 | MBHC_OBJS += wcd-mbhc-adc.o |
| 148 | endif |
| 149 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 150 | ifdef CONFIG_SND_SOC_WCD_MBHC_LEGACY |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 151 | MBHC_OBJS += wcd-mbhc-legacy.o |
| 152 | endif |
| 153 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 154 | ifdef CONFIG_SND_SOC_MSM_HDMI_CODEC_RX |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 155 | HDMICODEC_OBJS += msm_hdmi_codec_rx.o |
| 156 | endif |
| 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 | |
| 164 | EXTRA_CFLAGS += $(INCS) |
| 165 | |
| 166 | |
| 167 | CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ |
| 168 | -DANI_LITTLE_BIT_ENDIAN \ |
| 169 | -DDOT11F_LITTLE_ENDIAN_HOST \ |
| 170 | -DANI_COMPILER_TYPE_GCC \ |
| 171 | -DANI_OS_TYPE_ANDROID=6 \ |
| 172 | -DPTT_SOCK_SVC_ENABLE \ |
| 173 | -Wall\ |
| 174 | -Werror\ |
| 175 | -D__linux__ |
| 176 | |
| 177 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 178 | |
| 179 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 180 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 181 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 182 | # will override the kernel settings. |
| 183 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 184 | EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 185 | endif |
| 186 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 187 | |
| 188 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 189 | EXTRA_CFLAGS += -Wheader-guard |
| 190 | endif |
| 191 | |
| 192 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 193 | ifeq ($(KERNEL_BUILD), 0) |
Sundara Vinayagam | 3983833 | 2018-05-23 12:04:25 +0530 | [diff] [blame] | 194 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 195 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 196 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 197 | endif |
| 198 | |
| 199 | ifeq ($(KERNEL_BUILD), 1) |
| 200 | obj-y += wcd934x/ |
| 201 | obj-y += sdm660_cdc/ |
| 202 | obj-y += msm_sdw/ |
| 203 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 204 | # Module information used by KBuild framework |
| 205 | obj-$(CONFIG_WCD9XXX_CODEC_CORE) += wcd_core_dlkm.o |
| 206 | wcd_core_dlkm-y := $(CORE_OBJS) |
| 207 | |
| 208 | obj-$(CONFIG_SND_SOC_WCD9XXX_V2) += wcd9xxx_dlkm.o |
| 209 | wcd9xxx_dlkm-y := $(WCD9XXX_OBJS) |
| 210 | |
| 211 | obj-$(CONFIG_SND_SOC_WCD9335) += wcd9335_dlkm.o |
| 212 | wcd9335_dlkm-y := $(WCD9335_OBJS) |
| 213 | |
| 214 | obj-$(CONFIG_SND_SOC_WSA881X) += wsa881x_dlkm.o |
| 215 | wsa881x_dlkm-y := $(WSA881X_OBJS) |
| 216 | |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 217 | obj-$(CONFIG_SND_SOC_WSA881X_ANALOG) += wsa881x_analog_dlkm.o |
| 218 | wsa881x_analog_dlkm-y := $(WSA881X_ANALOG_OBJS) |
| 219 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 220 | obj-$(CONFIG_SND_SOC_MSM_STUB) += stub_dlkm.o |
| 221 | stub_dlkm-y := $(STUB_OBJS) |
| 222 | |
| 223 | obj-$(CONFIG_SND_SOC_WCD_CPE) += wcd_cpe_dlkm.o |
| 224 | wcd_cpe_dlkm-y := $(WCD_CPE_OBJS) |
| 225 | |
| 226 | obj-$(CONFIG_SND_SOC_WCD_SPI) += wcd_spi_dlkm.o |
| 227 | wcd_spi_dlkm-y := $(SPI_OBJS) |
| 228 | |
| 229 | obj-$(CONFIG_SND_SOC_WCD_MBHC) += mbhc_dlkm.o |
| 230 | mbhc_dlkm-y := $(MBHC_OBJS) |
| 231 | |
| 232 | obj-$(CONFIG_SND_SOC_MSM_HDMI_CODEC_RX) += hdmi_dlkm.o |
| 233 | hdmi_dlkm-y := $(HDMICODEC_OBJS) |
| 234 | |
| 235 | # inject some build related information |
| 236 | DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\" |