diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-02-28 00:17:43 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-03-04 18:50:25 +0100 |
commit | b6a5cc00018fcc42ee306cff7cd8bcdda01916a3 (patch) | |
tree | 453ebdb0a1aeb0c5b349eba88ba69d53ced0935c /contrib/examples/extract-handshakes/Makefile | |
parent | wg-quick: if resolvconf/run/iface exists, use it (diff) | |
download | wireguard-monolithic-historical-b6a5cc00018fcc42ee306cff7cd8bcdda01916a3.tar.xz wireguard-monolithic-historical-b6a5cc00018fcc42ee306cff7cd8bcdda01916a3.zip |
contrib: add extract-handshakes kprobe example
Diffstat (limited to '')
-rw-r--r-- | contrib/examples/extract-handshakes/Makefile | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/contrib/examples/extract-handshakes/Makefile b/contrib/examples/extract-handshakes/Makefile new file mode 100644 index 0000000..36e951e --- /dev/null +++ b/contrib/examples/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 |