how to compile kernel module with SDK #compilation



i am not good at English 

i have a problem with compiling  a kernel module 

a board is imx6sx evk and kernel is 5.10.35 , yocto is hardknott ( is right ? i installed with this command  : repo init -u
-b imx-linux-hardknott -m imx-5.10.35-2.0.0.xml )

i make SDK form core-image-full_cmdline image   and installed  and  compiled kernel and modules ( in kernel directroy) ,a test program  without problems

but when i compile a module which is not in kernel directory

no module.ko file made  

the module source is fine  ( i copy a source into kernel/driver and make modules ,,it works fine)

and i compiled previous yocto SDK  with success 

any tips and ideas will be appreciated . thank in advance 



imx6ull@imx6ull-VirtualBox:/media/sf_shared/example/gpio-irq/dev$ source /opt/
fsl-imx-wayland/ fsl-imx-xwayland/ VBoxGuestAdditions-5.2.32/
imx6ull@imx6ull-VirtualBox:/media/sf_shared/example/gpio-irq/dev$ source /opt/fsl-imx-
fsl-imx-wayland/ fsl-imx-xwayland/
imx6ull@imx6ull-VirtualBox:/media/sf_shared/example/gpio-irq/dev$ source /opt/fsl-imx-wayland/5.10-hardknott/
environment-setup-cortexa7t2hf-neon-poky-linux-gnueabi sysroots/
site-config-cortexa7t2hf-neon-poky-linux-gnueabi version-cortexa7t2hf-neon-poky-linux-gnueabi
imx6ull@imx6ull-VirtualBox:/media/sf_shared/example/gpio-irq/dev$ source /opt/fsl-imx-wayland/5.10-hardknott/environment-setup-cortexa7t2hf-neon-poky-linux-gnueabi
imx6ull@imx6ull-VirtualBox:/media/sf_shared/example/gpio-irq/dev$ make
make -C /home/imx6ull/work/Kernel/git.5.10.35 SUBDIRS=/media/sf_shared/example/gpio-irq/dev modules
make[1]: Entering directory '/home/imx6ull/work/imx-yocto-bsp/imx6ull/tmp/work-shared/imx6ull14x14evk/kernel-source'   --> i don't know why make goes into this directory which i made SDK
CALL scripts/
CALL scripts/atomic/
CHK include/generated/compile.h
make[1]: Leaving directory '/home/imx6ull/work/imx-yocto-bsp/imx6ull/tmp/work-shared/imx6ull14x14evk/kernel-source'
imx6ull@imx6ull-VirtualBox:/media/sf_shared/example/gpio-irq/dev$ ls *.ko
ls: cannot access '*.ko': No such file or directory

and my makefile 

obj-m := of-test.o

KDIR := /home/imx6ull/work/Kernel/git.5.10.35
PWD := $(shell pwd)
NFS_ROOT = /home/imx6ull/work/imx-yocto-bsp/imx6sx/nfs_full/home/root

$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
# cp of-test.ko $(NFS_ROOT)/

rm -rf *.ko
rm -rf *.mod.*
rm -rf .*.cmd
m -rf *.o