mirror of https://github.com/crash-utility/crash
memory_driver: Support overriding kernel directory
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>
This commit is contained in:
parent
1cfd513ea9
commit
578fc08b82
|
@ -8,9 +8,14 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
ifneq ($(KERNELRELEASE),)
|
||||
obj-m := crash.o
|
||||
else
|
||||
PWD := $(shell pwd)
|
||||
KVER ?= $(shell uname -r)
|
||||
KDIR ?= /lib/modules/${KVER}/build
|
||||
all:
|
||||
make -C /lib/modules/`uname -r`/build M=${PWD} SUBDIRS=${PWD} modules
|
||||
${MAKE} -C ${KDIR} M=${PWD} SUBDIRS=${PWD} modules
|
||||
clean:
|
||||
rm -f *.mod.c *.ko *.o Module.*
|
||||
test -e ${KDIR}/Makefile && ${MAKE} -C ${KDIR} M=${PWD} SUBDIRS=${PWD} clean || ${RM} *.mod.c *.ko *.o Module.*
|
||||
endif
|
||||
|
|
Loading…
Reference in New Issue