summaryrefslogtreecommitdiffstats
path: root/ffi/examples
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2018-09-08 11:50:11 +0200
committerNeal H. Walfield <neal@pep.foundation>2018-09-08 13:01:57 +0200
commit50e5ecba26948eefbbc058bc4a47205a429453cf (patch)
tree2d65b2a11e9b5f84366624d0eda14dc61aebcb6f /ffi/examples
parent7bac8e4fed5eccbdc04f48ef5d946c5da2613ec4 (diff)
Change Makefiles to support CARGO_TARGET_DIR.
- Also use 'cargo clean' instead of 'rm -rf $(CARGO_TARGET_DIR)' in case $(CARGO_TARGET_DIR) is incorrectly set.
Diffstat (limited to 'ffi/examples')
-rw-r--r--ffi/examples/Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/ffi/examples/Makefile b/ffi/examples/Makefile
index 3b7b6794..5920b9d3 100644
--- a/ffi/examples/Makefile
+++ b/ffi/examples/Makefile
@@ -1,8 +1,13 @@
# Makefile for examples written in C.
+CARGO ?= cargo
+CARGO_TARGET_DIR ?= $(shell pwd)/../../target
+# We currently only support absolute paths.
+CARGO_TARGET_DIR := $(abspath $(CARGO_TARGET_DIR))
+
TARGETS = example keyserver configure reader parser encrypt-for
CFLAGS = -I../include -O0 -g -Wall
-LDFLAGS = -L../../target/debug -lsequoia_ffi
+LDFLAGS = -L$(CARGO_TARGET_DIR)/debug -lsequoia_ffi
all: $(TARGETS)