summaryrefslogtreecommitdiffstats
path: root/runtime/probes/Makefile.template
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/probes/Makefile.template')
-rw-r--r--runtime/probes/Makefile.template19
1 files changed, 19 insertions, 0 deletions
diff --git a/runtime/probes/Makefile.template b/runtime/probes/Makefile.template
new file mode 100644
index 00000000..ccdbbdee
--- /dev/null
+++ b/runtime/probes/Makefile.template
@@ -0,0 +1,19 @@
+# Makefile
+PWD := $(shell pwd)
+RT := $(PWD)/../..
+KVERSION := $(shell uname -r)
+KDIR := /lib/modules/$(KVERSION)/build include
+
+KALLSYMS_LOOKUP_NAME := 0x$(firstword $(shell grep " kallsyms_lookup_name" /boot/System.map-$(KVERSION)))
+KALLSYMS_LOOKUP := 0x$(firstword $(shell grep " kallsyms_lookup$$" /boot/System.map-$(KVERSION)))
+KTA := 0x$(firstword $(shell grep "__kernel_text_address" /boot/System.map-$(KVERSION)))
+
+EXTRA_CFLAGS := -I $(RT) -I $(RT)/relayfs -D KALLSYMS_LOOKUP_NAME=$(KALLSYMS_LOOKUP_NAME) -D KALLSYMS_LOOKUP=$(KALLSYMS_LOOKUP) -DKTA=$(KTA)
+
+obj-m := XXX.o
+
+default:
+ $(MAKE) V=1 -C $(KDIR) M=$(PWD) RT=$(RT) modules
+
+clean:
+ /bin/rm -rf *.o *.o.d *.ko *~ *.mod.c .*.cmd .tmp_versions