diff --git a/Makefile b/Makefile index 037667f..28bfa2d 100644 --- a/Makefile +++ b/Makefile @@ -15,10 +15,21 @@ else EXTRA_FLAGS += -I$(PWD) -#KDIR := /usr/src/linux/ +# +# KDIR is a path to a directory containing kernel source. +# It can be specified on the command line passed to make to enable the module to +# be built and installed for a kernel other than the one currently running. +# By default it is the path to the symbolic link created when +# the current kernel's modules were installed, but +# any valid path to the directory in which the target kernel's source is located +# can be provided on the command line. +# KDIR := /lib/modules/$(shell uname -r)/build MDIR := /lib/modules/$(shell uname -r) -PWD := $(shell pwd) +PWD := $(shell pwd) +KREL := $(shell cd ${KDIR} && make -s kernelrelease) +MDIR := /lib/modules/${KREL} +PWD := $(shell pwd) export CONFIG_EXFAT_FS := m