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 | TARGET_KERNEL_VERSION := 4.9 |
| 10 | |
| 11 | # These are configurable via Kconfig for kernel-based builds |
| 12 | # Need to explicitly configure for Android-based builds |
| 13 | ifeq ($(CONFIG_ARCH_SDM845), y) |
| 14 | TARGET_KERNEL_VERSION := 4.9 |
| 15 | endif |
| 16 | ifeq ($(CONFIG_ARCH_SDM670), y) |
| 17 | TARGET_KERNEL_VERSION := 4.9 |
| 18 | endif |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 19 | ifeq ($(CONFIG_ARCH_SDM450), y) |
| 20 | TARGET_KERNEL_VERSION := 4.9 |
| 21 | endif |
Vaishnavi Kommaraju | 59562a1 | 2018-04-25 19:33:46 +0530 | [diff] [blame^] | 22 | ifeq ($(CONFIG_ARCH_SDM439), y) |
| 23 | TARGET_KERNEL_VERSION := 4.9 |
| 24 | endif |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 25 | KDIR := $(TOP)/kernel/msm-$(TARGET_KERNEL_VERSION) |
| 26 | |
| 27 | ifeq ($(KERNEL_BUILD), 1) |
| 28 | AUDIO_ROOT := $(KDIR)/techpack/audio |
| 29 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 30 | |
| 31 | ifeq ($(KERNEL_BUILD), 0) |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 32 | ifeq ($(CONFIG_ARCH_SDM845), y) |
| 33 | include $(AUDIO_ROOT)/config/sdm845auto.conf |
| 34 | export |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 35 | INCS += -include $(AUDIO_ROOT)/config/sdm845autoconf.h |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 36 | endif |
| 37 | ifeq ($(CONFIG_ARCH_SDM670), y) |
Aditya Bavanari | 68d3ed8 | 2018-04-08 14:34:47 +0530 | [diff] [blame] | 38 | include $(AUDIO_ROOT)/config/sdm710auto.conf |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 39 | export |
Aditya Bavanari | 68d3ed8 | 2018-04-08 14:34:47 +0530 | [diff] [blame] | 40 | INCS += -include $(AUDIO_ROOT)/config/sdm710autoconf.h |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 41 | endif |
Laxminath Kasam | 942d1c6 | 2017-12-29 11:02:22 +0530 | [diff] [blame] | 42 | ifeq ($(CONFIG_ARCH_SDM450), y) |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 43 | include $(AUDIO_ROOT)/config/sdm450auto.conf |
Laxminath Kasam | 942d1c6 | 2017-12-29 11:02:22 +0530 | [diff] [blame] | 44 | export |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 45 | INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h |
Laxminath Kasam | 942d1c6 | 2017-12-29 11:02:22 +0530 | [diff] [blame] | 46 | endif |
Vaishnavi Kommaraju | 59562a1 | 2018-04-25 19:33:46 +0530 | [diff] [blame^] | 47 | ifeq ($(CONFIG_ARCH_SDM439), y) |
| 48 | include $(AUDIO_ROOT)/config/sdm450auto.conf |
| 49 | export |
| 50 | INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.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 | ############ IPC ############ |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 79 | ifdef CONFIG_MSM_QDSP6_APRV2 |
| 80 | APRV_GLINK += apr.o |
| 81 | APRV_GLINK += apr_v2.o |
| 82 | APRV_GLINK += apr_tal.o |
Soumya Managoli | 5beccb8 | 2018-03-02 19:31:23 +0530 | [diff] [blame] | 83 | APRV_GLINK += apr_dummy.o |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 84 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 85 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 86 | ifdef CONFIG_MSM_QDSP6_APRV2_GLINK |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 87 | APRV_GLINK += apr.o |
| 88 | APRV_GLINK += apr_v2.o |
| 89 | APRV_GLINK += apr_tal_glink.o |
Laxminath Kasam | 31b26c5 | 2018-02-12 16:32:01 +0530 | [diff] [blame] | 90 | APRV_GLINK += apr_dummy.o |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 91 | endif |
| 92 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 93 | ifdef CONFIG_MSM_QDSP6_APRV3_GLINK |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 94 | APRV_GLINK += apr.o |
| 95 | APRV_GLINK += apr_v3.o |
| 96 | APRV_GLINK += apr_tal_glink.o |
Laxminath Kasam | 31b26c5 | 2018-02-12 16:32:01 +0530 | [diff] [blame] | 97 | APRV_GLINK += apr_dummy.o |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 98 | endif |
| 99 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 100 | ifdef CONFIG_WCD_DSP_GLINK |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 101 | WDSP_GLINK += wcd-dsp-glink.o |
| 102 | endif |
| 103 | |
| 104 | LINUX_INC += -Iinclude/linux |
| 105 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 106 | INCS += $(COMMON_INC) \ |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 107 | $(UAPI_INC) |
| 108 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 109 | EXTRA_CFLAGS += $(INCS) |
| 110 | |
| 111 | |
| 112 | CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ |
| 113 | -DANI_LITTLE_BIT_ENDIAN \ |
| 114 | -DDOT11F_LITTLE_ENDIAN_HOST \ |
| 115 | -DANI_COMPILER_TYPE_GCC \ |
| 116 | -DANI_OS_TYPE_ANDROID=6 \ |
| 117 | -DPTT_SOCK_SVC_ENABLE \ |
| 118 | -Wall\ |
| 119 | -Werror\ |
| 120 | -D__linux__ |
| 121 | |
| 122 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 123 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 124 | ifeq ($(KERNEL_BUILD), 0) |
| 125 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 126 | HEADER_INSTALL_DIR := $(TOP)/kernel/msm-$(TARGET_KERNEL_VERSION)/scripts |
| 127 | UAPI_OUT := $(OUT)/obj/vendor/qcom/opensource/audio-kernel/include |
| 128 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ avtimer.h;) |
| 129 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio.h;) |
| 130 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_aac.h;) |
| 131 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_ac3.h;) |
| 132 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_alac.h;) |
| 133 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_amrnb.h;) |
| 134 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_amrwb.h;) |
| 135 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_amrwbplus.h;) |
| 136 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_ape.h;) |
| 137 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_calibration.h;) |
| 138 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_g711_dec.h;) |
| 139 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_g711.h;) |
| 140 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_mvs.h;) |
| 141 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_qcp.h;) |
| 142 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_sbc.h;) |
| 143 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_voicememo.h;) |
| 144 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_wma.h;) |
| 145 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_wmapro.h;) |
| 146 | |
| 147 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/sound/ $(AUDIO_ROOT)/include/uapi/sound/ audio_effects.h;) |
| 148 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/sound/ $(AUDIO_ROOT)/include/uapi/sound/ audio_slimslave.h;) |
| 149 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/sound/ $(AUDIO_ROOT)/include/uapi/sound/ devdep_params.h;) |
| 150 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/sound/ $(AUDIO_ROOT)/include/uapi/sound/ lsm_params.h;) |
| 151 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/sound/ $(AUDIO_ROOT)/include/uapi/sound/ msmcal-hwdep.h;) |
| 152 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/sound/ $(AUDIO_ROOT)/include/uapi/sound/ voice_params.h;) |
| 153 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/sound/ $(AUDIO_ROOT)/include/uapi/sound/ wcd-dsp-glink.h;) |
| 154 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 155 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 156 | |
| 157 | endif |
| 158 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 159 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 160 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 161 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 162 | # will override the kernel settings. |
| 163 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 164 | EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 165 | endif |
| 166 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 167 | |
| 168 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 169 | EXTRA_CFLAGS += -Wheader-guard |
| 170 | endif |
| 171 | # If the module name is not "wlan", then the define MULTI_IF_NAME to be the |
| 172 | # same a the QCA CHIP name. The host driver will then append MULTI_IF_NAME to |
| 173 | # any string that must be unique for all instances of the driver on the system. |
| 174 | # This allows multiple instances of the driver with different module names. |
| 175 | # If the module name is wlan, leave MULTI_IF_NAME undefined and the code will |
| 176 | # treat the driver as the primary driver. |
| 177 | ifneq ($(MODNAME), qdsp6v2) |
| 178 | CHIP_NAME ?= $(MODNAME) |
| 179 | CDEFINES += -DMULTI_IF_NAME=\"$(CHIP_NAME)\" |
| 180 | endif |
| 181 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 182 | # Module information used by KBuild framework |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 183 | obj-$(CONFIG_MSM_QDSP6_APRV2) += apr_dlkm.o |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 184 | obj-$(CONFIG_MSM_QDSP6_APRV2_GLINK) += apr_dlkm.o |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 185 | obj-$(CONFIG_MSM_QDSP6_APRV3_GLINK) += apr_dlkm.o |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 186 | apr_dlkm-y := $(APRV_GLINK) |
| 187 | |
| 188 | obj-$(CONFIG_WCD_DSP_GLINK) += wglink_dlkm.o |
| 189 | wglink_dlkm-y := $(WDSP_GLINK) |
| 190 | |
| 191 | # inject some build related information |
| 192 | CDEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\" |