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 |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 14 | AUDIO_BLD_DIR := $(ANDROID_BUILD_TOP)/kernel/msm-4.9 |
| 15 | AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio |
| 16 | endif |
| 17 | |
| 18 | ifeq ($(KERNEL_BUILD), 0) |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 19 | ifeq ($(CONFIG_ARCH_SDM845), y) |
| 20 | include $(AUDIO_ROOT)/config/sdm845auto.conf |
| 21 | export |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 22 | INCS += -include $(AUDIO_ROOT)/config/sdm845autoconf.h |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 23 | endif |
| 24 | ifeq ($(CONFIG_ARCH_SDM670), y) |
| 25 | include $(AUDIO_ROOT)/config/sdm670auto.conf |
| 26 | export |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 27 | INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.h |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 28 | endif |
Laxminath Kasam | 942d1c6 | 2017-12-29 11:02:22 +0530 | [diff] [blame] | 29 | ifeq ($(CONFIG_ARCH_SDM450), y) |
| 30 | include $(AUDIO_ROOT)/config/sdm670auto.conf |
| 31 | export |
| 32 | INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.h |
| 33 | endif |
Sudheer Papothi | cc0a22d | 2018-03-02 06:29:57 +0530 | [diff] [blame^] | 34 | ifeq ($(CONFIG_ARCH_SDM855), y) |
| 35 | include $(AUDIO_ROOT)/config/sdm855auto.conf |
| 36 | export |
| 37 | INCS += -include $(AUDIO_ROOT)/config/sdm855autoconf.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\ |
| 90 | -Werror\ |
| 91 | -D__linux__ |
| 92 | |
| 93 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 94 | |
| 95 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 96 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 97 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 98 | # will override the kernel settings. |
| 99 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 100 | EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 101 | endif |
| 102 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 103 | |
| 104 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 105 | EXTRA_CFLAGS += -Wheader-guard |
| 106 | endif |
| 107 | |
Asish Bhattacharya | 5faacb3 | 2017-12-04 17:23:15 +0530 | [diff] [blame] | 108 | ifeq ($(KERNEL_BUILD), 0) |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 109 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers |
| 110 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 111 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers |
| 112 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers |
| 113 | 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] | 114 | endif |
| 115 | |
Laxminath Kasam | 8b1366a | 2017-10-05 01:44:16 +0530 | [diff] [blame] | 116 | # Module information used by KBuild framework |
| 117 | obj-$(CONFIG_SND_SOC_WCD934X) += wcd934x_dlkm.o |
| 118 | wcd934x_dlkm-y := $(WCD934X_OBJS) |
| 119 | |
| 120 | # inject some build related information |
| 121 | DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\" |