Kbuild 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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. KERNEL_BUILD := 0
  4. ifeq ($(KERNEL_BUILD), 0)
  5. # These are configurable via Kconfig for kernel-based builds
  6. # Need to explicitly configure for Android-based builds
  7. ifeq ($(CONFIG_ARCH_SDM845), y)
  8. include $(AUDIO_ROOT)/config/sdm845auto.conf
  9. export
  10. endif
  11. ifeq ($(CONFIG_ARCH_SDM670), y)
  12. include $(AUDIO_ROOT)/config/sdm670auto.conf
  13. export
  14. endif
  15. endif
  16. # As per target team, build is done as follows:
  17. # Defconfig : build with default flags
  18. # Slub : defconfig + CONFIG_SLUB_DEBUG := y +
  19. # CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y
  20. # Perf : Using appropriate msmXXXX-perf_defconfig
  21. #
  22. # Shipment builds (user variants) should not have any debug feature
  23. # enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds
  24. # are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since
  25. # there is no other way to identify defconfig builds, QTI internal
  26. # representation of perf builds (identified using the string 'perf'),
  27. # is used to identify if the build is a slub or defconfig one. This
  28. # way no critical debug feature will be enabled for perf and shipment
  29. # builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT
  30. # config.
  31. ############ UAPI ############
  32. UAPI_DIR := uapi
  33. UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR)
  34. ############ COMMON ############
  35. COMMON_DIR := include
  36. COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR)
  37. ############ ASoC Drivers ############
  38. # for SDM6xx sound card driver
  39. ifeq ($(CONFIG_SND_SOC_SDM670), m)
  40. MACHINE_OBJS += sdm660-common.o
  41. endif
  42. # for SDM6xx sound card driver
  43. ifeq ($(CONFIG_SND_SOC_INT_CODEC), m)
  44. MACHINE_OBJS += sdm660-internal.o
  45. endif
  46. # for SDM6xx sound card driver
  47. ifeq ($(CONFIG_SND_SOC_EXT_CODEC), m)
  48. MACHINE_OBJS += sdm660-external.o
  49. MACHINE_OBJS += sdm660-ext-dai-links.o
  50. endif
  51. # for SDM845 sound card driver
  52. ifeq ($(CONFIG_SND_SOC_MACHINE_SDM845), m)
  53. MACHINE_OBJS += sdm845.o
  54. endif
  55. ifeq ($(CONFIG_SND_SOC_CPE), m)
  56. CPE_LSM_OBJS += msm-cpe-lsm.o
  57. endif
  58. ifeq ($(CONFIG_SND_SOC_QDSP6V2), m)
  59. PLATFORM_OBJS += msm-audio-effects-q6-v2.o
  60. PLATFORM_OBJS += msm-compress-q6-v2.o
  61. PLATFORM_OBJS += msm-dai-fe.o
  62. PLATFORM_OBJS += msm-dai-q6-hdmi-v2.o
  63. PLATFORM_OBJS += msm-dai-q6-v2.o
  64. PLATFORM_OBJS += msm-dai-slim.o
  65. PLATFORM_OBJS += msm-dai-stub-v2.o
  66. PLATFORM_OBJS += msm-ds2-dap-config.o
  67. PLATFORM_OBJS += msm-lsm-client.o
  68. PLATFORM_OBJS += msm-pcm-afe-v2.o
  69. PLATFORM_OBJS += msm-pcm-dtmf-v2.o
  70. PLATFORM_OBJS += msm-pcm-hostless.o
  71. PLATFORM_OBJS += msm-pcm-host-voice-v2.o
  72. PLATFORM_OBJS += msm-pcm-loopback-v2.o
  73. PLATFORM_OBJS += msm-pcm-q6-noirq.o
  74. PLATFORM_OBJS += msm-pcm-q6-v2.o
  75. PLATFORM_OBJS += msm-pcm-routing-devdep.o
  76. PLATFORM_OBJS += msm-pcm-routing-v2.o
  77. PLATFORM_OBJS += msm-pcm-voice-v2.o
  78. PLATFORM_OBJS += msm-pcm-voip-v2.o
  79. PLATFORM_OBJS += msm-qti-pp-config.o
  80. PLATFORM_OBJS += msm-transcode-loopback-q6-v2.o
  81. PLATFORM_OBJS += platform_init.o
  82. endif
  83. LINUX_INC += -Iinclude/linux
  84. INCS := $(COMMON_INC) \
  85. $(UAPI_INC)
  86. ifeq ($(CONFIG_ARCH_SDM845), y)
  87. INCS += -include $(AUDIO_ROOT)/config/sdm845autoconf.h
  88. endif
  89. ifeq ($(CONFIG_ARCH_SDM670), y)
  90. INCS += -include $(AUDIO_ROOT)/config/sdm670autoconf.h
  91. endif
  92. EXTRA_CFLAGS += $(INCS)
  93. CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \
  94. -DANI_LITTLE_BIT_ENDIAN \
  95. -DDOT11F_LITTLE_ENDIAN_HOST \
  96. -DANI_COMPILER_TYPE_GCC \
  97. -DANI_OS_TYPE_ANDROID=6 \
  98. -DPTT_SOCK_SVC_ENABLE \
  99. -Wall\
  100. -Werror\
  101. -D__linux__
  102. KBUILD_CPPFLAGS += $(CDEFINES)
  103. # Currently, for versions of gcc which support it, the kernel Makefile
  104. # is disabling the maybe-uninitialized warning. Re-enable it for the
  105. # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it
  106. # will override the kernel settings.
  107. ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y)
  108. EXTRA_CFLAGS += -Wmaybe-uninitialized
  109. endif
  110. #EXTRA_CFLAGS += -Wmissing-prototypes
  111. ifeq ($(call cc-option-yn, -Wheader-guard),y)
  112. EXTRA_CFLAGS += -Wheader-guard
  113. endif
  114. KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers
  115. KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers
  116. KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/wcd934x/Module.symvers
  117. KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/sdm660_cdc/Module.symvers
  118. KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/msm_sdw/Module.symvers
  119. # Module information used by KBuild framework
  120. obj-$(CONFIG_SND_SOC_QDSP6V2) += platform_dlkm.o
  121. platform_dlkm-y := $(PLATFORM_OBJS)
  122. obj-$(CONFIG_SND_SOC_MACHINE_SDM845) += machine_dlkm.o
  123. machine_dlkm-y := $(MACHINE_OBJS)
  124. obj-$(CONFIG_SND_SOC_EXT_CODEC) += machine_dlkm.o
  125. machine_dlkm-y := $(MACHINE_OBJS)
  126. obj-$(CONFIG_SND_SOC_INT_CODEC) += machine_dlkm.o
  127. machine_dlkm-y := $(MACHINE_OBJS)
  128. obj-$(CONFIG_SND_SOC_CPE) += cpe_lsm_dlkm.o
  129. cpe_lsm_dlkm-y := $(CPE_LSM_OBJS)
  130. # inject some build related information
  131. DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\"