How to compile .C to .ko?

I encountered an error message when compiling:
ERROR: module '/home/jack/openwrt/build_dir/target-aarch64_cortex-a53+neon_musl/linux-msm89xx_msm8916/linux-5.15.131/drivers/soc/qcom/mdt_loader.ko' is missing.

I entered the directory and saw mdt_loader.c. How to configure and compile .c to .ko?

enable the module in kernel config ?

drivers/soc/qcom/Makefile
obj-$(CONFIG_QCOM_MDT_LOADER) += mdt_loader.o

drivers/soc/qcom/Kconfig
config QCOM_MDT_LOADER
tristate
select QCOM_SCM

try make kernel
.config - Linux/x86 5.15.131 Kernel Configuration

Search (qcom_scm) qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq Search Results qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x Symbol: QCOM_SCM [=n] x
x Type : tristate x
x Defined at drivers/firmware/Kconfig:206 x
x Selected by [n]: x
x - ARM_QCOM_SPM_CPUIDLE [=n] && CPU_IDLE [=y] && (ARM || ARM64) && (ARCH_QCOM || COMPILE_TEST [=n]) && !ARM6 x
x - SCSI_UFS_QCOM [=n] && SCSI_LOWLEVEL [=y] && SCSI [=y] && SCSI_UFSHCD_PLATFORM [=m] && ARCH_QCOM && SCSI_U x
x - QCOM_IPA [=n] && NETDEVICES [=y] && NET [=y] && QCOM_SMEM [=n] && (ARCH_QCOM || COMPILE_TEST [=n]) && INT x
x - ATH10K_SNOC [=n] && NETDEVICES [=y] && WLAN [=y] && WLAN_VENDOR_ATH [=y] && ATH10K [=m] && (ARCH_QCOM || x
x - PINCTRL_MSM [=n] && PINCTRL [=y] && (ARCH_QCOM || COMPILE_TEST [=n]) && GPIOLIB [=y] x
x - VIDEO_QCOM_VENUS [=n] && MEDIA_SUPPORT [=m] && MEDIA_PLATFORM_SUPPORT [=y] && V4L_MEM2MEM_DRIVERS [=y] && x
x - DRM_MSM [=n] && HAS_IOMEM [=y] && DRM [=m] && (ARCH_QCOM || SOC_IMX5 || ARM && COMPILE_TEST [=n]) && IOMM x
x - MMC_SDHCI_MSM [=n] && MMC [=y] && (ARCH_QCOM || COMPILE_TEST [=n]) && MMC_SDHCI_PLTFM [=m] && MMC_CRYPTO x
x - ARM_SMMU_QCOM [=n] && IOMMU_SUPPORT [=y] && ARM_SMMU [=n] && ARCH_QCOM x
x - QCOM_IOMMU [=n] && IOMMU_SUPPORT [=y] && (ARCH_QCOM || COMPILE_TEST [=n] && !GENERIC_ATOMIC64 [=n]) x
x - QCOM_Q6V5_MSS [=n] && REMOTEPROC [=y] && OF [=n] && ARCH_QCOM && QCOM_SMEM [=n] && (RPMSG_QCOM_SMD [=n] | x
x - QCOM_Q6V5_PAS [=n] && REMOTEPROC [=y] && OF [=n] && ARCH_QCOM && QCOM_SMEM [=n] && (RPMSG_QCOM_SMD [=n] | x
x - QCOM_Q6V5_WCSS [=n] && REMOTEPROC [=y] && OF [=n] && ARCH_QCOM && QCOM_SMEM [=n] && (RPMSG_QCOM_SMD [=n] x
x - QCOM_WCNSS_PIL [=n] && REMOTEPROC [=y] && OF [=n] && ARCH_QCOM && (RPMSG_QCOM_SMD [=n] || COMPILE_TEST [= x
x - QCOM_MDT_LOADER [=n] x
x - QCOM_OCMEM [=n] && ARCH_QCOM x
x - QCOM_RMTFS_MEM [=n] && ARCH_QCOM x
x - NVMEM_QCOM_SEC_QFPROM [=n] && NVMEM [=y] && (ARCH_QCOM || COMPILE_TEST [=n]) && HAS_IOMEM [=y] && OF [=n] x
x x
x x
x Symbol: QCOM_SCM_DOWNLOAD_MODE_DEFAULT [=n]
Symbol: QCOM_SCM_DOWNLOAD_MODE_DEFAULT [=n] x
x Type : bool x
x Defined at drivers/firmware/Kconfig:209 x
x Prompt: Qualcomm download mode enabled by default x
x Depends on: QCOM_SCM [=n] x
x Location: x
x -> Device Drivers x
x (1) -> Firmware Drivers

image
I think I found it.
In target/linux//Makefile, the kernel version is set.
And set in target/linux/
/config-version
CONFIG_QCOM_SCM=y

I copied a copy of config-5.10 from 21.02 which compiles
Now compiled

Of course there are many configuration items