Android.mk 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # Android makefile for audio kernel modules
  2. # Assume no targets will be supported
  3. # Check if this driver needs be built for current target
  4. ifeq ($(call is-board-platform,sdm845),true)
  5. TARGET := sdm845
  6. AUDIO_SELECT := CONFIG_SND_SOC_SDM845=m
  7. endif
  8. ifeq ($(call is-board-platform-in-list,sdm670 qcs605),true)
  9. TARGET := sdm670
  10. AUDIO_SELECT := CONFIG_SND_SOC_SDM670=m
  11. endif
  12. AUDIO_CHIPSET := audio
  13. # Build/Package only in case of supported target
  14. ifeq ($(call is-board-platform-in-list,sdm845 sdm670 qcs605),true)
  15. LOCAL_PATH := $(call my-dir)
  16. # This makefile is only for DLKM
  17. ifneq ($(findstring vendor,$(LOCAL_PATH)),)
  18. ifneq ($(findstring opensource,$(LOCAL_PATH)),)
  19. AUDIO_BLD_DIR := $(ANDROID_BUILD_TOP)/vendor/qcom/opensource/audio-kernel
  20. endif # opensource
  21. DLKM_DIR := $(TOP)/device/qcom/common/dlkm
  22. # Build audio.ko as $(AUDIO_CHIPSET)_audio.ko
  23. ###########################################################
  24. # This is set once per LOCAL_PATH, not per (kernel) module
  25. KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR)
  26. # We are actually building audio.ko here, as per the
  27. # requirement we are specifying <chipset>_audio.ko as LOCAL_MODULE.
  28. # This means we need to rename the module to <chipset>_audio.ko
  29. # after audio.ko is built.
  30. KBUILD_OPTIONS += MODNAME=platform_dlkm
  31. KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
  32. KBUILD_OPTIONS += $(AUDIO_SELECT)
  33. ###########################################################
  34. include $(CLEAR_VARS)
  35. LOCAL_MODULE := $(AUDIO_CHIPSET)_platform.ko
  36. LOCAL_MODULE_KBUILD_NAME := platform_dlkm.ko
  37. LOCAL_MODULE_TAGS := optional
  38. LOCAL_MODULE_DEBUG_ENABLE := true
  39. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  40. include $(DLKM_DIR)/AndroidKernelModule.mk
  41. ###########################################################
  42. ifeq ($(call is-board-platform-in-list,sdm670 qcs605),true)
  43. include $(CLEAR_VARS)
  44. LOCAL_MODULE := $(AUDIO_CHIPSET)_cpe_lsm.ko
  45. LOCAL_MODULE_KBUILD_NAME := cpe_lsm_dlkm.ko
  46. LOCAL_MODULE_TAGS := optional
  47. LOCAL_MODULE_DEBUG_ENABLE := true
  48. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  49. include $(DLKM_DIR)/AndroidKernelModule.mk
  50. endif
  51. ###########################################################
  52. include $(CLEAR_VARS)
  53. LOCAL_MODULE := $(AUDIO_CHIPSET)_machine_$(TARGET).ko
  54. LOCAL_MODULE_KBUILD_NAME := machine_dlkm.ko
  55. LOCAL_MODULE_TAGS := optional
  56. LOCAL_MODULE_DEBUG_ENABLE := true
  57. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  58. include $(DLKM_DIR)/AndroidKernelModule.mk
  59. ###########################################################
  60. endif # DLKM check
  61. endif # supported target check