From e8a821c564a3615ac36840f8e20e3fb7704a906d Mon Sep 17 00:00:00 2001 From: Alex Turbov Date: Mon, 18 Jun 2018 03:46:21 +0300 Subject: [PATCH] Define `KERNEL_DIR` onece and use it. Having the `KERNEL_DIR` make it possible to "override" it via CLI (it'll help to build this module for Gentoo using "standard" `linux-mod.eclass`). Also, enclose `$(PWD)` into quotes because it may have spaces (being cloned into developer's machine). --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c43dcfd..e151d35 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ obj-m := system76.o -KVERSION := $(shell uname -r) +KERNEL_DIR = /lib/modules/$(shell uname -r)/build all: - $(MAKE) -C /lib/modules/$(KVERSION)/build M=$(PWD) modules + $(MAKE) -C "$(KERNEL_DIR)" M="$(PWD)" modules clean: - $(MAKE) -C /lib/modules/$(KVERSION)/build M=$(PWD) clean + $(MAKE) -C "$(KERNEL_DIR)" M="$(PWD)" clean