Переглянути джерело

qcacld-3.0: Kbuild: Add support for nested composites

As a result of long path names and a large number of source files,
combined with upstream kernel build infrastructure changes, the
qcacld-3.0 build may encounter E2BIG errors when linking the final
wlan.o. To address this problem support for nested composite objects
is being added to the kernel. Update the Kbuild with the logic
required to take advantage of the nested composite support.

Change-Id: Ic6748517a922fc03a43acab2b44133b37e02707a
CRs-Fixed: 2861273
Jeff Johnson 4 роки тому
батько
коміт
b1dc01e081
1 змінених файлів з 171 додано та 79 видалено
  1. 171 79
      Kbuild

+ 171 - 79
Kbuild

@@ -47,6 +47,23 @@ include $(WLAN_CFG_OVERRIDE_FILE)
 $(warning "Overriding WLAN config with: $(shell cat $(WLAN_CFG_OVERRIDE_FILE))")
 endif
 
+OBJS :=
+OBJS_DIRS :=
+
+define add-wlan-objs
+$(eval
+  ifneq ($$(2),)
+    ifeq ($$(KERNEL_SUPPORTS_NESTED_COMPOSITES),y)
+      OBJS_DIRS += $$(dir $$(2))
+      OBJS += $$(1).o
+      $$(1)-y := $$(2)
+    else
+      OBJS += $$(2)
+    endif
+  endif
+)
+endef
+
 ############ UAPI ############
 UAPI_DIR :=	uapi
 UAPI_INC :=	-I$(WLAN_ROOT)/$(UAPI_DIR)/linux
@@ -436,6 +453,8 @@ ifeq ($(CONFIG_FEATURE_BUS_BANDWIDTH_MGR),y)
 HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_bus_bandwidth.o
 endif
 
+$(call add-wlan-objs,hdd,$(HDD_OBJS))
+
 ###### OSIF_SYNC ########
 SYNC_DIR := os_if/sync
 SYNC_INC_DIR := $(SYNC_DIR)/inc
@@ -451,6 +470,8 @@ SYNC_OBJS := \
 	$(SYNC_SRC_DIR)/osif_psoc_sync.o \
 	$(SYNC_SRC_DIR)/osif_vdev_sync.o \
 
+$(call add-wlan-objs,sync,$(SYNC_OBJS))
+
 ########### Driver Synchronization Core (DSC) ###########
 DSC_DIR := components/dsc
 DSC_INC_DIR := $(DSC_DIR)/inc
@@ -472,6 +493,8 @@ ifeq ($(CONFIG_DSC_TEST), y)
 	DSC_OBJS += $(DSC_TEST_DIR)/wlan_dsc_test.o
 endif
 
+$(call add-wlan-objs,dsc,$(DSC_OBJS))
+
 cppflags-$(CONFIG_ONE_MSI_VECTOR) += -DWLAN_ONE_MSI_VECTOR
 
 cppflags-$(CONFIG_DSC_DEBUG) += -DWLAN_DSC_DEBUG
@@ -490,6 +513,8 @@ ifeq ($(BUILD_DIAG_VERSION), y)
 HOST_DIAG_LOG_OBJS +=	$(HOST_DIAG_LOG_SRC_DIR)/host_diag_log.o
 endif
 
+$(call add-wlan-objs,host_diag_log,$(HOST_DIAG_LOG_OBJS))
+
 ############ EPPING ############
 EPPING_DIR :=	$(WLAN_COMMON_ROOT)/utils/epping
 EPPING_INC_DIR :=	$(EPPING_DIR)/inc
@@ -505,6 +530,8 @@ EPPING_OBJS := $(EPPING_SRC_DIR)/epping_main.o \
 		$(EPPING_SRC_DIR)/epping_helper.o
 endif
 
+$(call add-wlan-objs,epping,$(EPPING_OBJS))
+
 ############ SYS ############
 CMN_SYS_DIR :=	$(WLAN_COMMON_ROOT)/utils/sys
 CMN_SYS_INC_DIR := 	$(CMN_SYS_DIR)
@@ -591,6 +618,8 @@ MAC_OBJS := 	$(MAC_CFG_OBJS) \
 		$(MAC_RRM_OBJS) \
 		$(MAC_NDP_OBJS)
 
+$(call add-wlan-objs,mac,$(MAC_OBJS))
+
 ############ SAP ############
 SAP_DIR :=	core/sap
 SAP_INC_DIR :=	$(SAP_DIR)/inc
@@ -604,6 +633,8 @@ SAP_OBJS :=	$(SAP_SRC_DIR)/sap_api_link_cntl.o \
 		$(SAP_SRC_DIR)/sap_fsm.o \
 		$(SAP_SRC_DIR)/sap_module.o
 
+$(call add-wlan-objs,sap,$(SAP_OBJS))
+
 ############ CFG ############
 CFG_REL_DIR := $(WLAN_COMMON_ROOT)/cfg
 CFG_DIR := $(WLAN_ROOT)/$(CFG_REL_DIR)
@@ -614,6 +645,8 @@ CFG_INC := \
 CFG_OBJS := \
 	$(CFG_REL_DIR)/src/cfg.o
 
+$(call add-wlan-objs,cfg,$(CFG_OBJS))
+
 ############ DFS ############
 DFS_DIR :=     $(WLAN_COMMON_ROOT)/umac/dfs
 DFS_CORE_INC_DIR := $(DFS_DIR)/core/inc
@@ -662,6 +695,8 @@ DFS_OBJS +=	$(WLAN_COMMON_ROOT)/target_if/dfs/src/target_if_dfs_partial_offload.
 endif
 endif
 
+$(call add-wlan-objs,dfs,$(DFS_OBJS))
+
 ############ SME ############
 SME_DIR :=	core/sme
 SME_INC_DIR :=	$(SME_DIR)/inc
@@ -703,6 +738,8 @@ SME_OBJS :=	$(SME_CMN_OBJS) \
 		$(SME_NAN_OBJS) \
 		$(SME_NDP_OBJS)
 
+$(call add-wlan-objs,sme,$(SME_OBJS))
+
 ############ NLINK ############
 NLINK_DIR     :=	$(WLAN_COMMON_ROOT)/utils/nlink
 NLINK_INC_DIR :=	$(NLINK_DIR)/inc
@@ -711,6 +748,8 @@ NLINK_SRC_DIR :=	$(NLINK_DIR)/src
 NLINK_INC     := 	-I$(WLAN_ROOT)/$(NLINK_INC_DIR)
 NLINK_OBJS    :=	$(NLINK_SRC_DIR)/wlan_nlink_srv.o
 
+$(call add-wlan-objs,nlink,$(NLINK_OBJS))
+
 ############ PTT ############
 PTT_DIR     :=	$(WLAN_COMMON_ROOT)/utils/ptt
 PTT_INC_DIR :=	$(PTT_DIR)/inc
@@ -719,6 +758,8 @@ PTT_SRC_DIR :=	$(PTT_DIR)/src
 PTT_INC     := 	-I$(WLAN_ROOT)/$(PTT_INC_DIR)
 PTT_OBJS    :=	$(PTT_SRC_DIR)/wlan_ptt_sock_svc.o
 
+$(call add-wlan-objs,ptt,$(PTT_OBJS))
+
 ############ WLAN_LOGGING ############
 WLAN_LOGGING_DIR     :=	$(WLAN_COMMON_ROOT)/utils/logging
 WLAN_LOGGING_INC_DIR :=	$(WLAN_LOGGING_DIR)/inc
@@ -728,6 +769,8 @@ WLAN_LOGGING_INC     := -I$(WLAN_ROOT)/$(WLAN_LOGGING_INC_DIR)
 WLAN_LOGGING_OBJS    := $(WLAN_LOGGING_SRC_DIR)/wlan_logging_sock_svc.o \
 		$(WLAN_LOGGING_SRC_DIR)/wlan_roam_debug.o
 
+$(call add-wlan-objs,wlan_logging,$(WLAN_LOGGING_OBJS))
+
 ############ SYS ############
 SYS_DIR :=	core/mac/src/sys
 
@@ -747,6 +790,8 @@ SYS_OBJS :=	$(SYS_COMMON_SRC_DIR)/wlan_qct_sys.o \
 		$(SYS_LEGACY_SRC_DIR)/utils/src/parser_api.o \
 		$(SYS_LEGACY_SRC_DIR)/utils/src/utils_parser.o
 
+$(call add-wlan-objs,sys,$(SYS_OBJS))
+
 ############ Qcacld WMI ###################
 WMI_DIR := components/wmi
 
@@ -765,6 +810,8 @@ endif
 CLD_WMI_OBJS :=	$(CLD_WMI_ROAM_OBJS) \
 		$(CLD_WMI_MC_CP_STATS_OBJS)
 
+$(call add-wlan-objs,cld_wmi,$(CLD_WMI_OBJS))
+
 ############ Qca-wifi-host-cmn ############
 QDF_OS_DIR :=	qdf
 QDF_OS_INC_DIR := $(QDF_OS_DIR)/inc
@@ -851,6 +898,8 @@ ifeq ($(CONFIG_WLAN_LRO), y)
 QDF_OBJS +=     $(QDF_LINUX_OBJ_DIR)/qdf_lro.o
 endif
 
+$(call add-wlan-objs,qdf,$(QDF_OBJS))
+
 cppflags-$(CONFIG_TALLOC_DEBUG) += -DWLAN_TALLOC_DEBUG
 cppflags-$(CONFIG_QDF_TEST) += -DWLAN_DELAYED_WORK_TEST
 cppflags-$(CONFIG_QDF_TEST) += -DWLAN_HASHTABLE_TEST
@@ -874,6 +923,8 @@ ifeq ($(CONFIG_WLAN_WBUFF), y)
 WBUFF_OBJS += 	$(WBUFF_OBJ_DIR)/wbuff.o
 endif
 
+$(call add-wlan-objs,wbuff,$(WBUFF_OBJS))
+
 ##########QAL #######
 QAL_OS_DIR :=	qal
 QAL_OS_INC_DIR := $(QAL_OS_DIR)/inc
@@ -910,6 +961,8 @@ ifeq ($(CONFIG_CRYPTO_COMPONENT), y)
 OS_IF_OBJ += $(OS_IF_DIR)/linux/crypto/src/wlan_cfg80211_crypto.o
 endif
 
+$(call add-wlan-objs,os_if,$(OS_IF_OBJ))
+
 ############ UMAC_DISP ############
 UMAC_DISP_DIR := umac/global_umac_dispatcher/lmac_if
 UMAC_DISP_INC_DIR := $(UMAC_DISP_DIR)/inc
@@ -920,6 +973,8 @@ UMAC_DISP_INC := -I$(WLAN_COMMON_INC)/$(UMAC_DISP_INC_DIR)
 
 UMAC_DISP_OBJS := $(UMAC_DISP_OBJ_DIR)/wlan_lmac_if.o
 
+$(call add-wlan-objs,umac_disp,$(UMAC_DISP_OBJS))
+
 ############# UMAC_SCAN ############
 UMAC_SCAN_DIR := umac/scan
 UMAC_SCAN_DISP_INC_DIR := $(UMAC_SCAN_DIR)/dispatcher/inc
@@ -949,6 +1004,8 @@ ifeq ($(CONFIG_BAND_6GHZ), y)
 UMAC_SCAN_OBJS += $(UMAC_SCAN_CORE_DIR)/wlan_scan_manager_6ghz.o
 endif
 
+$(call add-wlan-objs,umac_scan,$(UMAC_SCAN_OBJS))
+
 ############# UMAC_SPECTRAL_SCAN ############
 UMAC_SPECTRAL_DIR := spectral
 UMAC_SPECTRAL_DISP_INC_DIR := $(UMAC_SPECTRAL_DIR)/dispatcher/inc
@@ -973,6 +1030,9 @@ UMAC_SPECTRAL_OBJS := $(UMAC_SPECTRAL_CORE_DIR)/spectral_offload.o \
 		$(WLAN_COMMON_ROOT)/target_if/spectral/target_if_spectral.o \
 		$(WLAN_COMMON_ROOT)/target_if/spectral/target_if_spectral_sim.o
 endif
+
+$(call add-wlan-objs,umac_spectral,$(UMAC_SPECTRAL_OBJS))
+
 ############# WLAN_CFR ############
 WLAN_CFR_DIR := umac/cfr
 WLAN_CFR_DISP_INC_DIR := $(WLAN_CFR_DIR)/dispatcher/inc
@@ -993,6 +1053,9 @@ WLAN_CFR_OBJS := $(WLAN_CFR_CORE_DIR)/cfr_common.o \
 		$(WLAN_COMMON_ROOT)/target_if/cfr/src/target_if_cfr_enh.o \
 		$(WLAN_COMMON_ROOT)/target_if/cfr/src/target_if_cfr_6490.o
 endif
+
+$(call add-wlan-objs,wlan_cfr,$(WLAN_CFR_OBJS))
+
 ############# GPIO_CFG ############
 UMAC_GPIO_DIR := gpio
 UMAC_GPIO_DISP_INC_DIR := $(UMAC_GPIO_DIR)/dispatcher/inc
@@ -1011,6 +1074,9 @@ UMAC_GPIO_OBJS := $(UMAC_GPIO_DISP_DIR)/wlan_gpio_tgt_api.o \
 		$(WLAN_COMMON_ROOT)/os_if/linux/gpio/src/wlan_cfg80211_gpio.o \
 		$(WLAN_COMMON_ROOT)/target_if/gpio/target_if_gpio.o
 endif
+
+$(call add-wlan-objs,umac_gpio,$(UMAC_GPIO_OBJS))
+
 ############# UMAC_GREEN_AP ############
 UMAC_GREEN_AP_DIR := umac/green_ap
 UMAC_GREEN_AP_DISP_INC_DIR := $(UMAC_GREEN_AP_DIR)/dispatcher/inc
@@ -1027,6 +1093,8 @@ UMAC_GREEN_AP_OBJS := $(UMAC_GREEN_AP_CORE_DIR)/wlan_green_ap_main.o \
                 $(WLAN_COMMON_ROOT)/target_if/green_ap/src/target_if_green_ap.o
 endif
 
+$(call add-wlan-objs,umac_green_ap,$(UMAC_GREEN_AP_OBJS))
+
 ############# WLAN_CONV_CRYPTO_SUPPORTED ############
 UMAC_CRYPTO_DIR := umac/cmn_services/crypto
 UMAC_CRYPTO_CORE_DIR := $(WLAN_COMMON_ROOT)/$(UMAC_CRYPTO_DIR)/src
@@ -1040,6 +1108,8 @@ UMAC_CRYPTO_OBJS := $(UMAC_CRYPTO_CORE_DIR)/wlan_crypto_global_api.o \
 		$(UMAC_CRYPTO_CORE_DIR)/wlan_crypto_param_handling.o
 endif
 
+$(call add-wlan-objs,umac_crypto,$(UMAC_CRYPTO_OBJS))
+
 ############# FTM CORE ############
 FTM_CORE_DIR := ftm
 TARGET_IF_FTM_DIR := target_if/ftm
@@ -1076,11 +1146,15 @@ endif
 
 endif
 
+$(call add-wlan-objs,ftm,$(FTM_OBJS))
+
 ############# UMAC_CMN_SERVICES ############
 UMAC_COMMON_INC := -I$(WLAN_COMMON_INC)/umac/cmn_services/cmn_defs/inc \
 		-I$(WLAN_COMMON_INC)/umac/cmn_services/utils/inc
 UMAC_COMMON_OBJS := $(WLAN_COMMON_ROOT)/umac/cmn_services/utils/src/wlan_utility.o
 
+$(call add-wlan-objs,umac_common,$(UMAC_COMMON_OBJS))
+
 ############ CDS (Connectivity driver services) ############
 CDS_DIR :=	core/cds
 CDS_INC_DIR :=	$(CDS_DIR)/inc
@@ -1096,6 +1170,7 @@ CDS_OBJS :=	$(CDS_SRC_DIR)/cds_api.o \
 		$(CDS_SRC_DIR)/cds_sched.o \
 		$(CDS_SRC_DIR)/cds_utils.o
 
+$(call add-wlan-objs,cds,$(CDS_OBJS))
 
 ###### UMAC OBJMGR ########
 UMAC_OBJMGR_DIR := $(WLAN_COMMON_ROOT)/umac/cmn_services/obj_mgr
@@ -1115,6 +1190,8 @@ ifeq ($(CONFIG_WLAN_OBJMGR_DEBUG), y)
 UMAC_OBJMGR_OBJS += $(UMAC_OBJMGR_DIR)/src/wlan_objmgr_debug.o
 endif
 
+$(call add-wlan-objs,umac_objmgr,$(UMAC_OBJMGR_OBJS))
+
 ###########  UMAC MGMT TXRX ##########
 UMAC_MGMT_TXRX_DIR := $(WLAN_COMMON_ROOT)/umac/cmn_services/mgmt_txrx
 
@@ -1124,6 +1201,8 @@ UMAC_MGMT_TXRX_OBJS := $(UMAC_MGMT_TXRX_DIR)/core/src/wlan_mgmt_txrx_main.o \
 	$(UMAC_MGMT_TXRX_DIR)/dispatcher/src/wlan_mgmt_txrx_utils_api.o \
 	$(UMAC_MGMT_TXRX_DIR)/dispatcher/src/wlan_mgmt_txrx_tgt_api.o
 
+$(call add-wlan-objs,umac_mgmt_txrx,$(UMAC_MGMT_TXRX_OBJS))
+
 ###### UMAC INTERFACE_MGR ########
 UMAC_INTERFACE_MGR_COMP_DIR :=	components/cmn_services/interface_mgr
 UMAC_INTERFACE_MGR_CMN_DIR := $(WLAN_COMMON_ROOT)/umac/cmn_services/interface_mgr
@@ -1137,6 +1216,8 @@ UMAC_INTERFACE_MGR_OBJS := $(UMAC_INTERFACE_MGR_CMN_DIR)/src/wlan_if_mgr_main.o
 			  $(UMAC_INTERFACE_MGR_COMP_DIR)/src/wlan_if_mgr_sap.o \
 			  $(UMAC_INTERFACE_MGR_COMP_DIR)/src/wlan_if_mgr_roam.o
 
+$(call add-wlan-objs,umac_ifmgr,$(UMAC_INTERFACE_MGR_OBJS))
+
 ########## POWER MANAGEMENT OFFLOADS (PMO) ##########
 PMO_DIR :=	components/pmo
 PMO_INC :=	-I$(WLAN_ROOT)/$(PMO_DIR)/core/inc \
@@ -1177,6 +1258,8 @@ PMO_OBJS +=     $(PMO_DIR)/core/src/wlan_pmo_ns.o \
 		$(PMO_DIR)/dispatcher/src/wlan_pmo_tgt_ns.o
 endif
 
+$(call add-wlan-objs,pmo,$(PMO_OBJS))
+
 ########## DISA (ENCRYPTION TEST) ##########
 
 DISA_DIR :=	components/disa
@@ -1190,6 +1273,8 @@ DISA_OBJS :=	$(DISA_DIR)/core/src/wlan_disa_main.o \
 		$(DISA_DIR)/dispatcher/src/wlan_disa_ucfg_api.o
 endif
 
+$(call add-wlan-objs,disa,$(DISA_OBJS))
+
 ######## OCB ##############
 OCB_DIR := components/ocb
 OCB_INC := -I$(WLAN_ROOT)/$(OCB_DIR)/core/inc \
@@ -1201,6 +1286,8 @@ OCB_OBJS :=	$(OCB_DIR)/dispatcher/src/wlan_ocb_ucfg_api.o \
 		$(OCB_DIR)/core/src/wlan_ocb_main.o
 endif
 
+$(call add-wlan-objs,ocb,$(OCB_OBJS))
+
 ######## IPA ##############
 IPA_DIR := components/ipa
 IPA_INC := -I$(WLAN_ROOT)/$(IPA_DIR)/core/inc \
@@ -1216,6 +1303,8 @@ IPA_OBJS :=	$(IPA_DIR)/dispatcher/src/wlan_ipa_ucfg_api.o \
 		$(IPA_DIR)/core/src/wlan_ipa_rm.o
 endif
 
+$(call add-wlan-objs,ipa,$(IPA_OBJS))
+
 ######## FWOL ##########
 FWOL_CORE_INC := components/fw_offload/core/inc
 FWOL_CORE_SRC := components/fw_offload/core/src
@@ -1240,6 +1329,8 @@ FWOL_OBJS :=	$(FWOL_CORE_SRC)/wlan_fw_offload_main.o \
 		$(FWOL_OS_IF_SRC)/os_if_fwol.o
 endif
 
+$(call add-wlan-objs,fwol,$(FWOL_OBJS))
+
 ######## SM FRAMEWORK  ##############
 UMAC_SM_DIR := umac/cmn_services/sm_engine
 UMAC_SM_INC := -I$(WLAN_COMMON_INC)/$(UMAC_SM_DIR)/inc
@@ -1250,6 +1341,8 @@ ifeq ($(CONFIG_SM_ENG_HIST), y)
 UMAC_SM_OBJS +=	$(WLAN_COMMON_ROOT)/$(UMAC_SM_DIR)/src/wlan_sm_engine_dbg.o
 endif
 
+$(call add-wlan-objs,umac_sm,$(UMAC_SM_OBJS))
+
 ######## COMMON MLME ##############
 UMAC_MLME_INC := -I$(WLAN_COMMON_INC)/umac/mlme \
 		-I$(WLAN_COMMON_INC)/umac/mlme/mlme_objmgr/dispatcher/inc \
@@ -1295,6 +1388,8 @@ UMAC_MLME_OBJS += $(WLAN_COMMON_ROOT)/umac/mlme/connection_mgr/core/src/wlan_cm_
 endif
 endif
 
+$(call add-wlan-objs,umac_mlme,$(UMAC_MLME_OBJS))
+
 ######## MLME ##############
 MLME_DIR := components/mlme
 MLME_INC := -I$(WLAN_ROOT)/$(MLME_DIR)/core/inc \
@@ -1340,6 +1435,8 @@ MLME_INC += $(WFA_INC)
 MLME_OBJS += $(WFA_TGT_IF_DIR)/src/target_if_wfa_testcmd.o \
 		$(WFA_DIR)/dispatcher/src/wlan_wfa_tgt_if_tx_api.o
 
+$(call add-wlan-objs,mlme,$(MLME_OBJS))
+
 ####### BLACKLIST_MGR ########
 
 BLM_DIR := components/blacklist_mgr
@@ -1351,6 +1448,9 @@ BLM_OBJS :=    $(BLM_DIR)/core/src/wlan_blm_main.o \
                 $(BLM_DIR)/dispatcher/src/wlan_blm_ucfg_api.o \
                 $(BLM_DIR)/dispatcher/src/wlan_blm_tgt_api.o
 endif
+
+$(call add-wlan-objs,blm,$(BLM_OBJS))
+
 ########## ACTION OUI ##########
 
 ACTION_OUI_DIR := components/action_oui
@@ -1364,6 +1464,8 @@ ACTION_OUI_OBJS := $(ACTION_OUI_DIR)/core/src/wlan_action_oui_main.o \
 		$(ACTION_OUI_DIR)/dispatcher/src/wlan_action_oui_ucfg_api.o
 endif
 
+$(call add-wlan-objs,action_oui,$(ACTION_OUI_OBJS))
+
 ######## PACKET CAPTURE ########
 
 PKT_CAPTURE_DIR := components/pkt_capture
@@ -1382,6 +1484,8 @@ PKT_CAPTURE_OBJS := $(PKT_CAPTURE_DIR)/core/src/wlan_pkt_capture_main.o \
 		$(PKT_CAPTURE_TARGET_IF_DIR)/src/target_if_pkt_capture.o
 endif
 
+$(call add-wlan-objs,pkt_capture,$(PKT_CAPTURE_OBJS))
+
 ########## FTM TIME SYNC ##########
 
 FTM_TIME_SYNC_DIR := components/ftm_time_sync
@@ -1394,6 +1498,8 @@ FTM_TIME_SYNC_OBJS := $(FTM_TIME_SYNC_DIR)/core/src/ftm_time_sync_main.o \
 		$(FTM_TIME_SYNC_DIR)/dispatcher/src/wlan_ftm_time_sync_tgt_api.o
 endif
 
+$(call add-wlan-objs,ftm_time_sync,$(FTM_TIME_SYNC_OBJS))
+
 ########## CLD TARGET_IF #######
 CLD_TARGET_IF_DIR := components/target_if
 
@@ -1448,6 +1554,8 @@ CLD_TARGET_IF_INC += -I$(WLAN_ROOT)/$(CLD_TARGET_IF_DIR)/ftm_time_sync/inc
 CLD_TARGET_IF_OBJ += $(CLD_TARGET_IF_DIR)/ftm_time_sync/src/target_if_ftm_time_sync.o
 endif
 
+$(call add-wlan-objs,cld_target_if,$(CLD_TARGET_IF_OBJ))
+
 ############## UMAC P2P ###########
 P2P_DIR := components/p2p
 P2P_CORE_OBJ_DIR := $(P2P_DIR)/core/src
@@ -1471,6 +1579,8 @@ P2P_OBJS := $(P2P_DISPATCHER_OBJ_DIR)/wlan_p2p_ucfg_api.o \
 	    $(P2P_OS_IF_SRC)/wlan_cfg80211_p2p.o \
 	    $(P2P_TARGET_IF_SRC)/target_if_p2p.o
 
+$(call add-wlan-objs,p2p,$(P2P_OBJS))
+
 ###### UMAC POLICY MGR ########
 POLICY_MGR_DIR := components/cmn_services/policy_mgr
 
@@ -1484,6 +1594,8 @@ POLICY_MGR_OBJS := $(POLICY_MGR_DIR)/src/wlan_policy_mgr_action.o \
 	$(POLICY_MGR_DIR)/src/wlan_policy_mgr_ucfg.o \
 	$(POLICY_MGR_DIR)/src/wlan_policy_mgr_pcl.o \
 
+$(call add-wlan-objs,policy_mgr,$(POLICY_MGR_OBJS))
+
 ###### UMAC TDLS ########
 TDLS_DIR := components/tdls
 
@@ -1510,6 +1622,8 @@ TDLS_OBJS := $(TDLS_DIR)/core/src/wlan_tdls_main.o \
        $(TDLS_TARGET_IF_SRC)/target_if_tdls.o
 endif
 
+$(call add-wlan-objs,tdls,$(TDLS_OBJS))
+
 ########### BMI ###########
 BMI_DIR := core/bmi
 
@@ -1522,6 +1636,8 @@ BMI_OBJS := $(BMI_DIR)/src/bmi.o \
             $(BMI_DIR)/src/ol_fw_common.o
 endif
 
+$(call add-wlan-objs,bmi,$(BMI_OBJS))
+
 ##########  TARGET_IF #######
 TARGET_IF_DIR := $(WLAN_COMMON_ROOT)/target_if
 
@@ -1554,6 +1670,8 @@ ifeq ($(CONFIG_CRYPTO_COMPONENT), y)
 TARGET_IF_OBJ += $(TARGET_IF_DIR)/crypto/src/target_if_crypto.o
 endif
 
+$(call add-wlan-objs,target_if,$(TARGET_IF_OBJ))
+
 ########### GLOBAL_LMAC_IF ##########
 GLOBAL_LMAC_IF_DIR := $(WLAN_COMMON_ROOT)/global_lmac_if
 
@@ -1562,6 +1680,8 @@ GLOBAL_LMAC_IF_INC := -I$(WLAN_COMMON_INC)/global_lmac_if/inc \
 
 GLOBAL_LMAC_IF_OBJ := $(GLOBAL_LMAC_IF_DIR)/src/wlan_global_lmac_if.o
 
+$(call add-wlan-objs,global_lmac_if,$(GLOBAL_LMAC_IF_OBJ))
+
 ########### WMI ###########
 WMI_ROOT_DIR := wmi
 
@@ -1676,6 +1796,8 @@ WMI_OBJS += $(WMI_OBJ_DIR)/wmi_unified_gpio_api.o
 WMI_OBJS += $(WMI_OBJ_DIR)/wmi_unified_gpio_tlv.o
 endif
 
+$(call add-wlan-objs,wmi,$(WMI_OBJS))
+
 ########### FWLOG ###########
 FWLOG_DIR := $(WLAN_COMMON_ROOT)/utils/fwlog
 
@@ -1685,6 +1807,8 @@ ifeq ($(CONFIG_FEATURE_FW_LOG_PARSING), y)
 FWLOG_OBJS := $(FWLOG_DIR)/dbglog_host.o
 endif
 
+$(call add-wlan-objs,fwlog,$(FWLOG_OBJS))
+
 ############ TXRX ############
 TXRX_DIR :=     core/dp/txrx
 TXRX_INC :=     -I$(WLAN_ROOT)/$(TXRX_DIR)
@@ -1746,6 +1870,8 @@ TXRX_OBJS +=     $(TXRX_DIR)/ol_tx_throttle.o
 endif
 endif #LITHIUM
 
+$(call add-wlan-objs,txrx,$(TXRX_OBJS))
+
 ############ TXRX 3.0 ############
 TXRX3.0_DIR :=     core/dp/txrx3.0
 TXRX3.0_INC :=     -I$(WLAN_ROOT)/$(TXRX3.0_DIR)
@@ -1768,6 +1894,8 @@ endif
 
 endif #LITHIUM
 
+$(call add-wlan-objs,txrx30,$(TXRX3.0_OBJS))
+
 ifeq ($(CONFIG_LITHIUM), y)
 ############ DP 3.0 ############
 DP_INC := -I$(WLAN_COMMON_INC)/dp/inc \
@@ -1808,6 +1936,8 @@ endif
 
 endif #LITHIUM
 
+$(call add-wlan-objs,dp,$(DP_OBJS))
+
 ############ CFG ############
 WCFG_DIR := wlan_cfg
 WCFG_INC := -I$(WLAN_COMMON_INC)/$(WCFG_DIR)
@@ -1817,6 +1947,8 @@ ifeq ($(CONFIG_LITHIUM), y)
 WCFG_OBJS := $(WCFG_SRC)/wlan_cfg.o
 endif
 
+$(call add-wlan-objs,wcfg,$(WCFG_OBJS))
+
 ############ OL ############
 OL_DIR :=     core/dp/ol
 OL_INC :=     -I$(WLAN_ROOT)/$(OL_DIR)/inc
@@ -1842,6 +1974,8 @@ else
 endif
 endif
 
+$(call add-wlan-objs,pktlog,$(PKTLOG_OBJS))
+
 ############ HTT ############
 HTT_DIR :=      core/dp/htt
 HTT_INC :=      -I$(WLAN_ROOT)/$(HTT_DIR)
@@ -1867,6 +2001,8 @@ HTT_OBJS += $(HTT_DIR)/htt_rx_hl.o
 endif
 endif
 
+$(call add-wlan-objs,htt,$(HTT_OBJS))
+
 ############## INIT-DEINIT ###########
 INIT_DEINIT_DIR := init_deinit/dispatcher
 INIT_DEINIT_INC_DIR := $(INIT_DEINIT_DIR)/inc
@@ -1875,6 +2011,8 @@ INIT_DEINIT_OBJ_DIR := $(WLAN_COMMON_ROOT)/$(INIT_DEINIT_SRC_DIR)
 INIT_DEINIT_INC := -I$(WLAN_COMMON_INC)/$(INIT_DEINIT_INC_DIR)
 INIT_DEINIT_OBJS := $(INIT_DEINIT_OBJ_DIR)/dispatcher_init_deinit.o
 
+$(call add-wlan-objs,init_deinit,$(INIT_DEINIT_OBJS))
+
 ############## REGULATORY ###########
 REGULATORY_DIR := umac/regulatory
 REGULATORY_CORE_INC_DIR := $(REGULATORY_DIR)/core/inc
@@ -1902,6 +2040,8 @@ ifeq ($(CONFIG_HOST_11D_SCAN), y)
 REGULATORY_OBJS += $(REG_CORE_OBJ_DIR)/reg_host_11d.o
 endif
 
+$(call add-wlan-objs,regulatory,$(REGULATORY_OBJS))
+
 ############## Control path common scheduler ##########
 SCHEDULER_DIR := scheduler
 SCHEDULER_INC_DIR := $(SCHEDULER_DIR)/inc
@@ -1911,6 +2051,8 @@ SCHEDULER_INC := -I$(WLAN_COMMON_INC)/$(SCHEDULER_INC_DIR)
 SCHEDULER_OBJS := $(SCHEDULER_OBJ_DIR)/scheduler_api.o \
                   $(SCHEDULER_OBJ_DIR)/scheduler_core.o
 
+$(call add-wlan-objs,scheduler,$(SCHEDULER_OBJS))
+
 ###### UMAC SERIALIZATION ########
 UMAC_SER_DIR := umac/cmn_services/serialization
 UMAC_SER_INC_DIR := $(UMAC_SER_DIR)/inc
@@ -1928,6 +2070,8 @@ UMAC_SER_OBJS := $(UMAC_SER_OBJ_DIR)/wlan_serialization_main.o \
 		 $(UMAC_SER_OBJ_DIR)/wlan_serialization_queue.o \
 		 $(UMAC_SER_OBJ_DIR)/wlan_serialization_scan.o
 
+$(call add-wlan-objs,umac_ser,$(UMAC_SER_OBJS))
+
 ###### WIFI POS ########
 WIFI_POS_OS_IF_DIR := $(WLAN_COMMON_ROOT)/os_if/linux/wifi_pos/src
 WIFI_POS_OS_IF_INC := -I$(WLAN_COMMON_INC)/os_if/linux/wifi_pos/inc
@@ -1946,6 +2090,8 @@ WIFI_POS_OBJS := $(WIFI_POS_CORE_DIR)/wifi_pos_api.o \
 		 $(WIFI_POS_TGT_DIR)/target_if_wifi_pos.o
 endif
 
+$(call add-wlan-objs,wifi_pos,$(WIFI_POS_OBJS))
+
 ###### CP STATS ########
 CP_MC_STATS_OS_IF_SRC           := os_if/cp_stats/src
 CP_STATS_TGT_SRC                := $(WLAN_COMMON_ROOT)/target_if/cp_stats/src
@@ -1973,6 +2119,8 @@ CP_STATS_OBJS := $(CP_MC_STATS_COMPONENT_SRC)/wlan_cp_stats_mc_tgt_api.o	\
 
 endif
 
+$(call add-wlan-objs,cp_stats,$(CP_STATS_OBJS))
+
 ###### DCS ######
 DCS_TGT_IF_SRC := $(WLAN_COMMON_ROOT)/target_if/dcs/src
 DCS_CORE_SRC   := $(WLAN_COMMON_ROOT)/umac/dcs/core/src
@@ -1989,6 +2137,8 @@ DCS_OBJS := $(DCS_TGT_IF_SRC)/target_if_dcs.o \
 	$(DCS_DISP_SRC)/wlan_dcs_tgt_api.o
 endif
 
+$(call add-wlan-objs,dcs,$(DCS_OBJS))
+
 ###### INTEROP ISSUES AP ########
 INTEROP_ISSUES_AP_OS_IF_SRC      := os_if/interop_issues_ap/src
 INTEROP_ISSUES_AP_TGT_SRC        := components/target_if/interop_issues_ap/src
@@ -2008,6 +2158,8 @@ INTEROP_ISSUES_AP_OBJS := $(INTEROP_ISSUES_AP_TGT_SRC)/target_if_interop_issues_
 		$(INTEROP_ISSUES_AP_DISPATCHER_SRC)/wlan_interop_issues_ap_ucfg_api.o
 endif
 
+$(call add-wlan-objs,interop_issues_ap,$(INTEROP_ISSUES_AP_OBJS))
+
 ######################### NAN #########################
 NAN_CORE_DIR := components/nan/core/src
 NAN_CORE_INC := -I$(WLAN_ROOT)/components/nan/core/inc
@@ -2027,6 +2179,9 @@ WLAN_NAN_OBJS := $(NAN_CORE_DIR)/nan_main.o \
 		 $(NAN_TGT_DIR)/target_if_nan.o \
 		 $(NAN_OS_IF_DIR)/os_if_nan.o
 endif
+
+$(call add-wlan-objs,nan,$(WLAN_NAN_OBJS))
+
 #######################################################
 
 ###### COEX ########
@@ -2049,6 +2204,8 @@ COEX_OBJS := $(COEX_TGT_SRC)/target_if_coex.o                 \
 		 $(COEX_DISPATCHER_SRC)/wlan_coex_ucfg_api.o
 endif
 
+$(call add-wlan-objs,coex,$(COEX_OBJS))
+
 ############## HTC ##########
 HTC_DIR := htc
 HTC_INC := -I$(WLAN_COMMON_INC)/$(HTC_DIR)
@@ -2066,6 +2223,8 @@ ifeq ($(CONFIG_WLAN_HANG_EVENT), y)
 HTC_OBJS += $(WLAN_COMMON_ROOT)/$(HTC_DIR)/htc_hang_event.o
 endif
 
+$(call add-wlan-objs,htc,$(HTC_OBJS))
+
 ########### HIF ###########
 HIF_DIR := hif
 HIF_CE_DIR := $(HIF_DIR)/src/ce
@@ -2233,6 +2392,8 @@ HIF_OBJS += $(HIF_USB_OBJS)
 HIF_OBJS += $(WLAN_COMMON_ROOT)/$(HIF_DISPATCHER_DIR)/multibus_usb.o
 endif
 
+$(call add-wlan-objs,hif,$(HIF_OBJS))
+
 ifeq ($(CONFIG_LITHIUM), y)
 ############ HAL ############
 HAL_DIR :=	hal
@@ -2264,6 +2425,8 @@ endif
 
 endif #####CONFIG_LITHIUM####
 
+$(call add-wlan-objs,hal,$(HAL_OBJS))
+
 ############ WMA ############
 WMA_DIR :=	core/wma
 
@@ -2310,6 +2473,8 @@ ifeq ($(CONFIG_WLAN_MWS_INFO_DEBUGFS), y)
 WMA_OBJS +=	$(WMA_SRC_DIR)/wma_coex.o
 endif
 
+$(call add-wlan-objs,wma,$(WMA_OBJS))
+
 #######DIRECT_BUFFER_RX#########
 ifeq ($(CONFIG_DIRECT_BUF_RX_ENABLE), y)
 DBR_DIR = $(WLAN_COMMON_ROOT)/target_if/direct_buf_rx
@@ -2320,6 +2485,8 @@ UMAC_DBR_OBJS := $(DBR_DIR)/src/target_if_direct_buf_rx_api.o \
 		 $(WLAN_COMMON_ROOT)/wmi/src/wmi_unified_dbr_tlv.o
 endif
 
+$(call add-wlan-objs,umac_dbr,$(UMAC_DBR_OBJS))
+
 ############## PLD ##########
 PLD_DIR := core/pld
 PLD_INC_DIR := $(PLD_DIR)/inc
@@ -2353,6 +2520,9 @@ ifeq ($(CONFIG_HIF_USB), y)
 PLD_OBJS +=	$(PLD_SRC_DIR)/pld_usb.o
 endif
 
+$(call add-wlan-objs,pld,$(PLD_OBJS))
+
+
 TARGET_INC := 	-I$(WLAN_FW_API)/fw
 
 ifeq ($(CONFIG_CNSS_QCA6290), y)
@@ -2501,84 +2671,6 @@ INCS +=		$(COEX_TGT_INC)
 INCS +=		$(COEX_DISPATCHER_INC)
 INCS +=		$(COEX_CORE_INC)
 
-OBJS :=		$(HDD_OBJS) \
-		$(SYNC_OBJS) \
-		$(DSC_OBJS) \
-		$(MAC_OBJS) \
-		$(SAP_OBJS) \
-		$(SME_OBJS) \
-		$(SYS_OBJS) \
-		$(CLD_WMI_OBJS) \
-		$(QDF_OBJS) \
-		$(WBUFF_OBJS) \
-		$(CDS_OBJS) \
-		$(CFG_OBJS) \
-		$(FTM_OBJS)
-
-OBJS +=		$(WMA_OBJS) \
-		$(TXRX_OBJS) \
-		$(WMI_OBJS) \
-		$(HTC_OBJS) \
-		$(INIT_DEINIT_OBJS) \
-		$(SCHEDULER_OBJS) \
-		$(REGULATORY_OBJS)
-
-OBJS +=		$(HIF_OBJS) \
-		$(BMI_OBJS) \
-		$(OS_IF_OBJ) \
-		$(TARGET_IF_OBJ) \
-		$(CLD_TARGET_IF_OBJ) \
-		$(GLOBAL_LMAC_IF_OBJ)
-
-OBJS += 	$(HTT_OBJS)
-OBJS += 	$(HAL_OBJS)
-OBJS +=		$(FWLOG_OBJS)
-OBJS += 	$(EPPING_OBJS)
-OBJS +=		$(DFS_OBJS)
-OBJS +=		$(UMAC_OBJMGR_OBJS)
-OBJS +=		$(WIFI_POS_OBJS)
-OBJS +=		$(CP_STATS_OBJS)
-OBJS +=		$(DCS_OBJS)
-OBJS +=		$(INTEROP_ISSUES_AP_OBJS)
-OBJS +=		$(WLAN_NAN_OBJS)
-OBJS +=		$(UMAC_MGMT_TXRX_OBJS)
-OBJS +=		$(TDLS_OBJS)
-OBJS +=		$(PMO_OBJS)
-OBJS +=		$(P2P_OBJS)
-OBJS +=		$(POLICY_MGR_OBJS)
-OBJS +=		$(WLAN_LOGGING_OBJS)
-OBJS +=		$(NLINK_OBJS)
-OBJS +=		$(PTT_OBJS)
-OBJS +=		$(UMAC_SER_OBJS)
-OBJS +=		$(PLD_OBJS)
-OBJS +=		$(UMAC_SM_OBJS)
-OBJS +=		$(UMAC_MLME_OBJS)
-OBJS +=		$(MLME_OBJS)
-OBJS +=		$(FWOL_OBJS)
-OBJS +=		$(BLM_OBJS)
-OBJS +=		$(COEX_OBJS)
-OBJS +=		$(OCB_OBJS)
-OBJS +=		$(IPA_OBJS)
-OBJS +=		$(PKTLOG_OBJS)
-OBJS +=		$(HOST_DIAG_LOG_OBJS)
-OBJS +=		$(DISA_OBJS)
-OBJS +=		$(ACTION_OUI_OBJS)
-OBJS +=		$(PKT_CAPTURE_OBJS)
-OBJS +=		$(FTM_TIME_SYNC_OBJS)
-OBJS +=		$(UMAC_DISP_OBJS)
-OBJS +=		$(UMAC_SCAN_OBJS)
-OBJS +=		$(UMAC_COMMON_OBJS)
-OBJS +=		$(WCFG_OBJS)
-OBJS +=		$(UMAC_SPECTRAL_OBJS)
-OBJS +=		$(UMAC_DBR_OBJS)
-OBJS +=		$(WLAN_CFR_OBJS)
-OBJS +=		$(UMAC_GPIO_OBJS)
-OBJS +=		$(UMAC_GREEN_AP_OBJS)
-OBJS +=		$(UMAC_CRYPTO_OBJS)
-OBJS +=		$(DP_OBJS)
-OBJS += 	$(UMAC_INTERFACE_MGR_OBJS)
-OBJS +=		$(TXRX3.0_OBJS)
-
 ccflags-y += $(INCS)
 
 cppflags-y +=	-DANI_OS_TYPE_ANDROID=6 \
@@ -3866,7 +3958,7 @@ wlan_resident-y := $(OBJS)
 else
 $(MODNAME)-y := $(OBJS)
 endif
-OBJS_DIRS := $(dir $(OBJS)) \
+OBJS_DIRS += $(dir $(OBJS)) \
 	     $(WLAN_COMMON_ROOT)/$(HIF_CE_DIR)/ \
 	     $(QDF_OBJ_DIR)/ \
 	     $(WLAN_COMMON_ROOT)/$(HIF_PCIE_DIR)/ \