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