2014-02-13 16:04:35 +00:00
|
|
|
# make rules
|
2014-03-05 17:31:15 +00:00
|
|
|
KPATCH_BUILD ?= /lib/modules/$(shell uname -r)/build
|
2014-02-18 04:37:07 +00:00
|
|
|
THISDIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
|
|
|
|
|
|
|
|
ifeq ($(wildcard $(KPATCH_BUILD)),)
|
|
|
|
$(error $(KPATCH_BUILD) doesn\'t exist. Try installing the kernel-devel-$(shell uname -r) RPM.)
|
|
|
|
endif
|
|
|
|
|
|
|
|
KPATCH_MAKE = $(MAKE) -C $(KPATCH_BUILD) M=$(THISDIR)
|
2014-02-11 16:25:48 +00:00
|
|
|
|
2014-03-13 18:02:28 +00:00
|
|
|
kpatch.ko: core.c
|
2014-02-11 16:25:48 +00:00
|
|
|
$(KPATCH_MAKE) kpatch.ko
|
|
|
|
|
|
|
|
all: kpatch.ko
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) -Rf .*.o.cmd .*.ko.cmd .tmp_versions *.o *.ko *.mod.c \
|
|
|
|
Module.symvers
|
2014-02-13 16:04:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
# kbuild rules
|
2014-04-15 19:38:53 +00:00
|
|
|
ifdef CONFIG_HAVE_FENTRY
|
2014-02-13 16:04:35 +00:00
|
|
|
obj-m := kpatch.o
|
2014-03-13 18:02:28 +00:00
|
|
|
kpatch-y := core.o
|
2014-04-15 19:38:53 +00:00
|
|
|
endif
|