Support compiling the module against a different kernel version than the
currently running one by allowing to set either KVER or KDIR variables
on the make commandline.
Also modernize the makefile slightly and make use of the kernel's
'clean' target to ensure to remove all generated files.
Signed-off-by: Mathias Krause <minipli@grsecurity.net>
Building crash.ko broke in commit 74ac929712 ("Support for multiple
jobs to build crash"), as PWD won't be updated on recursive calls to
'make' and will still point to the upper directory.
This leads to the 'all' target trying to build modules in the top level
directory -- where there are none.
Fix that by updating PWD to the current directory.
Fixes: 74ac929712 ("Support for multiple jobs to build crash")
Reported-by: Lianbo Jiang <lijiang@redhat.com>
Signed-off-by: Mathias Krause <minipli@grsecurity.net>
With Linux 5.4 and later kernels that contain commit
7e35b42591c058b91282f95ce3b2cf0c05ffe93d ("kbuild: remove SUBDIRS
support"), "make" command in the memory_driver directory doesn't
build crash memory driver module as expected. Add "M=" to fix.
Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>