diff options
| author | Simon J. Gerraty <sjg@FreeBSD.org> | 2026-04-06 18:25:05 +0000 |
|---|---|---|
| committer | Simon J. Gerraty <sjg@FreeBSD.org> | 2026-04-06 18:25:05 +0000 |
| commit | fe271bdb43cf88ee129d94c0e286fe618fd28e89 (patch) | |
| tree | f8a53c5b636b2af4eaa7ac94683cb00033588454 /mk/rust.mk | |
| parent | 638c66de4a0faa4c2e815e81cd4021c2387c7e0f (diff) | |
Diffstat (limited to 'mk/rust.mk')
| -rw-r--r-- | mk/rust.mk | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/mk/rust.mk b/mk/rust.mk index 8a3c90116c6e..eab6d8b10181 100644 --- a/mk/rust.mk +++ b/mk/rust.mk @@ -1,6 +1,6 @@ -# $Id: rust.mk,v 1.38 2025/08/09 22:42:24 sjg Exp $ +# $Id: rust.mk,v 1.40 2026/01/08 20:34:30 sjg Exp $ # -# @(#) Copyright (c) 2024, Simon J. Gerraty +# @(#) Copyright (c) 2024-2026, Simon J. Gerraty # # SPDX-License-Identifier: BSD-2-Clause # @@ -180,15 +180,24 @@ all: cargo.clippy .if !defined(RUST_LIBS) RUST_PROGS ?= ${RUST_PROJECT_DIR:T} .endif -.if !empty(RUST_PROGS) -BINDIR ?= ${prefix}/bin +.if !empty(RUST_LIBS) || !empty(RUST_PROGS) # there could be a target triple involved RUST_CARGO_TARGET_DIR ?= ${CARGO_TARGET_DIR} RUST_CARGO_OUTPUT_DIR ?= ${RUST_CARGO_TARGET_DIR}/${RUST_CARGO_TARGET} -RUST_CARGO_BUILD_OUTPUT_LIST := ${RUST_PROGS:S,^,${RUST_CARGO_OUTPUT_DIR}/,} +.if !empty(RUST_LIBS) +LIBDIR ?= ${prefix}/lib +RUST_LIBS_CARGO_BUILD_OUTPUT_LIST := ${RUST_LIBS:S,^,${RUST_CARGO_OUTPUT_DIR}/,} + +${RUST_LIBS_CARGO_BUILD_OUTPUT_LIST}: cargo.build +.endif + +.if !empty(RUST_PROGS) +BINDIR ?= ${prefix}/bin +RUST_PROGS_CARGO_BUILD_OUTPUT_LIST := ${RUST_PROGS:S,^,${RUST_CARGO_OUTPUT_DIR}/,} -${RUST_CARGO_BUILD_OUTPUT_LIST}: cargo.build +${RUST_PROGS_CARGO_BUILD_OUTPUT_LIST}: cargo.build +.endif .endif # for late customizations |
