From c2e90ebe64607cc87ebbf9aefff61abe6456d513 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Tue, 20 Apr 2021 00:31:58 +0200 Subject: [PATCH] Allow changing KERNEL_DIR (#8) Allow building in a different directory. This is useful on NixOS, where all software is stored under /nix. As a nice side-effect, this change also reduces code duplication a little. --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2fee566..d44f38a 100644 --- a/Makefile +++ b/Makefile @@ -4,12 +4,13 @@ # KERNELRELEASE ?= $(shell uname -r) +KERNEL_DIR ?= /lib/modules/$(KERNELRELEASE)/build obj-m = apfs.o apfs-y = btree.o dir.o extents.o file.o inode.o key.o message.o \ namei.o node.o object.o super.o symlink.o unicode.o xattr.o default: - make -C /lib/modules/$(KERNELRELEASE)/build M=$(shell pwd) + make -C $(KERNEL_DIR) M=$(shell pwd) clean: - make -C /lib/modules/$(KERNELRELEASE)/build M=$(shell pwd) clean + make -C $(KERNEL_DIR) M=$(shell pwd) clean