From d606935df44de13c3debe461ca11ed2a72085484 Mon Sep 17 00:00:00 2001 From: cel Date: Sun, 29 Dec 2019 20:33:05 -0500 Subject: [PATCH] Add static linking option --- Makefile | 7 ++++++- README.md | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) 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