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-02-13 13:49:02 +00:00
|
|
|
kpatch.ko: core.c trampoline.S
|
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
|
|
|
|
obj-m := kpatch.o
|
|
|
|
kpatch-y := core.o trampoline.o
|