Ralf Herz | 5f30251 | 2018-06-21 18:50:09 +0200 | [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 | |
| 10 | |
| 11 | ifeq ($(KERNEL_BUILD), 1) |
| 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 := $(ANDROID_BUILD_TOP)/kernel/msm-4.19 |
Ralf Herz | 5f30251 | 2018-06-21 18:50:09 +0200 | [diff] [blame] | 15 | AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio |
| 16 | endif |
| 17 | |
| 18 | ifeq ($(KERNEL_BUILD), 0) |
| 19 | ifeq ($(CONFIG_ARCH_QCS405), y) |
| 20 | include $(AUDIO_ROOT)/config/qcs405auto.conf |
| 21 | export |
| 22 | INCS += -include $(AUDIO_ROOT)/config/qcs405autoconf.h |
| 23 | endif |
| 24 | endif |
| 25 | |
| 26 | # As per target team, build is done as follows: |
| 27 | # Defconfig : build with default flags |
| 28 | # Slub : defconfig + CONFIG_SLUB_DEBUG := y + |
| 29 | # CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y |
| 30 | # Perf : Using appropriate msmXXXX-perf_defconfig |
| 31 | # |
| 32 | # Shipment builds (user variants) should not have any debug feature |
| 33 | # enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds |
| 34 | # are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since |
| 35 | # there is no other way to identify defconfig builds, QTI internal |
| 36 | # representation of perf builds (identified using the string 'perf'), |
| 37 | # is used to identify if the build is a slub or defconfig one. This |
| 38 | # way no critical debug feature will be enabled for perf and shipment |
| 39 | # builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT |
| 40 | # config. |
| 41 | |
| 42 | ############ UAPI ############ |
| 43 | UAPI_DIR := uapi |
| 44 | UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR) |
| 45 | |
| 46 | ############ COMMON ############ |
| 47 | COMMON_DIR := include |
| 48 | COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR) |
| 49 | |
| 50 | ############ EP92 ############ |
| 51 | |
| 52 | # for EP92 Codec |
| 53 | ifdef CONFIG_SND_SOC_EP92 |
| 54 | EP92_OBJS += ep92.o |
| 55 | endif |
| 56 | |
| 57 | LINUX_INC += -Iinclude/linux |
| 58 | |
| 59 | INCS += $(COMMON_INC) \ |
| 60 | $(UAPI_INC) |
| 61 | |
| 62 | #EXTRA_CFLAGS += $(INCS) |
| 63 | ccflags-y += $(INCS) |
| 64 | |
| 65 | |
| 66 | CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \ |
| 67 | -DANI_LITTLE_BIT_ENDIAN \ |
| 68 | -DDOT11F_LITTLE_ENDIAN_HOST \ |
| 69 | -DANI_COMPILER_TYPE_GCC \ |
| 70 | -DANI_OS_TYPE_ANDROID=6 \ |
| 71 | -DPTT_SOCK_SVC_ENABLE \ |
| 72 | -Wall\ |
| 73 | -Werror\ |
| 74 | -D__linux__ |
| 75 | |
| 76 | KBUILD_CPPFLAGS += $(CDEFINES) |
| 77 | |
| 78 | # Currently, for versions of gcc which support it, the kernel Makefile |
| 79 | # is disabling the maybe-uninitialized warning. Re-enable it for the |
| 80 | # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it |
| 81 | # will override the kernel settings. |
| 82 | ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y) |
| 83 | #EXTRA_CFLAGS += -Wmaybe-uninitialized |
| 84 | ccflags-y += -Wmaybe-uninitialized |
| 85 | endif |
| 86 | #EXTRA_CFLAGS += -Wmissing-prototypes |
| 87 | |
| 88 | ifeq ($(call cc-option-yn, -Wheader-guard),y) |
| 89 | #EXTRA_CFLAGS += -Wheader-guard |
| 90 | ccflags-y += -Wheader-guard |
| 91 | endif |
| 92 | |
| 93 | ifeq ($(KERNEL_BUILD), 0) |
| 94 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers |
| 95 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers |
| 96 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers |
| 97 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers |
| 98 | KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers |
| 99 | endif |
| 100 | |
| 101 | # Module information used by KBuild framework |
| 102 | obj-$(CONFIG_SND_SOC_EP92) += ep92_dlkm.o |
| 103 | ep92_dlkm-y := $(EP92_OBJS) |
| 104 | |
| 105 | # inject some build related information |
| 106 | DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\" |