Android.mk 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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,msmnile),true)
  5. AUDIO_SELECT := CONFIG_SND_SOC_SM8150=m
  6. endif
  7. ifeq ($(call is-board-platform,$(MSMSTEPPE) $(TRINKET)),true)
  8. AUDIO_SELECT := CONFIG_SND_SOC_SM6150=m
  9. endif
  10. AUDIO_CHIPSET := audio
  11. # Build/Package only in case of supported target
  12. ifeq ($(call is-board-platform-in-list,msmnile $(MSMSTEPPE) $(TRINKET)),true)
  13. LOCAL_PATH := $(call my-dir)
  14. # This makefile is only for DLKM
  15. ifneq ($(findstring vendor,$(LOCAL_PATH)),)
  16. ifneq ($(findstring opensource,$(LOCAL_PATH)),)
  17. AUDIO_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/audio-kernel
  18. endif # opensource
  19. DLKM_DIR := $(TOP)/device/qcom/common/dlkm
  20. # Build audio.ko as $(AUDIO_CHIPSET)_audio.ko
  21. ###########################################################
  22. # This is set once per LOCAL_PATH, not per (kernel) module
  23. KBUILD_OPTIONS := AUDIO_ROOT=$(AUDIO_BLD_DIR)
  24. # We are actually building audio.ko here, as per the
  25. # requirement we are specifying <chipset>_audio.ko as LOCAL_MODULE.
  26. # This means we need to rename the module to <chipset>_audio.ko
  27. # after audio.ko is built.
  28. KBUILD_OPTIONS += MODNAME=native_dlkm
  29. KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
  30. KBUILD_OPTIONS += $(AUDIO_SELECT)
  31. ###########################################################
  32. include $(CLEAR_VARS)
  33. LOCAL_MODULE := $(AUDIO_CHIPSET)_native.ko
  34. LOCAL_MODULE_KBUILD_NAME := native_dlkm.ko
  35. LOCAL_MODULE_TAGS := optional
  36. LOCAL_MODULE_DEBUG_ENABLE := true
  37. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  38. include $(DLKM_DIR)/AndroidKernelModule.mk
  39. ###########################################################
  40. ###########################################################
  41. endif # DLKM check
  42. endif # supported target check