Kbuild 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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_HOLI), y)
  34. include $(AUDIO_ROOT)/config/holiauto.conf
  35. INCS += -include $(AUDIO_ROOT)/config/holiautoconf.h
  36. endif
  37. ifeq ($(CONFIG_ARCH_BLAIR), y)
  38. include $(AUDIO_ROOT)/config/holiauto.conf
  39. INCS += -include $(AUDIO_ROOT)/config/holiautoconf.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_KHAJE), 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. ############ BOLERO ############
  79. # for BOLERO Codec
  80. ifdef CONFIG_SND_SOC_BOLERO
  81. BOLERO_OBJS += bolero-cdc.o
  82. BOLERO_OBJS += bolero-cdc-utils.o
  83. BOLERO_OBJS += bolero-cdc-regmap.o
  84. BOLERO_OBJS += bolero-cdc-tables.o
  85. BOLERO_OBJS += bolero-clk-rsc.o
  86. endif
  87. ifdef CONFIG_WSA_MACRO
  88. WSA_OBJS += wsa-macro.o
  89. endif
  90. ifdef CONFIG_VA_MACRO
  91. VA_OBJS += va-macro.o
  92. endif
  93. ifdef CONFIG_TX_MACRO
  94. TX_OBJS += tx-macro.o
  95. endif
  96. ifdef CONFIG_RX_MACRO
  97. RX_OBJS += 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. # Module information used by KBuild framework
  125. obj-$(CONFIG_SND_SOC_BOLERO) += bolero_cdc_dlkm.o
  126. bolero_cdc_dlkm-y := $(BOLERO_OBJS)
  127. obj-$(CONFIG_WSA_MACRO) += wsa_macro_dlkm.o
  128. wsa_macro_dlkm-y := $(WSA_OBJS)
  129. obj-$(CONFIG_VA_MACRO) += va_macro_dlkm.o
  130. va_macro_dlkm-y := $(VA_OBJS)
  131. obj-$(CONFIG_TX_MACRO) += tx_macro_dlkm.o
  132. tx_macro_dlkm-y := $(TX_OBJS)
  133. obj-$(CONFIG_RX_MACRO) += rx_macro_dlkm.o
  134. rx_macro_dlkm-y := $(RX_OBJS)