Skip to content

Commit 596a645

Browse files
committed
Add a compatibility Makefile stub
Adds a tiny Makefile that defers to `cargo capi install`. Previously rustls-ffi offered a GNU `Makefile` for building the library on Linux/MacOS. Because of the inherent limitations of this build system and a desire to have uniformity across all supported operating systems we've replaced this with usage of `cargo-c`. While the README documents the finer details of using `cargo-c` it's likely some users just want to keep doing what they were doing before: running `make install` with a custom `DESTDIR`. This commit provides a shortcut to do just that, backed by `cargo-c`. I have explicitly not restored the ability to: * build/run the client/server tests: this is handled by `cmake` now. * handle developer tasks like formatting/linting. Also handled by `cmake` now. * customize the build (e.g. debug build, alt crypto providers, fips mode, etc). use cargo-c directly for this per the README instructions.
1 parent 75b9715 commit 596a645

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This Makefile exists exclusively as a convenience for users previously relying on the
2+
# rustls-ffi Makefile for Linux/MacOS builds.
3+
#
4+
# GNU make is **not** required to build librustls and in most circumstances you are better off
5+
# using cargo-c directly. See the README.md for more information.
6+
7+
CARGO ?= cargo
8+
DESTDIR ?= /usr/local
9+
10+
all: install
11+
12+
check-cargo-c:
13+
@if ! ${CARGO} capi --version >/dev/null 2>&1; then \
14+
printf "%s" "Error: cargo-c is not installed. Install it with 'cargo install cargo-c' " && \
15+
printf "%s\n" "or download a binary release from https://github.com/lu-zero/cargo-c/releases/"; \
16+
exit 1; \
17+
fi
18+
19+
# NOTE: If you wish to customize library features, or build in debug mode, you should use cargo-c directly.
20+
install: check-cargo-c
21+
${CARGO} capi install --release --libdir lib --prefix=${DESTDIR}
22+
23+
.PHONY: all install check-cargo-c

0 commit comments

Comments
 (0)