2014-02-13 03:53:05 +00:00
|
|
|
KPATCH_BUILD ?= /lib/modules/$(shell uname -r)/build
|
2014-01-28 17:23:24 +00:00
|
|
|
KPATCH_MAKE = $(MAKE) -C $(KPATCH_BUILD) M=$(PWD)
|
2017-01-23 20:43:43 +00:00
|
|
|
LDFLAGS += $(KPATCH_LDFLAGS)
|
2014-02-11 16:25:48 +00:00
|
|
|
|
2017-07-25 16:38:48 +00:00
|
|
|
# ppc64le kernel modules are expected to compile with the
|
|
|
|
# -mcmodel=large flag. This enables 64-bit relocations
|
|
|
|
# instead of a 32-bit offset from the TOC pointer.
|
2017-08-18 12:48:43 +00:00
|
|
|
PROCESSOR = $(shell uname -m)
|
2017-07-26 05:46:53 +00:00
|
|
|
ifeq ($(PROCESSOR), ppc64le)
|
|
|
|
KBUILD_CFLAGS_MODULE += -mcmodel=large
|
|
|
|
endif
|
|
|
|
|
2017-09-20 20:30:00 +00:00
|
|
|
obj-m += $(KPATCH_NAME).o
|
2014-02-11 16:25:48 +00:00
|
|
|
|
2017-09-20 20:30:00 +00:00
|
|
|
$(KPATCH_NAME)-objs += patch-hook.o kpatch.lds output.o
|
2014-02-11 16:25:48 +00:00
|
|
|
|
2017-09-20 20:30:00 +00:00
|
|
|
all: $(KPATCH_NAME).ko
|
2014-02-11 16:25:48 +00:00
|
|
|
|
2017-09-20 20:30:00 +00:00
|
|
|
$(KPATCH_NAME).ko:
|
|
|
|
$(KPATCH_MAKE) $(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
|