diff options
author | Thomas Mühlbacher <tmuehlbacher@posteo.net> | 2025-03-21 16:34:00 +0000 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-03-21 13:08:48 -0400 |
commit | 1a8e684ae097cb93c4fb8582d529b0e50b60377d (patch) | |
tree | 6002f0943a10c99ead651817418293dd6dc64948 | |
parent | 3d972489a827f5d4cb30785eb52bc7fde6b83297 (diff) |
fix(makefile): locate built bin with CARGO_BUILD_TARGET set
When this environment variable is set, e.g. for some cross compile
setups, the target dir is nested a little further.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | Makefile | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -22,6 +22,13 @@ else CARGO_CLEAN_ARGS = --quiet endif +# when cross compiling, cargo places the built binary in a different location +ifdef CARGO_BUILD_TARGET + BUILT_BIN = target/$(CARGO_BUILD_TARGET)/release/bcachefs +else + BUILT_BIN = target/release/bcachefs +endif + # Prevent recursive expansions of $(CFLAGS) to avoid repeatedly performing # compile tests CFLAGS:=$(CFLAGS) @@ -195,7 +202,7 @@ cmd_version.o : .version install: INITRAMFS_HOOK=$(INITRAMFS_DIR)/hooks/bcachefs install: INITRAMFS_SCRIPT=$(INITRAMFS_DIR)/scripts/local-premount/bcachefs install: bcachefs $(optional_install) - $(INSTALL) -m0755 -D target/release/bcachefs -t $(DESTDIR)$(ROOT_SBINDIR) + $(INSTALL) -m0755 -D $(BUILT_BIN) -t $(DESTDIR)$(ROOT_SBINDIR) $(INSTALL) -m0644 -D bcachefs.8 -t $(DESTDIR)$(PREFIX)/share/man/man8/ $(INSTALL) -m0755 -D initramfs/script $(DESTDIR)$(INITRAMFS_SCRIPT) $(INSTALL) -m0755 -D initramfs/hook $(DESTDIR)$(INITRAMFS_HOOK) |