Kbuild 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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. ifeq ($(KERNEL_BUILD), 1)
  9. # These are configurable via Kconfig for kernel-based builds
  10. # Need to explicitly configure for Android-based builds
  11. AUDIO_BLD_DIR := $(shell pwd)/kernel/msm-5.4
  12. AUDIO_ROOT := $(AUDIO_BLD_DIR)/techpack/audio
  13. endif
  14. ifeq ($(KERNEL_BUILD), 0)
  15. ifeq ($(CONFIG_ARCH_SM6150), y)
  16. include $(AUDIO_ROOT)/config/sm6150auto.conf
  17. export
  18. INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h
  19. endif
  20. ifeq ($(CONFIG_ARCH_TRINKET), y)
  21. include $(AUDIO_ROOT)/config/sm6150auto.conf
  22. export
  23. INCS += -include $(AUDIO_ROOT)/config/sm6150autoconf.h
  24. endif
  25. ifeq ($(CONFIG_ARCH_KONA), y)
  26. include $(AUDIO_ROOT)/config/konaauto.conf
  27. INCS += -include $(AUDIO_ROOT)/config/konaautoconf.h
  28. endif
  29. ifeq ($(CONFIG_ARCH_WAIPIO), y)
  30. include $(AUDIO_ROOT)/config/waipioauto.conf
  31. INCS += -include $(AUDIO_ROOT)/config/waipioautoconf.h
  32. endif
  33. ifeq ($(CONFIG_ARCH_KALAMA), y)
  34. include $(AUDIO_ROOT)/config/kalamaauto.conf
  35. INCS += -include $(AUDIO_ROOT)/config/kalamaautoconf.h
  36. endif
  37. ifeq ($(CONFIG_ARCH_LITO), y)
  38. include $(AUDIO_ROOT)/config/litoauto.conf
  39. export
  40. INCS += -include $(AUDIO_ROOT)/config/litoautoconf.h
  41. endif
  42. ifeq ($(CONFIG_ARCH_BENGAL), y)
  43. include $(AUDIO_ROOT)/config/bengalauto.conf
  44. export
  45. INCS += -include $(AUDIO_ROOT)/config/bengalautoconf.h
  46. endif
  47. ifeq ($(CONFIG_ARCH_QCS405), y)
  48. include $(AUDIO_ROOT)/config/qcs405auto.conf
  49. export
  50. INCS += -include $(AUDIO_ROOT)/config/qcs405autoconf.h
  51. endif
  52. endif
  53. # As per target team, build is done as follows:
  54. # Defconfig : build with default flags
  55. # Slub : defconfig + CONFIG_SLUB_DEBUG := y +
  56. # CONFIG_SLUB_DEBUG_ON := y + CONFIG_PAGE_POISONING := y
  57. # Perf : Using appropriate msmXXXX-perf_defconfig
  58. #
  59. # Shipment builds (user variants) should not have any debug feature
  60. # enabled. This is identified using 'TARGET_BUILD_VARIANT'. Slub builds
  61. # are identified using the CONFIG_SLUB_DEBUG_ON configuration. Since
  62. # there is no other way to identify defconfig builds, QTI internal
  63. # representation of perf builds (identified using the string 'perf'),
  64. # is used to identify if the build is a slub or defconfig one. This
  65. # way no critical debug feature will be enabled for perf and shipment
  66. # builds. Other OEMs are also protected using the TARGET_BUILD_VARIANT
  67. # config.
  68. ############ UAPI ############
  69. UAPI_DIR := uapi/audio
  70. UAPI_INC := -I$(AUDIO_ROOT)/include/$(UAPI_DIR)
  71. ############ COMMON ############
  72. COMMON_DIR := include
  73. COMMON_INC := -I$(AUDIO_ROOT)/$(COMMON_DIR)
  74. ############ LPASS_CDC ############
  75. # for LPASS_CDC Codec
  76. ifdef CONFIG_SND_SOC_LPASS_CDC
  77. LPASS_CDC_OBJS += lpass-cdc.o
  78. LPASS_CDC_OBJS += lpass-cdc-comp.o
  79. LPASS_CDC_OBJS += lpass-cdc-utils.o
  80. LPASS_CDC_OBJS += lpass-cdc-regmap.o
  81. LPASS_CDC_OBJS += lpass-cdc-tables.o
  82. LPASS_CDC_OBJS += lpass-cdc-clk-rsc.o
  83. endif
  84. ifdef CONFIG_LPASS_CDC_WSA2_MACRO
  85. WSA2_OBJS += lpass-cdc-wsa2-macro.o
  86. endif
  87. ifdef CONFIG_LPASS_CDC_WSA_MACRO
  88. WSA_OBJS += lpass-cdc-wsa-macro.o
  89. endif
  90. ifdef CONFIG_LPASS_CDC_VA_MACRO
  91. VA_OBJS += lpass-cdc-va-macro.o
  92. endif
  93. ifdef CONFIG_LPASS_CDC_TX_MACRO
  94. TX_OBJS += lpass-cdc-tx-macro.o
  95. endif
  96. ifdef CONFIG_LPASS_CDC_RX_MACRO
  97. RX_OBJS += lpass-cdc-rx-macro.o
  98. endif
  99. LINUX_INC += -Iinclude/linux
  100. INCS += $(COMMON_INC) \
  101. $(UAPI_INC)
  102. EXTRA_CFLAGS += $(INCS)
  103. CDEFINES += -DANI_LITTLE_BYTE_ENDIAN \
  104. -DANI_LITTLE_BIT_ENDIAN \
  105. -DDOT11F_LITTLE_ENDIAN_HOST \
  106. -DANI_COMPILER_TYPE_GCC \
  107. -DANI_OS_TYPE_ANDROID=6 \
  108. -DPTT_SOCK_SVC_ENABLE \
  109. -Wall\
  110. -Werror\
  111. -D__linux__
  112. KBUILD_CPPFLAGS += $(CDEFINES)
  113. # Currently, for versions of gcc which support it, the kernel Makefile
  114. # is disabling the maybe-uninitialized warning. Re-enable it for the
  115. # AUDIO driver. Note that we must use EXTRA_CFLAGS here so that it
  116. # will override the kernel settings.
  117. ifeq ($(call cc-option-yn, -Wmaybe-uninitialized),y)
  118. EXTRA_CFLAGS += -Wmaybe-uninitialized
  119. endif
  120. #EXTRA_CFLAGS += -Wmissing-prototypes
  121. ifeq ($(call cc-option-yn, -Wheader-guard),y)
  122. EXTRA_CFLAGS += -Wheader-guard
  123. endif
  124. ifeq ($(KERNEL_BUILD), 0)
  125. KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/ipc/Module.symvers
  126. KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/dsp/Module.symvers
  127. KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/Module.symvers
  128. KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/Module.symvers
  129. KBUILD_EXTRA_SYMBOLS +=$(OUT)/obj/vendor/qcom/opensource/audio-kernel/soc/Module.symvers
  130. endif
  131. # Module information used by KBuild framework
  132. obj-$(CONFIG_SND_SOC_LPASS_CDC) += lpass_cdc_dlkm.o
  133. lpass_cdc_dlkm-y := $(LPASS_CDC_OBJS)
  134. obj-$(CONFIG_LPASS_CDC_WSA2_MACRO) += lpass_cdc_wsa2_macro_dlkm.o
  135. lpass_cdc_wsa2_macro_dlkm-y := $(WSA2_OBJS)
  136. obj-$(CONFIG_LPASS_CDC_WSA_MACRO) += lpass_cdc_wsa_macro_dlkm.o
  137. lpass_cdc_wsa_macro_dlkm-y := $(WSA_OBJS)
  138. obj-$(CONFIG_LPASS_CDC_VA_MACRO) += lpass_cdc_va_macro_dlkm.o
  139. lpass_cdc_va_macro_dlkm-y := $(VA_OBJS)
  140. obj-$(CONFIG_LPASS_CDC_TX_MACRO) += lpass_cdc_tx_macro_dlkm.o
  141. lpass_cdc_tx_macro_dlkm-y := $(TX_OBJS)
  142. obj-$(CONFIG_LPASS_CDC_RX_MACRO) += lpass_cdc_rx_macro_dlkm.o
  143. lpass_cdc_rx_macro_dlkm-y := $(RX_OBJS)
  144. # inject some build related information
  145. DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\"