xref: /wlan-driver/platform/Android.mk (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name# Android Makefile for WLAN platform modules
2*5113495bSYour Name
3*5113495bSYour NameENABLE_WLAN_PLATFORM_DLKM := false
4*5113495bSYour Nameifeq ($(TARGET_KERNEL_DLKM_DISABLE), true)
5*5113495bSYour Name  ifeq ($(TARGET_KERNEL_DLKM_WLAN_OVERRIDE), true)
6*5113495bSYour Name    ENABLE_WLAN_PLATFORM_DLKM := true
7*5113495bSYour Name  endif
8*5113495bSYour Nameelse
9*5113495bSYour Name  ENABLE_WLAN_PLATFORM_DLKM := true
10*5113495bSYour Nameendif
11*5113495bSYour Name
12*5113495bSYour Nameifeq ($(ENABLE_WLAN_PLATFORM_DLKM), true)
13*5113495bSYour Name
14*5113495bSYour Name# LOCAL_PATH is a relative path to root build directory.
15*5113495bSYour NameLOCAL_PATH := $(call my-dir)
16*5113495bSYour NameLOCAL_MODULE_DDK_BUILD := true
17*5113495bSYour NameLOCAL_MODULE_DDK_ALLOW_UNSAFE_HEADERS := true
18*5113495bSYour NameLOCAL_MODULE_KO_DIRS := cnss2/cnss2.ko
19*5113495bSYour NameLOCAL_MODULE_KO_DIRS += cnss_utils/cnss_plat_ipc_qmi_svc.ko
20*5113495bSYour NameLOCAL_MODULE_KO_DIRS += cnss_utils/wlan_firmware_service.ko
21*5113495bSYour NameLOCAL_MODULE_KO_DIRS += cnss_genl/cnss_nl.ko
22*5113495bSYour NameLOCAL_MODULE_KO_DIRS += cnss_prealloc/cnss_prealloc.ko
23*5113495bSYour NameLOCAL_MODULE_KO_DIRS += cnss_utils/cnss_utils.ko
24*5113495bSYour NameLOCAL_MODULE_KO_DIRS += icnss2/icnss2.ko
25*5113495bSYour Name
26*5113495bSYour NameBOARD_COMMON_DIR ?= device/qcom/common
27*5113495bSYour NameDLKM_DIR := $(TOP)/$(BOARD_COMMON_DIR)/dlkm
28*5113495bSYour Name
29*5113495bSYour Name# WLAN_PLATFORM_ROOT needs to be a absolute since it will be used
30*5113495bSYour Name# for header files. $(TOP) cannot be used here since it will be
31*5113495bSYour Name# resolved as "." which won't work for Kbuild.
32*5113495bSYour NameKBUILD_OPTIONS := WLAN_PLATFORM_ROOT=$(abspath $(LOCAL_PATH))
33*5113495bSYour Name
34*5113495bSYour Name# WLAN_PLATFORM_KBUILD_OPTIONS should be defined from upper level
35*5113495bSYour Name# Product or Board related Makefiles like wlan.mk.
36*5113495bSYour NameKBUILD_OPTIONS += $(foreach wlan_platform_kbuild_option, \
37*5113495bSYour Name		   $(WLAN_PLATFORM_KBUILD_OPTIONS), \
38*5113495bSYour Name		   $(wlan_platform_kbuild_option))
39*5113495bSYour Name
40*5113495bSYour Name# Sourcing all files is for better incremental compilation.
41*5113495bSYour NameCNSS_SRC_FILES := \
42*5113495bSYour Name	$(wildcard $(LOCAL_PATH)/*) \
43*5113495bSYour Name	$(wildcard $(LOCAL_PATH)/*/*) \
44*5113495bSYour Name
45*5113495bSYour Nameifeq ($(TARGET_KERNEL_DLKM_SECURE_MSM_OVERRIDE), true)
46*5113495bSYour NameKBUILD_OPTIONS += KBUILD_EXTRA_SYMBOLS=$(PWD)/$(call intermediates-dir-for,DLKM,sec-module-symvers)/Module.symvers
47*5113495bSYour Nameendif
48*5113495bSYour Name
49*5113495bSYour Name# Module.symvers needs to be generated as a intermediate module so that
50*5113495bSYour Name# other modules which depend on WLAN platform modules can set local
51*5113495bSYour Name# dependencies to it.
52*5113495bSYour Name
53*5113495bSYour Name########################### Module.symvers ############################
54*5113495bSYour Nameinclude $(CLEAR_VARS)
55*5113495bSYour NameLOCAL_SRC_FILES           := $(CNSS_SRC_FILES)
56*5113495bSYour NameLOCAL_MODULE              := wlan-platform-module-symvers
57*5113495bSYour NameLOCAL_MODULE_STEM         := Module.symvers
58*5113495bSYour NameLOCAL_MODULE_KBUILD_NAME  := Module.symvers
59*5113495bSYour NameLOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
60*5113495bSYour Nameinclude $(DLKM_DIR)/Build_external_kernelmodule.mk
61*5113495bSYour Name
62*5113495bSYour Name# Below are for Android build system to recognize each module name, so
63*5113495bSYour Name# they can be installed properly. Since Kbuild is used to compile these
64*5113495bSYour Name# modules, invoking any of them will cause other modules to be compiled
65*5113495bSYour Name# as well if corresponding flags are added in KBUILD_OPTIONS from upper
66*5113495bSYour Name# level Makefiles like wlan.mk.
67*5113495bSYour Name
68*5113495bSYour Name################################ cnss2 ################################
69*5113495bSYour Nameinclude $(CLEAR_VARS)
70*5113495bSYour Nameifeq ($(TARGET_KERNEL_DLKM_SECURE_MSM_OVERRIDE), true)
71*5113495bSYour NameLOCAL_REQUIRED_MODULES := sec-module-symvers
72*5113495bSYour NameLOCAL_ADDITIONAL_DEPENDENCIES += $(call intermediates-dir-for,DLKM,sec-module-symvers)/Module.symvers
73*5113495bSYour Nameendif #TARGET_KERNEL_DLKM_SECURE_MSM_OVERRIDE
74*5113495bSYour NameLOCAL_SRC_FILES           := $(CNSS_SRC_FILES)
75*5113495bSYour NameLOCAL_MODULE              := cnss2.ko
76*5113495bSYour NameLOCAL_MODULE_KBUILD_NAME  := cnss2/cnss2.ko
77*5113495bSYour NameLOCAL_MODULE_TAGS         := optional
78*5113495bSYour NameLOCAL_MODULE_DEBUG_ENABLE := true
79*5113495bSYour NameLOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
80*5113495bSYour Nameinclude $(DLKM_DIR)/Build_external_kernelmodule.mk
81*5113495bSYour Name######################## cnss_plat_ipc_qmi_svc ########################
82*5113495bSYour Nameinclude $(CLEAR_VARS)
83*5113495bSYour NameLOCAL_SRC_FILES           := $(CNSS_SRC_FILES)
84*5113495bSYour NameLOCAL_MODULE              := cnss_plat_ipc_qmi_svc.ko
85*5113495bSYour NameLOCAL_MODULE_KBUILD_NAME  := cnss_utils/cnss_plat_ipc_qmi_svc.ko
86*5113495bSYour NameLOCAL_MODULE_TAGS         := optional
87*5113495bSYour NameLOCAL_MODULE_DEBUG_ENABLE := true
88*5113495bSYour NameLOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
89*5113495bSYour Nameinclude $(DLKM_DIR)/Build_external_kernelmodule.mk
90*5113495bSYour Name######################## wlan_firmware_service ########################
91*5113495bSYour Nameinclude $(CLEAR_VARS)
92*5113495bSYour NameLOCAL_SRC_FILES           := $(CNSS_SRC_FILES)
93*5113495bSYour NameLOCAL_MODULE              := wlan_firmware_service.ko
94*5113495bSYour NameLOCAL_MODULE_KBUILD_NAME  := cnss_utils/wlan_firmware_service.ko
95*5113495bSYour NameLOCAL_MODULE_TAGS         := optional
96*5113495bSYour NameLOCAL_MODULE_DEBUG_ENABLE := true
97*5113495bSYour NameLOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
98*5113495bSYour Nameinclude $(DLKM_DIR)/Build_external_kernelmodule.mk
99*5113495bSYour Name############################### cnss_nl ###############################
100*5113495bSYour Nameinclude $(CLEAR_VARS)
101*5113495bSYour NameLOCAL_SRC_FILES           := $(CNSS_SRC_FILES)
102*5113495bSYour NameLOCAL_MODULE              := cnss_nl.ko
103*5113495bSYour NameLOCAL_MODULE_KBUILD_NAME  := cnss_genl/cnss_nl.ko
104*5113495bSYour NameLOCAL_MODULE_TAGS         := optional
105*5113495bSYour NameLOCAL_MODULE_DEBUG_ENABLE := true
106*5113495bSYour NameLOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
107*5113495bSYour Nameinclude $(DLKM_DIR)/Build_external_kernelmodule.mk
108*5113495bSYour Name############################ cnss_prealloc ############################
109*5113495bSYour Nameinclude $(CLEAR_VARS)
110*5113495bSYour NameLOCAL_SRC_FILES           := $(CNSS_SRC_FILES)
111*5113495bSYour NameLOCAL_MODULE              := cnss_prealloc.ko
112*5113495bSYour NameLOCAL_MODULE_KBUILD_NAME  := cnss_prealloc/cnss_prealloc.ko
113*5113495bSYour NameLOCAL_MODULE_TAGS         := optional
114*5113495bSYour NameLOCAL_MODULE_DEBUG_ENABLE := true
115*5113495bSYour NameLOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
116*5113495bSYour Nameinclude $(DLKM_DIR)/Build_external_kernelmodule.mk
117*5113495bSYour Name############################ cnss_utils ###############################
118*5113495bSYour Nameinclude $(CLEAR_VARS)
119*5113495bSYour NameLOCAL_SRC_FILES           := $(CNSS_SRC_FILES)
120*5113495bSYour NameLOCAL_MODULE              := cnss_utils.ko
121*5113495bSYour NameLOCAL_MODULE_KBUILD_NAME  := cnss_utils/cnss_utils.ko
122*5113495bSYour NameLOCAL_MODULE_TAGS         := optional
123*5113495bSYour NameLOCAL_MODULE_DEBUG_ENABLE := true
124*5113495bSYour NameLOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
125*5113495bSYour Nameinclude $(DLKM_DIR)/Build_external_kernelmodule.mk
126*5113495bSYour Name################################ icnss2 ################################
127*5113495bSYour Nameinclude $(CLEAR_VARS)
128*5113495bSYour NameLOCAL_SRC_FILES           := $(CNSS_SRC_FILES)
129*5113495bSYour NameLOCAL_MODULE              := icnss2.ko
130*5113495bSYour NameLOCAL_MODULE_KBUILD_NAME  := icnss2/icnss2.ko
131*5113495bSYour NameLOCAL_MODULE_TAGS         := optional
132*5113495bSYour NameLOCAL_MODULE_DEBUG_ENABLE := true
133*5113495bSYour NameLOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
134*5113495bSYour Nameinclude $(DLKM_DIR)/Build_external_kernelmodule.mk
135*5113495bSYour Nameendif #ENABLE_WLAN_PLATFORM_DLKM
136