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 |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 3 | ifeq ($(MODNAME),) |
| 4 | KERNEL_BUILD := 1 |
| 5 | else |
| 6 | KERNEL_BUILD := 0 |
| 7 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 8 | |
| 9 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 10 | |
| 11 | ifeq ($(KERNEL_BUILD), 1) |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 12 | # These are configurable via Kconfig for kernel-based builds |
| 13 | # Need to explicitly configure for Android-based builds |
Meng Wang | 19fa6de | 2018-12-20 11:25:47 +0800 | [diff] [blame] | 14 | AUDIO_BLD_DIR := $(shell pwd)/kernel/msm-4.19 |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 15 | AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio |
| 16 | endif |
| 17 | |
| 18 | ifeq ($(KERNEL_BUILD), 0) |
Salendarsingh Gaud | ad97889 | 2018-05-14 16:53:09 +0530 | [diff] [blame] | 19 | ifeq ($(CONFIG_ARCH_SM6150), y) |
Laxminath Kasam | 144eabc | 2018-05-31 10:44:53 +0530 | [diff] [blame] | 20 | include $(AUDIO_ROOT)/config/sm6150auto.conf |
Laxminath Kasam | 144eabc | 2018-05-31 10:44:53 +0530 | [diff] [blame] | 21 | INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h |
Abhishek Arpure | 6d74b70 | 2018-04-05 13:50:25 +0530 | [diff] [blame] | 22 | endif |
Hari Veerubhotla | dcab67c | 2018-10-14 17:08:35 +0530 | [diff] [blame] | 23 | ifeq ($(CONFIG_ARCH_TRINKET), y) |
| 24 | include $(AUDIO_ROOT)/config/sm6150auto.conf |
Hari Veerubhotla | dcab67c | 2018-10-14 17:08:35 +0530 | [diff] [blame] | 25 | INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h |
| 26 | endif |
Banajit Goswami | f58e5fc | 2018-04-11 14:10:09 -0700 | [diff] [blame] | 27 | ifeq ($(CONFIG_ARCH_SM8150), y) |
Xiaoyu Ye | 60c105d | 2018-04-12 12:43:13 -0700 | [diff] [blame] | 28 | include $(AUDIO_ROOT)/config/sm8150auto.conf |
Xiaoyu Ye | 60c105d | 2018-04-12 12:43:13 -0700 | [diff] [blame] | 29 | INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h |
Sudheer Papothi | cc0a22d | 2018-03-02 06:29:57 +0530 | [diff] [blame] | 30 | endif |
Sudheer Papothi | e3842cf | 2018-03-31 02:27:42 +0530 | [diff] [blame] | 31 | ifeq ($(CONFIG_ARCH_SDMSHRIKE), y) |
Xiaoyu Ye | 60c105d | 2018-04-12 12:43:13 -0700 | [diff] [blame] | 32 | include $(AUDIO_ROOT)/config/sm8150auto.conf |
Xiaoyu Ye | 60c105d | 2018-04-12 12:43:13 -0700 | [diff] [blame] | 33 | INCS += -include $(AUDIO_ROOT)/config/sm8150autoconf.h |
Sudheer Papothi | e3842cf | 2018-03-31 02:27:42 +0530 | [diff] [blame] | 34 | endif |
Soumya Managoli | d11d6f0 | 2020-05-27 17:25:12 +0530 | [diff] [blame] | 35 | ifeq ($(CONFIG_ARCH_SDM660), y) |
| 36 | include $(AUDIO_ROOT)/config/sdm660auto.conf |
Soumya Managoli | d11d6f0 | 2020-05-27 17:25:12 +0530 | [diff] [blame] | 37 | INCS += -include $(AUDIO_ROOT)/config/sdm660autoconf.h |
| 38 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 39 | endif |
| 40 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 41 | # As per target team, build is done as follows: |
| 42 | # Defconfig : build with default flags |
| 43 | # Slub : defconfig + CONFIG_SLUB_DEBUG := y + |
| 44 | # CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y |
| 45 | # Perf : Using appropriate msmXXXX-perf_defconfig |
| 46 | # |
| 47 | # Shipment builds (user variants) should not have any debug feature |
| 48 | # enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds |
| 49 | # are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since |
| 50 | # there is no other way to identify defconfig builds, QTI internal |
| 51 | # representation of perf builds (identified using the string 'perf'), |
| 52 | # is used to identify if the build is a slub or defconfig one. This |
| 53 | # way no critical debug feature will be enabled for perf and shipment |
| 54 | # builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT |
| 55 | # config. |
| 56 | |
| 57 | ############ UAPI ############ |
| 58 | UAPI_DIR := uapi |
| 59 | UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR) |
| 60 | |
| 61 | ############ COMMON ############ |
| 62 | COMMON_DIR := include |
| 63 | COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR) |
| 64 | |
| 65 | ############ WCD934X ############ |
| 66 | |
| 67 | # for WCD934X Codec |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 68 | ifdef CONFIG_SND_SOC_WCD934X |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 69 | WCD934X_OBJS += wcd934x.o |
| 70 | WCD934X_OBJS += wcd934x-dsp-cntl.o |
| 71 | WCD934X_OBJS += wcd934x-mbhc.o |
| 72 | WCD934X_OBJS += wcd934x-dsd.o |
| 73 | endif |
| 74 | |
| 75 | LINUX_INC += -Iinclude/linux |
| 76 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 77 | INCS += $(COMMON_INC) \ |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 78 | $(UAPI_INC) |
| 79 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 80 | EXTRA_CFLAGS += $(INCS) |
| 81 | |
| 82 | |
| 83 | CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ |
| 84 | -DANI_LITTLE_BIT_ENDIAN \ |
| 85 | -DDOT11F_LITTLE_ENDIAN_HOST \ |
| 86 | -DANI_COMPILER_TYPE_GCC \ |
| 87 | -DANI_OS_TYPE_ANDROID=6 \ |
| 88 | -DPTT_SOCK_SVC_ENABLE \ |
| 89 | -Wall\ |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 90 | -D__linux__ |
| 91 | |
| 92 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 93 | |
| 94 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 95 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 96 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 97 | # will override the kernel settings. |
| 98 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 99 | EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 100 | endif |
| 101 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 102 | |
| 103 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 104 | EXTRA_CFLAGS += -Wheader-guard |
| 105 | endif |
| 106 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 107 | ifeq ($(KERNEL_BUILD), 0) |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 108 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers |
| 109 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 110 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers |
| 111 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers |
| 112 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 113 | endif |
| 114 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 115 | # Module information used by KBuild framework |
| 116 | obj-$(CONFIG_SND_SOC_WCD934X) += wcd934x_dlkm.o |
| 117 | wcd934x_dlkm-y := $(WCD934X_OBJS) |