Make build more flexible and complete. (#30)
Some checks failed
Build kernel module for TrueNAS / build-and-run (push) Has been cancelled

* Allow specifying kernel directory when building

* Add install target to Makefile
This commit is contained in:
Varun Madiath
2024-10-15 12:07:27 -04:00
committed by GitHub
parent 3ed3393681
commit c1386fc251

View File

@@ -4,8 +4,14 @@ ccflags-y := -std=gnu11
# if KERNELRELEASE isn't set, i.e. not being built w/ DMKS, then use uname -r # if KERNELRELEASE isn't set, i.e. not being built w/ DMKS, then use uname -r
KERNELRELEASE ?= $(shell uname -r) KERNELRELEASE ?= $(shell uname -r)
KDIR ?= /lib/modules/$(KERNELRELEASE)/build
INSTALL_MOD_PATH ?= /
all: all:
make -C /lib/modules/$(KERNELRELEASE)/build M=$(PWD) modules make -C $(KDIR) M=$(PWD) modules
clean: clean:
make -C /lib/modules/$(KERNELRELEASE)/build M=$(PWD) clean make -C $(KDIR) M=$(PWD) clean
install:
make -C $(KDIR) M=$(PWD) INSTALL_MOD_PATH=$(INSTALL_MOD_PATH) modules_install