diff --git a/Makefile b/Makefile index a0767b2..3a26f42 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,4 @@ BIN = sbotc -LDLIBS = -lsodium PREFIX = /usr/local BINDIR = $(PREFIX)/bin @@ -7,6 +6,12 @@ MANDIR = $(PREFIX)/share/man CFLAGS = -Wall -Werror -Wextra +ifdef STATIC + LDLIBS = -l:libsodium.a +else + LDLIBS = -lsodium +endif + all: $(BIN) $(BIN): $(BIN).c base64.c jsmn.c diff --git a/README.md b/README.md index fc04a8e..387e396 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,10 @@ make sudo make install ``` +## Compile options + +To build a binary statically linked with libsodium, use `make STATIC=1` + ## Usage ```sh