Laxminath Kasam | a0f8408 | 2018-05-31 10:42:50 +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 | ifeq ($(MODNAME),) |
| 4 | KERNEL_BUILD := 1 |
| 5 | else |
| 6 | KERNEL_BUILD := 0 |
| 7 | endif |
| 8 | |
| 9 | |
| 10 | |
| 11 | ifeq ($(KERNEL_BUILD), 1) |
| 12 | # These are configurable via Kconfig for kernel-based builds |
| 13 | # Need to explicitly configure for Android-based builds |
Siddeswar Aluganti | 85e9e16 | 2018-09-25 19:03:00 -0700 | [diff] [blame] | 14 | AUDIO_BLD_DIR := $(shell pwd)/kernel/msm-4.14 |
Laxminath Kasam | a0f8408 | 2018-05-31 10:42:50 +0530 | [diff] [blame] | 15 | AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio |
| 16 | endif |
| 17 | |
| 18 | ifeq ($(KERNEL_BUILD), 0) |
| 19 | ifeq ($(CONFIG_ARCH_SM6150), y) |
| 20 | include $(AUDIO_ROOT)/config/sm6150auto.conf |
| 21 | export |
| 22 | INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h |
| 23 | endif |
Hari Veerubhotla | dcab67c | 2018-10-14 17:08:35 +0530 | [diff] [blame] | 24 | ifeq ($(CONFIG_ARCH_TRINKET), y) |
| 25 | include $(AUDIO_ROOT)/config/sm6150auto.conf |
| 26 | export |
| 27 | INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h |
| 28 | endif |
Mangesh Kunchamwar | 0bf1f57 | 2018-05-24 19:58:42 +0530 | [diff] [blame] | 29 | ifeq ($(CONFIG_ARCH_QCS405), y) |
| 30 | include $(AUDIO_ROOT)/config/qcs405auto.conf |
| 31 | export |
| 32 | INCS += -include $(AUDIO_ROOT)/config/qcs405autoconf.h |
| 33 | endif |
Laxminath Kasam | a0f8408 | 2018-05-31 10:42:50 +0530 | [diff] [blame] | 34 | endif |
| 35 | |
| 36 | # As per target team, build is done as follows: |
| 37 | # Defconfig : build with default flags |
| 38 | # Slub : defconfig + CONFIG_SLUB_DEBUG := y + |
| 39 | # CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y |
| 40 | # Perf : Using appropriate msmXXXX-perf_defconfig |
| 41 | # |
| 42 | # Shipment builds (user variants) should not have any debug feature |
| 43 | # enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds |
| 44 | # are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since |
| 45 | # there is no other way to identify defconfig builds, QTI internal |
| 46 | # representation of perf builds (identified using the string 'perf'), |
| 47 | # is used to identify if the build is a slub or defconfig one. This |
| 48 | # way no critical debug feature will be enabled for perf and shipment |
| 49 | # builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT |
| 50 | # config. |
| 51 | |
| 52 | ############ UAPI ############ |
| 53 | UAPI_DIR := uapi |
| 54 | UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR) |
| 55 | |
| 56 | ############ COMMON ############ |
| 57 | COMMON_DIR := include |
| 58 | COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR) |
| 59 | |
| 60 | ############ BOLERO ############ |
| 61 | |
| 62 | # for BOLERO Codec |
| 63 | ifdef CONFIG_SND_SOC_BOLERO |
| 64 | BOLERO_OBJS += bolero-cdc.o |
| 65 | BOLERO_OBJS += bolero-cdc-utils.o |
| 66 | BOLERO_OBJS += bolero-cdc-regmap.o |
| 67 | BOLERO_OBJS += bolero-cdc-tables.o |
| 68 | endif |
| 69 | |
| 70 | ifdef CONFIG_WSA_MACRO |
| 71 | WSA_OBJS += wsa-macro.o |
| 72 | endif |
| 73 | |
| 74 | ifdef CONFIG_VA_MACRO |
| 75 | VA_OBJS += va-macro.o |
| 76 | endif |
| 77 | |
Laxminath Kasam | f8ef43e | 2018-06-15 16:57:46 +0530 | [diff] [blame] | 78 | ifdef CONFIG_TX_MACRO |
| 79 | TX_OBJS += tx-macro.o |
| 80 | endif |
| 81 | |
| 82 | ifdef CONFIG_RX_MACRO |
| 83 | RX_OBJS += rx-macro.o |
| 84 | endif |
| 85 | |
Laxminath Kasam | a0f8408 | 2018-05-31 10:42:50 +0530 | [diff] [blame] | 86 | LINUX_INC += -Iinclude/linux |
| 87 | |
| 88 | INCS += $(COMMON_INC) \ |
| 89 | $(UAPI_INC) |
| 90 | |
| 91 | EXTRA_CFLAGS += $(INCS) |
| 92 | |
| 93 | |
| 94 | CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ |
| 95 | -DANI_LITTLE_BIT_ENDIAN \ |
| 96 | -DDOT11F_LITTLE_ENDIAN_HOST \ |
| 97 | -DANI_COMPILER_TYPE_GCC \ |
| 98 | -DANI_OS_TYPE_ANDROID=6 \ |
| 99 | -DPTT_SOCK_SVC_ENABLE \ |
| 100 | -Wall\ |
| 101 | -Werror\ |
| 102 | -D__linux__ |
| 103 | |
| 104 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 105 | |
| 106 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 107 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 108 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 109 | # will override the kernel settings. |
| 110 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 111 | EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 112 | endif |
| 113 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 114 | |
| 115 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 116 | EXTRA_CFLAGS += -Wheader-guard |
| 117 | endif |
| 118 | |
| 119 | ifeq ($(KERNEL_BUILD), 0) |
| 120 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers |
| 121 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 122 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers |
| 123 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers |
| 124 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers |
| 125 | endif |
| 126 | |
| 127 | # Module information used by KBuild framework |
| 128 | obj-$(CONFIG_SND_SOC_BOLERO) += bolero_cdc_dlkm.o |
| 129 | bolero_cdc_dlkm-y := $(BOLERO_OBJS) |
| 130 | |
| 131 | obj-$(CONFIG_WSA_MACRO) += wsa_macro_dlkm.o |
| 132 | wsa_macro_dlkm-y := $(WSA_OBJS) |
| 133 | |
| 134 | obj-$(CONFIG_VA_MACRO) += va_macro_dlkm.o |
| 135 | va_macro_dlkm-y := $(VA_OBJS) |
| 136 | |
Laxminath Kasam | f8ef43e | 2018-06-15 16:57:46 +0530 | [diff] [blame] | 137 | obj-$(CONFIG_TX_MACRO) += tx_macro_dlkm.o |
| 138 | tx_macro_dlkm-y := $(TX_OBJS) |
| 139 | |
| 140 | obj-$(CONFIG_RX_MACRO) += rx_macro_dlkm.o |
| 141 | rx_macro_dlkm-y := $(RX_OBJS) |
| 142 | |
Laxminath Kasam | a0f8408 | 2018-05-31 10:42:50 +0530 | [diff] [blame] | 143 | # inject some build related information |
| 144 | DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\" |