mirror of
https://github.com/dynup/kpatch
synced 2024-12-18 11:24:33 +00:00
03c41d05e3
A cosmetic fix. If KPATCH_BUILD ending with 'build/' is passed to 'make', KERNELRELEASE will become 'build' and the error message will look like: "<...> doesn't exist. Try installing the kernel-devel-build RPM or linux-headers-build DEB." Let us fix that. Signed-off-by: Evgenii Shatokhin <eshatokhin@virtuozzo.com>
25 lines
650 B
Makefile
25 lines
650 B
Makefile
# make rules
|
|
KPATCH_BUILD ?= /lib/modules/$(shell uname -r)/build
|
|
KERNELRELEASE := $(lastword $(subst /, , $(dir $(patsubst %/,%,$(KPATCH_BUILD)))))
|
|
THISDIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
|
|
|
|
ifeq ($(wildcard $(KPATCH_BUILD)),)
|
|
$(error $(KPATCH_BUILD) doesn\'t exist. Try installing the kernel-devel-$(KERNELRELEASE) RPM or linux-headers-$(KERNELRELEASE) DEB.)
|
|
endif
|
|
|
|
KPATCH_MAKE = $(MAKE) -C $(KPATCH_BUILD) M=$(THISDIR)
|
|
|
|
kpatch.ko: core.c
|
|
$(KPATCH_MAKE) kpatch.ko
|
|
|
|
all: kpatch.ko
|
|
|
|
clean:
|
|
$(RM) -Rf .*.o.cmd .*.ko.cmd .tmp_versions *.o *.ko *.mod.c \
|
|
Module.symvers
|
|
|
|
|
|
# kbuild rules
|
|
obj-m := kpatch.o
|
|
kpatch-y := core.o shadow.o
|