How to compile single kernel module without "make world"

Hi,

I basically need to compile a single kernel module for axp209.

I have my toolchain and inside the folder package/kernel I have the folder "axp209-pek".

Run make menuconfig and selected the kernel module.

Now I need to compile the single package and not the entire image.

When I run make package/kernel/axp209-pek/compile -j1 V=s I get this error:

Entering directory '/home/vittorio/Desktop/backupopenwrt/vecchia'
make[1]: *** No rule to make target 'package/kernel/axp209-pek/compile'.  Stop.
make[1]: Leaving directory '/home/vittorio/Desktop/backupopenwrt/vecchia'
/home/vittorio/Desktop/backupopenwrt/vecchia/include/toplevel.mk:216: recipe for target 'package/kernel/axp209-pek/compile' failed

Makefile:

include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_NAME:=axp209-pek
PKG_VERSION:=0.1
PKG_RELEASE:=1

include $(INCLUDE_DIR)/package.mk

define KernelPackage/axp209-pek
  SECTION:=kernel
  CATEGORY:=Kernel modules
  SUBMENU:=Other modules
  TITLE:=AXP209-PEK Kernel Module
  FILES:=$(PKG_BUILD_DIR)/axp209-pek.ko
endef

include $(INCLUDE_DIR)/kernel-defaults.mk

define KernelPackage/axp209-pek/description
 TBD
endef

define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)
	cp src/Makefile src/axp209-pek.c $(PKG_BUILD_DIR)/
endef

#define Build/Compile
#	$(MAKE) $(KERNEL_MAKEOPTS) SUBDIRS="$(PKG_BUILD_DIR)" modules
#endef

define Build/Compile
	$(MAKE) -C "$(LINUX_DIR)" \
		$(KERNEL_MAKE_FLAGS) \
		M="$(PKG_BUILD_DIR)" \
		EXTRA_CFLAGS="$(BUILDFLAGS)" \
		modules
endef


$(eval $(call KernelPackage,axp209-pek))

Any formatting issue please let me know.

You need to build the full kernel first, which holds a rather high chance of affecting the kernel ABI and version magic, meaning the chances are relatively high that you need to build and upgrade the whole firmware. For subsequent builds of your kernel module, you may get away with building the module package alone (however, in those cases make world won't really take much linger either, so not that much to be gained either).
https://openwrt.org/docs/guide-developer/toolchain/use-patches-with-buildsystem
should have all the necessary information, there's not really any difference to building any other package - but, as mentioned, the dependencies of your package (as in, the kernel) needs to be built first.