kpatch/kmod/core/Makefile
Seth Jennings 2419410a52 fix KPATCH_BUILD path
use the build symlink in /lib/modules for a more portable
path to the build env for the kernel.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-03-05 11:31:15 -06:00

24 lines
547 B
Makefile

# make rules
KPATCH_BUILD ?= /lib/modules/$(shell uname -r)/build
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)
kpatch.ko: core.c trampoline.S
$(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 trampoline.o