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 | ifeq ($(KERNEL_BUILD), 1) |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 11 | # These are configurable via Kconfig for kernel-based builds |
| 12 | # Need to explicitly configure for Android-based builds |
Piyush Balwani | 677fa73 | 2018-11-30 19:13:42 +0530 | [diff] [blame] | 13 | AUDIO_BLD_DIR := $(shell pwd)/kernel/msm-4.9 |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 14 | AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio |
| 15 | endif |
| 16 | |
| 17 | ifeq ($(KERNEL_BUILD), 0) |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 18 | ifeq ($(CONFIG_ARCH_SDM845), y) |
| 19 | include $(AUDIO_ROOT)/config/sdm845auto.conf |
| 20 | export |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 21 | INCS += -include $(AUDIO_ROOT)/config/sdm845autoconf.h |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 22 | endif |
| 23 | ifeq ($(CONFIG_ARCH_SDM670), y) |
Aditya Bavanari | 68d3ed8 | 2018-04-08 14:34:47 +0530 | [diff] [blame] | 24 | include $(AUDIO_ROOT)/config/sdm710auto.conf |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 25 | export |
Aditya Bavanari | 68d3ed8 | 2018-04-08 14:34:47 +0530 | [diff] [blame] | 26 | INCS += -include $(AUDIO_ROOT)/config/sdm710autoconf.h |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 27 | endif |
Laxminath Kasam | 942d1c6 | 2017-12-29 11:02:22 +0530 | [diff] [blame] | 28 | ifeq ($(CONFIG_ARCH_SDM450), y) |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 29 | include $(AUDIO_ROOT)/config/sdm450auto.conf |
Laxminath Kasam | 942d1c6 | 2017-12-29 11:02:22 +0530 | [diff] [blame] | 30 | export |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 31 | INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h |
Laxminath Kasam | 942d1c6 | 2017-12-29 11:02:22 +0530 | [diff] [blame] | 32 | endif |
Vaishnavi Kommaraju | 59562a1 | 2018-04-25 19:33:46 +0530 | [diff] [blame] | 33 | ifeq ($(CONFIG_ARCH_SDM439), y) |
| 34 | include $(AUDIO_ROOT)/config/sdm450auto.conf |
| 35 | export |
| 36 | INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h |
| 37 | endif |
Soumya Managoli | d63fb8e | 2018-05-08 17:28:01 +0530 | [diff] [blame] | 38 | ifeq ($(CONFIG_ARCH_MSM8917), y) |
| 39 | include $(AUDIO_ROOT)/config/sdm450auto.conf |
| 40 | export |
| 41 | INCS += -include $(AUDIO_ROOT)/config/sdm450autoconf.h |
| 42 | endif |
yang liu | 0e16b0c | 2018-08-10 12:09:21 +0800 | [diff] [blame] | 43 | ifeq ($(CONFIG_ARCH_MSM8909), y) |
| 44 | include $(AUDIO_ROOT)/config/msm8909auto.conf |
| 45 | export |
| 46 | INCS += -include $(AUDIO_ROOT)/config/msm8909autoconf.h |
| 47 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 48 | endif |
| 49 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 50 | # As per target team, build is done as follows: |
| 51 | # Defconfig : build with default flags |
| 52 | # Slub : defconfig + CONFIG_SLUB_DEBUG := y + |
| 53 | # CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y |
| 54 | # Perf : Using appropriate msmXXXX-perf_defconfig |
| 55 | # |
| 56 | # Shipment builds (user variants) should not have any debug feature |
| 57 | # enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds |
| 58 | # are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since |
| 59 | # there is no other way to identify defconfig builds, QTI internal |
| 60 | # representation of perf builds (identified using the string 'perf'), |
| 61 | # is used to identify if the build is a slub or defconfig one. This |
| 62 | # way no critical debug feature will be enabled for perf and shipment |
| 63 | # builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT |
| 64 | # config. |
| 65 | |
| 66 | ############ UAPI ############ |
| 67 | UAPI_DIR := uapi |
| 68 | UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR) |
| 69 | |
| 70 | ############ COMMON ############ |
| 71 | COMMON_DIR := include |
| 72 | COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR) |
| 73 | |
| 74 | ############ SDM660_CDC ############ |
| 75 | |
| 76 | # for SDM660_CDC Codec |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 77 | ifdef CONFIG_SND_SOC_ANALOG_CDC |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 78 | ANALOG_CDC_OBJS += msm-analog-cdc.o |
| 79 | ANALOG_CDC_OBJS += sdm660-cdc-irq.o |
| 80 | endif |
| 81 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 82 | ifdef CONFIG_SND_SOC_DIGITAL_CDC |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 83 | DIGITAL_CDC_OBJS += msm-digital-cdc.o |
| 84 | DIGITAL_CDC_OBJS += msm-digital-cdc-regmap.o |
| 85 | endif |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 86 | |
| 87 | ifdef CONFIG_SND_SOC_DIGITAL_CDC_LEGACY |
| 88 | DIGITAL_CDC_OBJS += msm-digital-cdc-legacy.o |
| 89 | DIGITAL_CDC_OBJS += msm-digital-cdc-legacy-regmap.o |
| 90 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 91 | LINUX_INC += -Iinclude/linux |
| 92 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 93 | INCS += $(COMMON_INC) \ |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 94 | $(UAPI_INC) |
| 95 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 96 | EXTRA_CFLAGS += $(INCS) |
| 97 | |
| 98 | |
| 99 | CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ |
| 100 | -DANI_LITTLE_BIT_ENDIAN \ |
| 101 | -DDOT11F_LITTLE_ENDIAN_HOST \ |
| 102 | -DANI_COMPILER_TYPE_GCC \ |
| 103 | -DANI_OS_TYPE_ANDROID=6 \ |
| 104 | -DPTT_SOCK_SVC_ENABLE \ |
| 105 | -Wall\ |
| 106 | -Werror\ |
| 107 | -D__linux__ |
| 108 | |
| 109 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 110 | |
| 111 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 112 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 113 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 114 | # will override the kernel settings. |
| 115 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 116 | EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 117 | endif |
| 118 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 119 | |
| 120 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 121 | EXTRA_CFLAGS += -Wheader-guard |
| 122 | endif |
| 123 | |
| 124 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 125 | ifeq ($(KERNEL_BUILD), 0) |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 126 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers |
| 127 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 128 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers |
| 129 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers |
| 130 | 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] | 131 | endif |
| 132 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 133 | # Module information used by KBuild framework |
| 134 | obj-$(CONFIG_SND_SOC_ANALOG_CDC) += analog_cdc_dlkm.o |
| 135 | analog_cdc_dlkm-y := $(ANALOG_CDC_OBJS) |
| 136 | |
| 137 | obj-$(CONFIG_SND_SOC_DIGITAL_CDC) += digital_cdc_dlkm.o |
| 138 | digital_cdc_dlkm-y := $(DIGITAL_CDC_OBJS) |
| 139 | |
Soumya Managoli | eaff662 | 2018-02-23 12:00:54 +0530 | [diff] [blame] | 140 | obj-$(CONFIG_SND_SOC_DIGITAL_CDC_LEGACY) += digital_cdc_dlkm.o |
| 141 | digital_cdc_dlkm-y := $(DIGITAL_CDC_OBJS) |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 142 | # inject some build related information |
| 143 | DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\" |