summaryrefslogtreecommitdiffstats
path: root/ffi/examples/Makefile
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-03-12 17:04:02 +0100
committerJustus Winter <justus@sequoia-pgp.org>2020-03-13 14:31:36 +0100
commit61a3b55d115f770ed2cc493f052efa68e15a87ae (patch)
tree449676a356d7e413b514c5a359ea34104b493344 /ffi/examples/Makefile
parentcc1250dc96c6459f4510357430405032d6dbf9a9 (diff)
ffi, openpgp-ffi: Properly use LDLIBS to link against Sequoia.
- Fixes linking tests and examples with ld --as-needed.
Diffstat (limited to 'ffi/examples/Makefile')
-rw-r--r--ffi/examples/Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/ffi/examples/Makefile b/ffi/examples/Makefile
index bce777b2..6186d6b9 100644
--- a/ffi/examples/Makefile
+++ b/ffi/examples/Makefile
@@ -10,7 +10,8 @@ EXAMPLE_TARGET_DIR ?= $(CARGO_TARGET_DIR)/debug/c-examples/ffi
EXAMPLES = keyserver configure
CFLAGS = -I../include -I../../openpgp-ffi/include -O0 -g -Wall -Werror
-LDFLAGS = -L$(CARGO_TARGET_DIR)/debug -lsequoia_ffi
+LDFLAGS = -L$(CARGO_TARGET_DIR)/debug
+LDLIBS = -lsequoia_ffi
# Prefix our target directory.
TARGETS := $(foreach example,$(EXAMPLES),$(EXAMPLE_TARGET_DIR)/$(example))
@@ -24,4 +25,4 @@ $(TARGETS): ../include/sequoia.h
$(EXAMPLE_TARGET_DIR)/%: %.c
mkdir -p $(EXAMPLE_TARGET_DIR)
- $(CC) $(CFLAGS) $(LDFLAGS) -o "$@" "$<"
+ $(CC) $(CFLAGS) $(LDFLAGS) -o "$@" "$<" $(LDLIBS)