From 152dc37057179d35673d31d02d653b37ea660c5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 9 Apr 2025 13:34:40 +0200 Subject: [PATCH] build: always set --target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit since it affects whether cargo puts build artifacts directly into target/debug (or target/release) or into a target-specific sub-directory. the package build will always pass `--target $(DEB_HOST_RUST_TYPE)`, since it invokes the cargo wrapper in /usr/share/cargo/bin/cargo, so this change unifies the behaviour across plain `make` and `make deb`. direct calls to `cargo build/test/..` will still work as before. Signed-off-by: Fabian Grünbichler Reviewed-by: Thomas Lamprecht --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index dfbaacab..dc6aa72f 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,10 @@ include /usr/share/dpkg/default.mk +include /usr/share/rustc/architecture.mk include defines.mk PACKAGE := proxmox-backup ARCH := $(DEB_BUILD_ARCH) +export DEB_HOST_RUST_TYPE SUBDIRS := etc www docs templates @@ -37,9 +39,10 @@ SUBCRATES != cargo metadata --no-deps --format-version=1 \ | sed -e "s!.*$$PWD/!!g" -e 's/\#.*$$//g' -e 's/)$$//g' ifeq ($(BUILD_MODE), release) -CARGO_BUILD_ARGS += --release +CARGO_BUILD_ARGS += --release --target $(DEB_HOST_RUST_TYPE) COMPILEDIR := target/$(DEB_HOST_RUST_TYPE)/release else +CARGO_BUILD_ARGS += --target $(DEB_HOST_RUST_TYPE) COMPILEDIR := target/$(DEB_HOST_RUST_TYPE)/debug endif