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