2014-02-13 03:53:05 +00:00
|
|
|
KPATCH_NAME ?= patch
|
|
|
|
KPATCH_BUILD ?= /lib/modules/$(shell uname -r)/build
|
2014-01-28 17:23:24 +00:00
|
|
|
KPATCH_MAKE = $(MAKE) -C $(KPATCH_BUILD) M=$(PWD)
|
2014-02-11 16:25:48 +00:00
|
|
|
|
2014-02-13 03:53:05 +00:00
|
|
|
obj-m += kpatch-$(KPATCH_NAME).o
|
2014-02-11 16:25:48 +00:00
|
|
|
|
2015-01-22 00:28:31 +00:00
|
|
|
kpatch-$(KPATCH_NAME)-objs += patch-hook.o kpatch.lds output.o
|
2014-02-11 16:25:48 +00:00
|
|
|
|
2014-02-13 03:53:05 +00:00
|
|
|
all: kpatch-$(KPATCH_NAME).ko
|
2014-02-11 16:25:48 +00:00
|
|
|
|
2014-02-13 03:53:05 +00:00
|
|
|
kpatch-$(KPATCH_NAME).ko:
|
|
|
|
$(KPATCH_MAKE) kpatch-$(KPATCH_NAME).ko
|
2014-02-11 16:25:48 +00:00
|
|
|
|
2015-01-22 17:05:52 +00:00
|
|
|
patch-hook.o: patch-hook.c kpatch-patch-hook.c livepatch-patch-hook.c
|
2015-01-22 00:28:31 +00:00
|
|
|
$(KPATCH_MAKE) patch-hook.o
|
2014-02-11 16:25:48 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) -Rf .*.o.cmd .*.ko.cmd .tmp_versions *.o *.ko *.mod.c \
|
|
|
|
Module.symvers
|