diff --git a/repos/dde_linux/lib/import/import-lx_emul_common.inc b/repos/dde_linux/lib/import/import-lx_emul_common.inc index 78f2608f88..34994161eb 100644 --- a/repos/dde_linux/lib/import/import-lx_emul_common.inc +++ b/repos/dde_linux/lib/import/import-lx_emul_common.inc @@ -172,11 +172,15 @@ vpath %.S $(LX_GEN_DIR) CUSTOM_TARGET_DEPS += $(TARGET_SOURCE_LIST) -# Define helper to generate unique KBUILD_MODNAME from filename and the -# last path element as using the file name is not enough for certain -# drivers (e.g., rtlwifi) +# Define a helper to generate a proper (see contrib 'scripts/Makefile.lib') +# KBUILD_MODNAME from the file-name and also allow to set the modname. +# We need to provide this hook because normally the Linux build-system +# would evaluate the driver's Makefile to adapt the modname for multi-module +# drivers, e.g., rtlwifi, where KBUILD_MODNAME is used directly and has to +# be different (and we cannot use the file-name to derive the modname as the +# file-name is the same). define GEN_KBUILD_MODNAME = -$(lastword $(subst /, ,$(dir $(1))))-$(notdir $(1)) +$(if $(KBUILD_MODNAME_$(1)),$(KBUILD_MODNAME_$(1)),$(subst -,_,$(basename $(notdir $(1))))) endef # Define per-compilation-unit CC_OPT defines needed by MODULE* macros in Linux diff --git a/repos/pc/lib/mk/pc_wifi.inc b/repos/pc/lib/mk/pc_wifi.inc index 7040b5032b..338e4e0361 100644 --- a/repos/pc/lib/mk/pc_wifi.inc +++ b/repos/pc/lib/mk/pc_wifi.inc @@ -24,6 +24,9 @@ CC_C_OPT += -I$(LX_SRC_DIR)/drivers/net/wireless/ath/ CC_C_OPT += -I$(LX_SRC_DIR)/drivers/net/wireless/ath/ath9k CC_C_OPT += -I$(LX_SRC_DIR)/include/linux +KBUILD_MODNAME_drivers/net/wireless/realtek/rtlwifi/rtl8188ce/sw := rtl8188ce +KBUILD_MODNAME_drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw := rtl8188ee + vpath %.c $(REP_DIR)/src/lib/pc vpath %.cc $(REP_DIR)/src/lib/pc