Aditya Bavanari | d273a6f | 2020-03-03 21:59:03 +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 |
| 14 | AUDIO_BLD_DIR := $(ANDROID_BUILD_TOP)/kernel/msm-4.19 |
| 15 | AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio |
| 16 | endif |
| 17 | |
| 18 | ifeq ($(KERNEL_BUILD), 0) |
| 19 | ifeq ($(CONFIG_ARCH_BENGAL), y) |
| 20 | include $(AUDIO_ROOT)/config/bengalauto.conf |
Aditya Bavanari | d273a6f | 2020-03-03 21:59:03 +0530 | [diff] [blame] | 21 | INCS += -include $(AUDIO_ROOT)/config/bengalautoconf.h |
| 22 | endif |
| 23 | endif |
| 24 | |
| 25 | # As per target team, build is done as follows: |
| 26 | # Defconfig : build with default flags |
| 27 | # Slub : defconfig + CONFIG_SLUB_DEBUG := y + |
| 28 | # CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y |
| 29 | # Perf : Using appropriate msmXXXX-perf_defconfig |
| 30 | # |
| 31 | # Shipment builds (user variants) should not have any debug feature |
| 32 | # enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds |
| 33 | # are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since |
| 34 | # there is no other way to identify defconfig builds, QTI internal |
| 35 | # representation of perf builds (identified using the string 'perf'), |
| 36 | # is used to identify if the build is a slub or defconfig one. This |
| 37 | # way no critical debug feature will be enabled for perf and shipment |
| 38 | # builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT |
| 39 | # config. |
| 40 | |
| 41 | ############ UAPI ############ |
| 42 | UAPI_DIR := uapi |
| 43 | UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR) |
| 44 | |
| 45 | ############ COMMON ############ |
| 46 | COMMON_DIR := include |
| 47 | COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR) |
| 48 | |
| 49 | ############ ROULEUR ############ |
| 50 | |
| 51 | # for ROULEUR Codec |
| 52 | ifdef CONFIG_SND_SOC_ROULEUR |
| 53 | ROULEUR_OBJS += rouleur.o |
| 54 | ROULEUR_OBJS += rouleur-regmap.o |
| 55 | ROULEUR_OBJS += rouleur-tables.o |
| 56 | ROULEUR_OBJS += rouleur-mbhc.o |
| 57 | endif |
| 58 | |
| 59 | ifdef CONFIG_PM2250_SPMI |
| 60 | PM2250_SPMI_OBJS += pm2250_spmi.o |
| 61 | endif |
| 62 | |
| 63 | ifdef CONFIG_SND_SOC_ROULEUR_SLAVE |
| 64 | ROULEUR_SLAVE_OBJS += rouleur_slave.o |
| 65 | endif |
| 66 | |
| 67 | LINUX_INC += -Iinclude/linux |
| 68 | |
| 69 | INCS += $(COMMON_INC) \ |
| 70 | $(UAPI_INC) |
| 71 | |
| 72 | EXTRA_CFLAGS += $(INCS) |
| 73 | |
| 74 | |
| 75 | CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ |
| 76 | -DANI_LITTLE_BIT_ENDIAN \ |
| 77 | -DDOT11F_LITTLE_ENDIAN_HOST \ |
| 78 | -DANI_COMPILER_TYPE_GCC \ |
| 79 | -DANI_OS_TYPE_ANDROID=6 \ |
| 80 | -DPTT_SOCK_SVC_ENABLE \ |
| 81 | -Wall\ |
Aditya Bavanari | d273a6f | 2020-03-03 21:59:03 +0530 | [diff] [blame] | 82 | -D__linux__ |
| 83 | |
| 84 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 85 | |
| 86 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 87 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 88 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 89 | # will override the kernel settings. |
| 90 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 91 | EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 92 | endif |
| 93 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 94 | |
| 95 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 96 | EXTRA_CFLAGS += -Wheader-guard |
| 97 | endif |
| 98 | |
| 99 | ifeq ($(KERNEL_BUILD), 0) |
| 100 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers |
| 101 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 102 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers |
| 103 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers |
| 104 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers |
| 105 | endif |
| 106 | |
| 107 | # Module information used by KBuild framework |
| 108 | obj-$(CONFIG_SND_SOC_ROULEUR) += rouleur_dlkm.o |
| 109 | rouleur_dlkm-y := $(ROULEUR_OBJS) |
| 110 | |
| 111 | obj-$(CONFIG_SND_SOC_ROULEUR_SLAVE) += rouleur_slave_dlkm.o |
| 112 | rouleur_slave_dlkm-y := $(ROULEUR_SLAVE_OBJS) |
| 113 | |
| 114 | obj-$(CONFIG_PM2250_SPMI) += pm2250_spmi_dlkm.o |
| 115 | pm2250_spmi_dlkm-y := $(PM2250_SPMI_OBJS) |