From d4421aea8907f15bd1b504c0377624bda752381a Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 28 Feb 2018 00:17:43 +0100 Subject: contrib: add extract-handshakes kprobe example Signed-off-by: Jason A. Donenfeld --- contrib/extract-handshakes/Makefile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 contrib/extract-handshakes/Makefile (limited to 'contrib/extract-handshakes/Makefile') diff --git a/contrib/extract-handshakes/Makefile b/contrib/extract-handshakes/Makefile new file mode 100644 index 0000000..36e951e --- /dev/null +++ b/contrib/extract-handshakes/Makefile @@ -0,0 +1,28 @@ +ifeq ($(KERNELRELEASE),) +KERNELDIR ?= /lib/modules/$(shell uname -r)/build +PWD := $(shell pwd) +CFLAGS ?= -O3 -march=native +CFLAGS += -Wall -pedantic -std=gnu11 + +offsets.include: offset-finder + ./$^ > $@ + +offset-finder: offset-finder.c offset-finder.o + $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^ + +offset-finder.o: offset-finder.c + $(MAKE) -C $(KERNELDIR) M=$(PWD) $@ + objcopy -j '.rodata*' $@ $@ + +clean: + rm -f offset-finder offsets.include + $(MAKE) -C $(KERNELDIR) M=$(PWD) clean + +.PHONY: clean +else +offset-finder-m := offset-finder.o +oldsrc := $(src) +src := $(src)/../../../src +include $(src)/compat/Kbuild.include +src := $(oldsrc) +endif -- cgit v1.2.3-59-g8ed1b