aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/Kbuild
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-07-15 01:34:37 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2016-07-18 03:41:57 +0200
commit3106d632de4235f8c6d63d602fe2fa9e0175d690 (patch)
treef166c00ca76b4ed076429a993b40bdd2b5cbca7e /src/Kbuild
parenttests: improve test suite and add qemu tester (diff)
downloadwireguard-monolithic-historical-3106d632de4235f8c6d63d602fe2fa9e0175d690.tar.xz
wireguard-monolithic-historical-3106d632de4235f8c6d63d602fe2fa9e0175d690.zip
build system: revamp building and configuration
Diffstat (limited to 'src/Kbuild')
-rw-r--r--src/Kbuild18
1 files changed, 18 insertions, 0 deletions
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