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 | TARGET_KERNEL_VERSION := 4.4 |
| 6 | |
| 7 | ifeq ($(KERNEL_BUILD), 0) |
| 8 | # These are configurable via Kconfig for kernel-based builds |
| 9 | # Need to explicitly configure for Android-based builds |
| 10 | ifeq ($(CONFIG_ARCH_SDM845), y) |
| 11 | include $(AUDIO_ROOT)/config/sdm845auto.conf |
| 12 | export |
| 13 | TARGET_KERNEL_VERSION := 4.9 |
| 14 | endif |
| 15 | ifeq ($(CONFIG_ARCH_SDM670), y) |
| 16 | include $(AUDIO_ROOT)/config/sdm670auto.conf |
| 17 | export |
| 18 | TARGET_KERNEL_VERSION := 4.9 |
| 19 | endif |
| 20 | endif |
| 21 | |
| 22 | |
| 23 | # As per target team, build is done as follows: |
| 24 | # Defconfig : build with default flags |
| 25 | # Slub : defconfig + CONFIG_SLUB_DEBUG := y + |
| 26 | # CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y |
| 27 | # Perf : Using appropriate msmXXXX-perf_defconfig |
| 28 | # |
| 29 | # Shipment builds (user variants) should not have any debug feature |
| 30 | # enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds |
| 31 | # are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since |
| 32 | # there is no other way to identify defconfig builds, QTI internal |
| 33 | # representation of perf builds (identified using the string 'perf'), |
| 34 | # is used to identify if the build is a slub or defconfig one. This |
| 35 | # way no critical debug feature will be enabled for perf and shipment |
| 36 | # builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT |
| 37 | # config. |
| 38 | |
| 39 | ############ UAPI ############ |
| 40 | UAPI_DIR := uapi |
| 41 | UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR) |
| 42 | |
| 43 | ############ COMMON ############ |
| 44 | COMMON_DIR := include |
| 45 | COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR) |
| 46 | |
| 47 | ############ IPC ############ |
| 48 | |
| 49 | ifeq ($(CONFIG_MSM_QDSP6_APRV2_GLINK), m) |
| 50 | APRV_GLINK += apr.o |
| 51 | APRV_GLINK += apr_v2.o |
| 52 | APRV_GLINK += apr_tal_glink.o |
| 53 | endif |
| 54 | |
| 55 | ifeq ($(CONFIG_MSM_QDSP6_APRV3_GLINK), m) |
| 56 | APRV_GLINK += apr.o |
| 57 | APRV_GLINK += apr_v3.o |
| 58 | APRV_GLINK += apr_tal_glink.o |
| 59 | endif |
| 60 | |
| 61 | ifeq ($(CONFIG_WCD_DSP_GLINK), m) |
| 62 | WDSP_GLINK += wcd-dsp-glink.o |
| 63 | endif |
| 64 | |
| 65 | LINUX_INC += -Iinclude/linux |
| 66 | |
| 67 | INCS := $(COMMON_INC) \ |
| 68 | $(UAPI_INC) |
| 69 | |
| 70 | ifeq ($(CONFIG_ARCH_SDM845), y) |
| 71 | INCS += -include $(AUDIO_ROOT)/config/sdm845autoconf.h |
| 72 | endif |
| 73 | ifeq ($(CONFIG_ARCH_SDM670), y) |
| 74 | INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.h |
| 75 | endif |
| 76 | |
| 77 | EXTRA_CFLAGS += $(INCS) |
| 78 | |
| 79 | |
| 80 | CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ |
| 81 | -DANI_LITTLE_BIT_ENDIAN \ |
| 82 | -DDOT11F_LITTLE_ENDIAN_HOST \ |
| 83 | -DANI_COMPILER_TYPE_GCC \ |
| 84 | -DANI_OS_TYPE_ANDROID=6 \ |
| 85 | -DPTT_SOCK_SVC_ENABLE \ |
| 86 | -Wall\ |
| 87 | -Werror\ |
| 88 | -D__linux__ |
| 89 | |
| 90 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 91 | |
| 92 | HEADER_INSTALL_DIR := $(TOP)/kernel/msm-$(TARGET_KERNEL_VERSION)/scripts |
| 93 | UAPI_OUT := $(OUT)/obj/vendor/qcom/opensource/audio-kernel/include |
| 94 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ avtimer.h;) |
| 95 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio.h;) |
| 96 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_aac.h;) |
| 97 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_ac3.h;) |
| 98 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_alac.h;) |
| 99 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_amrnb.h;) |
| 100 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_amrwb.h;) |
| 101 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_amrwbplus.h;) |
| 102 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_ape.h;) |
| 103 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_calibration.h;) |
| 104 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_g711_dec.h;) |
| 105 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_g711.h;) |
| 106 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_mvs.h;) |
| 107 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_qcp.h;) |
| 108 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_sbc.h;) |
| 109 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_voicememo.h;) |
| 110 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_wma.h;) |
| 111 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/linux/ $(AUDIO_ROOT)/include/uapi/linux/ msm_audio_wmapro.h;) |
| 112 | |
| 113 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/sound/ $(AUDIO_ROOT)/include/uapi/sound/ audio_effects.h;) |
| 114 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/sound/ $(AUDIO_ROOT)/include/uapi/sound/ audio_slimslave.h;) |
| 115 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/sound/ $(AUDIO_ROOT)/include/uapi/sound/ devdep_params.h;) |
| 116 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/sound/ $(AUDIO_ROOT)/include/uapi/sound/ lsm_params.h;) |
| 117 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/sound/ $(AUDIO_ROOT)/include/uapi/sound/ msmcal-hwdep.h;) |
| 118 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/sound/ $(AUDIO_ROOT)/include/uapi/sound/ voice_params.h;) |
| 119 | $(shell $(HEADER_INSTALL_DIR)/headers_install.sh $(UAPI_OUT)/sound/ $(AUDIO_ROOT)/include/uapi/sound/ wcd-dsp-glink.h;) |
| 120 | |
| 121 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 122 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 123 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 124 | # will override the kernel settings. |
| 125 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 126 | EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 127 | endif |
| 128 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 129 | |
| 130 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 131 | EXTRA_CFLAGS += -Wheader-guard |
| 132 | endif |
| 133 | # If the module name is not "wlan", then the define MULTI_IF_NAME to be the |
| 134 | # same a the QCA CHIP name. The host driver will then append MULTI_IF_NAME to |
| 135 | # any string that must be unique for all instances of the driver on the system. |
| 136 | # This allows multiple instances of the driver with different module names. |
| 137 | # If the module name is wlan, leave MULTI_IF_NAME undefined and the code will |
| 138 | # treat the driver as the primary driver. |
| 139 | ifneq ($(MODNAME), qdsp6v2) |
| 140 | CHIP_NAME ?= $(MODNAME) |
| 141 | CDEFINES += -DMULTI_IF_NAME=\"$(CHIP_NAME)\" |
| 142 | endif |
| 143 | |
| 144 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 145 | # Module information used by KBuild framework |
| 146 | obj-$(CONFIG_MSM_QDSP6_APRV2_GLINK) += apr_dlkm.o |
| 147 | apr_dlkm-y := $(APRV_GLINK) |
| 148 | |
| 149 | obj-$(CONFIG_WCD_DSP_GLINK) += wglink_dlkm.o |
| 150 | wglink_dlkm-y := $(WDSP_GLINK) |
| 151 | |
| 152 | # inject some build related information |
| 153 | CDEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\" |