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 Codecs ############ |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 79 | ifdef CONFIG_WCD9XXX_CODEC_CORE |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 80 | CORE_OBJS += wcd9xxx-rst.o |
| 81 | CORE_OBJS += wcd9xxx-core-init.o |
| 82 | CORE_OBJS += wcd9xxx-core.o |
| 83 | CORE_OBJS += wcd9xxx-irq.o |
| 84 | CORE_OBJS += wcd9xxx-slimslave.o |
| 85 | CORE_OBJS += wcd9xxx-utils.o |
| 86 | CORE_OBJS += wcd9335-regmap.o |
| 87 | CORE_OBJS += wcd9335-tables.o |
| 88 | CORE_OBJS += msm-cdc-pinctrl.o |
| 89 | CORE_OBJS += msm-cdc-supply.o |
| 90 | CORE_OBJS += wcd934x/wcd934x-regmap.o |
| 91 | CORE_OBJS += wcd934x/wcd934x-tables.o |
Vidyakumar Athota | aa0da74 | 2018-02-28 15:13:50 -0800 | [diff] [blame] | 92 | CORE_OBJS += wcd9360/wcd9360-regmap.o |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 93 | endif |
| 94 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 95 | ifdef CONFIG_SND_SOC_WCD9XXX_V2 |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 96 | WCD9XXX_OBJS += wcd9xxx-common-v2.o |
| 97 | WCD9XXX_OBJS += wcd9xxx-resmgr-v2.o |
| 98 | WCD9XXX_OBJS += wcdcal-hwdep.o |
| 99 | WCD9XXX_OBJS += wcd9xxx-soc-init.o |
| 100 | WCD9XXX_OBJS += wcd-dsp-utils.o |
| 101 | WCD9XXX_OBJS += wcd-dsp-mgr.o |
| 102 | WCD9XXX_OBJS += audio-ext-clk-up.o |
| 103 | endif |
| 104 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 105 | ifdef CONFIG_SND_SOC_WCD9335 |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 106 | WCD9335_OBJS += wcd9335.o |
| 107 | endif |
| 108 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 109 | ifdef CONFIG_SND_SOC_WSA881X |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 110 | WSA881X_OBJS += wsa881x.o |
| 111 | WSA881X_OBJS += wsa881x-tables.o |
| 112 | WSA881X_OBJS += wsa881x-regmap.o |
| 113 | WSA881X_OBJS += wsa881x-temp-sensor.o |
| 114 | endif |
| 115 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 116 | ifdef CONFIG_SND_SOC_MSM_STUB |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 117 | STUB_OBJS += msm_stub.o |
| 118 | endif |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 119 | ifdef CONFIG_SND_SOC_WCD_SPI |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 120 | SPI_OBJS += wcd-spi.o |
| 121 | endif |
| 122 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 123 | ifdef CONFIG_SND_SOC_WCD_CPE |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 124 | WCD_CPE_OBJS += wcd_cpe_core.o |
| 125 | WCD_CPE_OBJS += wcd_cpe_services.o |
| 126 | endif |
| 127 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 128 | ifdef CONFIG_SND_SOC_WCD_MBHC |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 129 | MBHC_OBJS += wcd-mbhc-v2.o |
| 130 | endif |
| 131 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 132 | ifdef CONFIG_SND_SOC_WCD_MBHC_ADC |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 133 | MBHC_OBJS += wcd-mbhc-adc.o |
| 134 | endif |
| 135 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 136 | ifdef CONFIG_SND_SOC_WCD_MBHC_LEGACY |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 137 | MBHC_OBJS += wcd-mbhc-legacy.o |
| 138 | endif |
| 139 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 140 | ifdef CONFIG_SND_SOC_MSM_HDMI_CODEC_RX |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 141 | HDMICODEC_OBJS += msm_hdmi_codec_rx.o |
| 142 | endif |
| 143 | |
| 144 | LINUX_INC += -Iinclude/linux |
| 145 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 146 | INCS += $(COMMON_INC) \ |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 147 | $(UAPI_INC) |
| 148 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 149 | |
| 150 | EXTRA_CFLAGS += $(INCS) |
| 151 | |
| 152 | |
| 153 | CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ |
| 154 | -DANI_LITTLE_BIT_ENDIAN \ |
| 155 | -DDOT11F_LITTLE_ENDIAN_HOST \ |
| 156 | -DANI_COMPILER_TYPE_GCC \ |
| 157 | -DANI_OS_TYPE_ANDROID=6 \ |
| 158 | -DPTT_SOCK_SVC_ENABLE \ |
| 159 | -Wall\ |
| 160 | -Werror\ |
| 161 | -D__linux__ |
| 162 | |
| 163 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 164 | |
| 165 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 166 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 167 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 168 | # will override the kernel settings. |
| 169 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 170 | EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 171 | endif |
| 172 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 173 | |
| 174 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 175 | EXTRA_CFLAGS += -Wheader-guard |
| 176 | endif |
| 177 | |
| 178 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 179 | ifeq ($(KERNEL_BUILD), 0) |
Meng Wang | e61ddb0 | 2018-03-07 11:18:35 +0800 | [diff] [blame] | 180 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 181 | 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] | 182 | endif |
| 183 | |
| 184 | ifeq ($(KERNEL_BUILD), 1) |
| 185 | obj-y += wcd934x/ |
| 186 | obj-y += sdm660_cdc/ |
| 187 | obj-y += msm_sdw/ |
Karthikeyan Mani | d27acb3 | 2018-05-17 17:32:47 -0700 | [diff] [blame] | 188 | obj-y += wcd9360/ |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 189 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 190 | # Module information used by KBuild framework |
| 191 | obj-$(CONFIG_WCD9XXX_CODEC_CORE) += wcd_core_dlkm.o |
| 192 | wcd_core_dlkm-y := $(CORE_OBJS) |
| 193 | |
| 194 | obj-$(CONFIG_SND_SOC_WCD9XXX_V2) += wcd9xxx_dlkm.o |
| 195 | wcd9xxx_dlkm-y := $(WCD9XXX_OBJS) |
| 196 | |
| 197 | obj-$(CONFIG_SND_SOC_WCD9335) += wcd9335_dlkm.o |
| 198 | wcd9335_dlkm-y := $(WCD9335_OBJS) |
| 199 | |
| 200 | obj-$(CONFIG_SND_SOC_WSA881X) += wsa881x_dlkm.o |
| 201 | wsa881x_dlkm-y := $(WSA881X_OBJS) |
| 202 | |
| 203 | obj-$(CONFIG_SND_SOC_MSM_STUB) += stub_dlkm.o |
| 204 | stub_dlkm-y := $(STUB_OBJS) |
| 205 | |
| 206 | obj-$(CONFIG_SND_SOC_WCD_CPE) += wcd_cpe_dlkm.o |
| 207 | wcd_cpe_dlkm-y := $(WCD_CPE_OBJS) |
| 208 | |
| 209 | obj-$(CONFIG_SND_SOC_WCD_SPI) += wcd_spi_dlkm.o |
| 210 | wcd_spi_dlkm-y := $(SPI_OBJS) |
| 211 | |
| 212 | obj-$(CONFIG_SND_SOC_WCD_MBHC) += mbhc_dlkm.o |
| 213 | mbhc_dlkm-y := $(MBHC_OBJS) |
| 214 | |
| 215 | obj-$(CONFIG_SND_SOC_MSM_HDMI_CODEC_RX) += hdmi_dlkm.o |
| 216 | hdmi_dlkm-y := $(HDMICODEC_OBJS) |
| 217 | |
| 218 | # inject some build related information |
| 219 | DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\" |