Kbuild 5.5 KB

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