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 | ############ Native Enc/Dec ############ |
| 45 | |
| 46 | ifeq ($(CONFIG_MSM_QDSP6V2_CODECS), m) |
| 47 | NATIVE_OBJS += q6audio_v2.o q6audio_v2_aio.o |
| 48 | NATIVE_OBJS += audio_utils_aio.o |
| 49 | NATIVE_OBJS += audio_utils.o |
| 50 | NATIVE_OBJS += audio_native.o |
| 51 | NATIVE_OBJS += aac_in.o |
| 52 | NATIVE_OBJS += amrnb_in.o |
| 53 | NATIVE_OBJS += amrwb_in.o |
| 54 | NATIVE_OBJS += audio_aac.o |
| 55 | NATIVE_OBJS += audio_alac.o |
| 56 | NATIVE_OBJS += audio_amrnb.o |
| 57 | NATIVE_OBJS += audio_amrwb.o |
| 58 | NATIVE_OBJS += audio_amrwbplus.o |
| 59 | NATIVE_OBJS += audio_ape.o |
| 60 | NATIVE_OBJS += audio_evrc.o |
| 61 | NATIVE_OBJS += audio_g711alaw.o |
| 62 | NATIVE_OBJS += audio_g711mlaw.o |
| 63 | NATIVE_OBJS += audio_hwacc_effects.o |
| 64 | NATIVE_OBJS += audio_mp3.o |
| 65 | NATIVE_OBJS += audio_multi_aac.o |
| 66 | NATIVE_OBJS += audio_qcelp.o |
| 67 | NATIVE_OBJS += audio_wma.o |
| 68 | NATIVE_OBJS += audio_wmapro.o |
| 69 | NATIVE_OBJS += evrc_in.o |
| 70 | NATIVE_OBJS += g711alaw_in.o |
| 71 | NATIVE_OBJS += g711mlaw_in.o |
| 72 | NATIVE_OBJS += qcelp_in.o |
| 73 | endif |
| 74 | |
| 75 | LINUX_INC += -Iinclude/linux |
| 76 | |
| 77 | INCS := $(COMMON_INC) \ |
| 78 | $(UAPI_INC) |
| 79 | |
| 80 | ifeq ($(CONFIG_ARCH_SDM845), y) |
| 81 | INCS += -include $(AUDIO_ROOT)/config/sdm845autoconf.h |
| 82 | endif |
| 83 | ifeq ($(CONFIG_ARCH_SDM670), y) |
| 84 | INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.h |
| 85 | endif |
| 86 | |
| 87 | EXTRA_CFLAGS += $(INCS) |
| 88 | |
| 89 | |
| 90 | CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ |
| 91 | -DANI_LITTLE_BIT_ENDIAN \ |
| 92 | -DDOT11F_LITTLE_ENDIAN_HOST \ |
| 93 | -DANI_COMPILER_TYPE_GCC \ |
| 94 | -DANI_OS_TYPE_ANDROID=6 \ |
| 95 | -DPTT_SOCK_SVC_ENABLE \ |
| 96 | -Wall\ |
| 97 | -Werror\ |
| 98 | -D__linux__ |
| 99 | |
| 100 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 101 | |
| 102 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 103 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 104 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 105 | # will override the kernel settings. |
| 106 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 107 | EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 108 | endif |
| 109 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 110 | |
| 111 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 112 | EXTRA_CFLAGS += -Wheader-guard |
| 113 | endif |
| 114 | |
| 115 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 116 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers |
| 117 | # If the module name is not "wlan", then the define MULTI_IF_NAME to be the |
| 118 | # same a the QCA CHIP name. The host driver will then append MULTI_IF_NAME to |
| 119 | # any string that must be unique for all instances of the driver on the system. |
| 120 | # This allows multiple instances of the driver with different module names. |
| 121 | # If the module name is wlan, leave MULTI_IF_NAME undefined and the code will |
| 122 | # treat the driver as the primary driver. |
| 123 | ifneq ($(MODNAME), qdsp6v2) |
| 124 | CHIP_NAME ?= $(MODNAME) |
| 125 | CDEFINES += -DMULTI_IF_NAME=\"$(CHIP_NAME)\" |
| 126 | endif |
| 127 | |
| 128 | # Module information used by KBuild framework |
| 129 | obj-$(CONFIG_MSM_QDSP6V2_CODECS) += native_dlkm.o |
| 130 | native_dlkm-y := $(NATIVE_OBJS) |
| 131 | |
| 132 | # inject some build related information |
| 133 | DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\" |