Android.mk 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # Android Makefile for WLAN platform modules
  2. ENABLE_WLAN_PLATFORM_DLKM := false
  3. ifeq ($(TARGET_KERNEL_DLKM_DISABLE), true)
  4. ifeq ($(TARGET_KERNEL_DLKM_WLAN_OVERRIDE), true)
  5. ENABLE_WLAN_PLATFORM_DLKM := true
  6. endif
  7. else
  8. ENABLE_WLAN_PLATFORM_DLKM := true
  9. endif
  10. ifeq ($(ENABLE_WLAN_PLATFORM_DLKM), true)
  11. # LOCAL_PATH is a relative path to root build directory.
  12. LOCAL_PATH := $(call my-dir)
  13. DLKM_DIR := $(TOP)/device/qcom/common/dlkm
  14. # WLAN_PLATFORM_ROOT needs to be a absolute since it will be used
  15. # for header files. $(TOP) cannot be used here since it will be
  16. # resolved as "." which won't work for Kbuild.
  17. KBUILD_OPTIONS := WLAN_PLATFORM_ROOT=$(abspath $(LOCAL_PATH))
  18. # WLAN_PLATFORM_KBUILD_OPTIONS should be defined from upper level
  19. # Product or Board related Makefiles like wlan.mk.
  20. KBUILD_OPTIONS += $(foreach wlan_platform_kbuild_option, \
  21. $(WLAN_PLATFORM_KBUILD_OPTIONS), \
  22. $(wlan_platform_kbuild_option))
  23. # Sourcing all files is for better incremental compilation.
  24. CNSS_SRC_FILES := \
  25. $(wildcard $(LOCAL_PATH)/*) \
  26. $(wildcard $(LOCAL_PATH)/*/*) \
  27. KBUILD_OPTIONS += KBUILD_EXTRA_SYMBOLS=$(PWD)/$(call intermediates-dir-for,DLKM,sec-module-symvers)/Module.symvers
  28. # Module.symvers needs to be generated as a intermediate module so that
  29. # other modules which depend on WLAN platform modules can set local
  30. # dependencies to it.
  31. ########################### Module.symvers ############################
  32. include $(CLEAR_VARS)
  33. LOCAL_SRC_FILES := $(CNSS_SRC_FILES)
  34. LOCAL_MODULE := wlan-platform-module-symvers
  35. LOCAL_MODULE_STEM := Module.symvers
  36. LOCAL_MODULE_KBUILD_NAME := Module.symvers
  37. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  38. include $(DLKM_DIR)/Build_external_kernelmodule.mk
  39. # Below are for Android build system to recognize each module name, so
  40. # they can be installed properly. Since Kbuild is used to compile these
  41. # modules, invoking any of them will cause other modules to be compiled
  42. # as well if corresponding flags are added in KBUILD_OPTIONS from upper
  43. # level Makefiles like wlan.mk.
  44. ################################ cnss2 ################################
  45. include $(CLEAR_VARS)
  46. LOCAL_REQUIRED_MODULES := sec-module-symvers
  47. LOCAL_ADDITIONAL_DEPENDENCIES += $(call intermediates-dir-for,DLKM,sec-module-symvers)/Module.symvers
  48. LOCAL_SRC_FILES := $(CNSS_SRC_FILES)
  49. LOCAL_MODULE := cnss2.ko
  50. LOCAL_MODULE_KBUILD_NAME := cnss2/cnss2.ko
  51. LOCAL_MODULE_TAGS := optional
  52. LOCAL_MODULE_DEBUG_ENABLE := true
  53. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  54. include $(DLKM_DIR)/Build_external_kernelmodule.mk
  55. ######################## cnss_plat_ipc_qmi_svc ########################
  56. include $(CLEAR_VARS)
  57. LOCAL_SRC_FILES := $(CNSS_SRC_FILES)
  58. LOCAL_MODULE := cnss_plat_ipc_qmi_svc.ko
  59. LOCAL_MODULE_KBUILD_NAME := cnss_utils/cnss_plat_ipc_qmi_svc.ko
  60. LOCAL_MODULE_TAGS := optional
  61. LOCAL_MODULE_DEBUG_ENABLE := true
  62. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  63. include $(DLKM_DIR)/Build_external_kernelmodule.mk
  64. ######################## wlan_firmware_service ########################
  65. include $(CLEAR_VARS)
  66. LOCAL_SRC_FILES := $(CNSS_SRC_FILES)
  67. LOCAL_MODULE := wlan_firmware_service.ko
  68. LOCAL_MODULE_KBUILD_NAME := cnss_utils/wlan_firmware_service.ko
  69. LOCAL_MODULE_TAGS := optional
  70. LOCAL_MODULE_DEBUG_ENABLE := true
  71. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  72. include $(DLKM_DIR)/Build_external_kernelmodule.mk
  73. ############################### cnss_nl ###############################
  74. include $(CLEAR_VARS)
  75. LOCAL_SRC_FILES := $(CNSS_SRC_FILES)
  76. LOCAL_MODULE := cnss_nl.ko
  77. LOCAL_MODULE_KBUILD_NAME := cnss_genl/cnss_nl.ko
  78. LOCAL_MODULE_TAGS := optional
  79. LOCAL_MODULE_DEBUG_ENABLE := true
  80. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  81. include $(DLKM_DIR)/Build_external_kernelmodule.mk
  82. ############################ cnss_prealloc ############################
  83. include $(CLEAR_VARS)
  84. LOCAL_SRC_FILES := $(CNSS_SRC_FILES)
  85. LOCAL_MODULE := cnss_prealloc.ko
  86. LOCAL_MODULE_KBUILD_NAME := cnss_prealloc/cnss_prealloc.ko
  87. LOCAL_MODULE_TAGS := optional
  88. LOCAL_MODULE_DEBUG_ENABLE := true
  89. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  90. include $(DLKM_DIR)/Build_external_kernelmodule.mk
  91. ############################ cnss_utils ###############################
  92. include $(CLEAR_VARS)
  93. LOCAL_SRC_FILES := $(CNSS_SRC_FILES)
  94. LOCAL_MODULE := cnss_utils.ko
  95. LOCAL_MODULE_KBUILD_NAME := cnss_utils/cnss_utils.ko
  96. LOCAL_MODULE_TAGS := optional
  97. LOCAL_MODULE_DEBUG_ENABLE := true
  98. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  99. include $(DLKM_DIR)/Build_external_kernelmodule.mk
  100. ################################ icnss2 ################################
  101. include $(CLEAR_VARS)
  102. LOCAL_SRC_FILES := $(CNSS_SRC_FILES)
  103. LOCAL_MODULE := icnss2.ko
  104. LOCAL_MODULE_KBUILD_NAME := icnss2/icnss2.ko
  105. LOCAL_MODULE_TAGS := optional
  106. LOCAL_MODULE_DEBUG_ENABLE := true
  107. LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
  108. include $(DLKM_DIR)/Build_external_kernelmodule.mk
  109. endif #ENABLE_WLAN_PLATFORM_DLKM