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 |
Siddeswar Aluganti | 85e9e16 | 2018-09-25 19:03:00 -0700 | [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) |
| 24 | include $(AUDIO_ROOT)/config/sdm670auto.conf |
| 25 | export |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 26 | INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.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) |
| 29 | include $(AUDIO_ROOT)/config/sdm670auto.conf |
| 30 | export |
| 31 | INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.h |
| 32 | endif |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 33 | endif |
| 34 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 35 | # As per target team, build is done as follows: |
| 36 | # Defconfig : build with default flags |
| 37 | # Slub : defconfig + CONFIG_SLUB_DEBUG := y + |
| 38 | # CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y |
| 39 | # Perf : Using appropriate msmXXXX-perf_defconfig |
| 40 | # |
| 41 | # Shipment builds (user variants) should not have any debug feature |
| 42 | # enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds |
| 43 | # are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since |
| 44 | # there is no other way to identify defconfig builds, QTI internal |
| 45 | # representation of perf builds (identified using the string 'perf'), |
| 46 | # is used to identify if the build is a slub or defconfig one. This |
| 47 | # way no critical debug feature will be enabled for perf and shipment |
| 48 | # builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT |
| 49 | # config. |
| 50 | |
| 51 | ############ UAPI ############ |
| 52 | UAPI_DIR := uapi |
| 53 | UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR) |
| 54 | |
| 55 | ############ COMMON ############ |
| 56 | COMMON_DIR := include |
| 57 | COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR) |
| 58 | |
| 59 | ############ MSM Soundwire ############ |
| 60 | |
| 61 | # for MSM Soundwire Codec |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 62 | ifdef CONFIG_SND_SOC_MSM_SDW |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 63 | MSM_SDW_OBJS += msm_sdw_cdc.o |
| 64 | MSM_SDW_OBJS += msm_sdw_regmap.o |
| 65 | MSM_SDW_OBJS += msm-sdw-tables.o |
| 66 | MSM_SDW_OBJS += msm_sdw_cdc_utils.o |
| 67 | endif |
| 68 | |
| 69 | LINUX_INC += -Iinclude/linux |
| 70 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 71 | INCS += $(COMMON_INC) \ |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 72 | $(UAPI_INC) |
| 73 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 74 | EXTRA_CFLAGS += $(INCS) |
| 75 | |
| 76 | |
| 77 | CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ |
| 78 | -DANI_LITTLE_BIT_ENDIAN \ |
| 79 | -DDOT11F_LITTLE_ENDIAN_HOST \ |
| 80 | -DANI_COMPILER_TYPE_GCC \ |
| 81 | -DANI_OS_TYPE_ANDROID=6 \ |
| 82 | -DPTT_SOCK_SVC_ENABLE \ |
| 83 | -Wall\ |
| 84 | -Werror\ |
| 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 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 102 | ifeq ($(KERNEL_BUILD), 0) |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 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 |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 108 | endif |
| 109 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 110 | # Module information used by KBuild framework |
| 111 | obj-$(CONFIG_SND_SOC_MSM_SDW) += msm_sdw_dlkm.o |
| 112 | msm_sdw_dlkm-y := $(MSM_SDW_OBJS) |
| 113 | |
| 114 | # inject some build related information |
| 115 | DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\" |