Makefile: add module support

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-07-20 16:43:00 -04:00
commit 9fed595abc
7 changed files with 50 additions and 17 deletions

View file

@ -63,15 +63,19 @@ obj-y := $(KDIRS)
QEMUFLAGS := -m 16G
MODULE_CFLAGS := -DMODULE
export Q
export V
export obj-y
export obj-m
export CC
export LD
export QEMUFLAGS
export CFLAGS
export LDFLAGS
export INITRAMFS
export MODULE_CFLAGS
PHONY: default
default:
@ -94,6 +98,10 @@ $(KERNEL): $(KOBJ) linker.ld
$(Q)echo " LD $@"
$(Q)$(LD) $(KOBJ) $(LDFLAGS) -T linker.ld -o $@
.PHONY: modules
modules:
$(Q)$(MAKE) --no-print-directory -f scripts/Makefile.build _modules obj=.
.PHONY: clean
clean:
$(Q)$(MAKE) --no-print-directory -f scripts/Makefile.build _clean obj=.