Sudheer Papothi | 085a654 | 2018-01-25 23:38:29 +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 | ifeq ($(KERNEL_BUILD), 1) |
| 10 | # These are configurable via Kconfig for kernel-based builds |
| 11 | # Need to explicitly configure for Android-based builds |
Meng Wang | 19fa6de | 2018-12-20 11:25:47 +0800 | [diff] [blame] | 12 | AUDIO_BLD_DIR := $(shell pwd)/kernel/msm-4.19 |
Sudheer Papothi | 085a654 | 2018-01-25 23:38:29 +0530 | [diff] [blame] | 13 | AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio |
| 14 | endif |
| 15 | |
| 16 | ifeq ($(KERNEL_BUILD), 0) |
| 17 | # These are configurable via Kconfig for kernel-based builds |
| 18 | # Need to explicitly configure for Android-based builds |
| 19 | |
| 20 | ifeq ($(CONFIG_ARCH_SDM670), y) |
| 21 | include $(AUDIO_ROOT)/config/sdm670auto.conf |
Sudheer Papothi | 085a654 | 2018-01-25 23:38:29 +0530 | [diff] [blame] | 22 | INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.h |
| 23 | endif |
| 24 | |
Banajit Goswami | f58e5fc | 2018-04-11 14:10:09 -0700 | [diff] [blame] | 25 | ifeq ($(CONFIG_ARCH_SM8150), y) |
Xiaoyu Ye | 60c105d | 2018-04-12 12:43:13 -0700 | [diff] [blame] | 26 | include $(AUDIO_ROOT)/config/sm8150auto.conf |
Xiaoyu Ye | 60c105d | 2018-04-12 12:43:13 -0700 | [diff] [blame] | 27 | INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h |
Sudheer Papothi | 085a654 | 2018-01-25 23:38:29 +0530 | [diff] [blame] | 28 | endif |
Sudheer Papothi | e3842cf | 2018-03-31 02:27:42 +0530 | [diff] [blame] | 29 | |
| 30 | ifeq ($(CONFIG_ARCH_SDMSHRIKE), y) |
Xiaoyu Ye | 60c105d | 2018-04-12 12:43:13 -0700 | [diff] [blame] | 31 | include $(AUDIO_ROOT)/config/sm8150auto.conf |
Xiaoyu Ye | 60c105d | 2018-04-12 12:43:13 -0700 | [diff] [blame] | 32 | INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h |
Sudheer Papothi | e3842cf | 2018-03-31 02:27:42 +0530 | [diff] [blame] | 33 | endif |
Sudheer Papothi | 085a654 | 2018-01-25 23:38:29 +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 | # for AQT1000 Codec |
| 61 | ifeq ($(CONFIG_SND_SOC_AQT1000), m) |
| 62 | AQT1000_CDC_OBJS += aqt1000-regmap.o |
| 63 | AQT1000_CDC_OBJS += aqt1000-utils.o |
| 64 | AQT1000_CDC_OBJS += aqt1000-core.o |
| 65 | AQT1000_CDC_OBJS += aqt1000-irq.o |
| 66 | AQT1000_CDC_OBJS += aqt1000-clsh.o |
| 67 | AQT1000_CDC_OBJS += aqt1000.o |
| 68 | AQT1000_CDC_OBJS += aqt1000-mbhc.o |
| 69 | endif |
| 70 | |
| 71 | LINUX_INC += -Iinclude/linux |
| 72 | |
Sudheer Papothi | 90d7b49 | 2018-02-22 14:42:41 +0530 | [diff] [blame] | 73 | INCS += $(COMMON_INC) \ |
Sudheer Papothi | 085a654 | 2018-01-25 23:38:29 +0530 | [diff] [blame] | 74 | $(UAPI_INC) |
| 75 | |
| 76 | EXTRA_CFLAGS += $(INCS) |
| 77 | |
| 78 | CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ |
| 79 | -DANI_LITTLE_BIT_ENDIAN \ |
| 80 | -DDOT11F_LITTLE_ENDIAN_HOST \ |
| 81 | -DANI_COMPILER_TYPE_GCC \ |
| 82 | -DANI_OS_TYPE_ANDROID=6 \ |
| 83 | -DPTT_SOCK_SVC_ENABLE \ |
| 84 | -Wall\ |
Sudheer Papothi | 085a654 | 2018-01-25 23:38:29 +0530 | [diff] [blame] | 85 | -D__linux__ |
| 86 | |
| 87 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 88 | |
| 89 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 90 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 91 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 92 | # will override the kernel settings. |
| 93 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 94 | EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 95 | endif |
| 96 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 97 | |
| 98 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 99 | EXTRA_CFLAGS += -Wheader-guard |
| 100 | endif |
| 101 | |
| 102 | ifeq ($(KERNEL_BUILD), 0) |
| 103 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers |
| 104 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 105 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers |
| 106 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers |
| 107 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers |
| 108 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/aqt1000/Module.symvers |
| 109 | endif |
| 110 | |
| 111 | # Module information used by KBuild framework |
| 112 | obj-$(CONFIG_SND_SOC_AQT1000) += aqt1000_cdc_dlkm.o |
| 113 | aqt1000_cdc_dlkm-y := $(AQT1000_CDC_OBJS) |