1 TESTMODS_DIR := $(realpath $(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
2 KDIR ?= /lib/modules/$(shell uname -r)/build
4 obj-m += test_klp_atomic_replace.o \
5 test_klp_callbacks_busy.o \
6 test_klp_callbacks_demo.o \
7 test_klp_callbacks_demo2.o \
8 test_klp_callbacks_mod.o \
13 test_klp_shadow_vars.o \
16 # Ensure that KDIR exists, otherwise skip the compilation
18 ifneq ("$(wildcard $(KDIR))", "")
19 $(Q)$(MAKE) -C $(KDIR) modules KBUILD_EXTMOD=$(TESTMODS_DIR)
22 # Ensure that KDIR exists, otherwise skip the clean target
24 ifneq ("$(wildcard $(KDIR))", "")
25 $(Q)$(MAKE) -C $(KDIR) clean KBUILD_EXTMOD=$(TESTMODS_DIR)