1
0
mirror of https://git.zx2c4.com/wireguard-tools synced 2024-11-10 16:59:19 +00:00
wireguard-tools/contrib/extract-handshakes/Makefile
Jason A. Donenfeld 1ad6b17c35 extract-{handshakes,keys}: rework for upstream kernel
Now that WireGuard has been upstreamed and the repos split, we have to
look elsewhere for these headers.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-02-01 00:53:30 +01:00

25 lines
525 B
Makefile

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
obj-m := offset-finder.o
endif