From 3106d632de4235f8c6d63d602fe2fa9e0175d690 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 15 Jul 2016 01:34:37 +0200 Subject: build system: revamp building and configuration --- src/Kbuild | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/Kbuild (limited to 'src/Kbuild') diff --git a/src/Kbuild b/src/Kbuild new file mode 100644 index 0000000..bde4036 --- /dev/null +++ b/src/Kbuild @@ -0,0 +1,18 @@ +ccflags-y := -O3 -fvisibility=hidden +ccflags-$(CONFIG_WIREGUARD_DEBUG) := -DDEBUG -g +ccflags-y += -Wframe-larger-than=8192 +wireguard-y := main.o noise.o device.o peer.o timers.o data.o send.o receive.o socket.o config.o hashtables.o routing-table.o ratelimiter.o cookie.o +wireguard-y += crypto/curve25519.o crypto/chacha20poly1305.o crypto/blake2s.o crypto/siphash24.o +ifeq ($(CONFIG_X86_64),y) + wireguard-y += crypto/chacha20-ssse3-x86_64.o crypto/poly1305-sse2-x86_64.o +avx2_supported := $(call as-instr,vpgatherdd %ymm0$(comma)(%eax$(comma)%ymm1$(comma)4)$(comma)%ymm2,yes,no) +ifeq ($(avx2_supported),yes) + wireguard-y += crypto/chacha20-avx2-x86_64.o crypto/poly1305-avx2-x86_64.o +endif +endif + +ifneq ($(KBUILD_EXTMOD),) +include $(M)/tests/moduledeps.mk +endif + +obj-$(CONFIG_WIREGUARD) := wireguard.o -- cgit v1.2.3-59-g8ed1b