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).
This commit is contained in:
Alex Turbov 2018-06-18 03:46:21 +03:00
parent 4dca19131b
commit e8a821c564
No known key found for this signature in database
GPG Key ID: A35472CF9D983B04
1 changed files with 3 additions and 3 deletions

View File

@ -1,8 +1,8 @@
obj-m := system76.o obj-m := system76.o
KVERSION := $(shell uname -r) KERNEL_DIR = /lib/modules/$(shell uname -r)/build
all: all:
$(MAKE) -C /lib/modules/$(KVERSION)/build M=$(PWD) modules $(MAKE) -C "$(KERNEL_DIR)" M="$(PWD)" modules
clean: clean:
$(MAKE) -C /lib/modules/$(KVERSION)/build M=$(PWD) clean $(MAKE) -C "$(KERNEL_DIR)" M="$(PWD)" clean