GNUmakefile: add support for 'CARGO_TARGET_DIR' enviroment variable

This commit is contained in:
Zachary Goff-Hodges
2025-02-04 05:12:57 -08:00
committed by Dorian Péron
parent d31a19f2c4
commit 7d46a35e02
+4
View File
@@ -41,7 +41,11 @@ PROG_PREFIX ?=
# This won't support any directory with spaces in its name, but you can just
# make a symlink without spaces that points to the directory.
BASEDIR ?= $(shell pwd)
ifdef CARGO_TARGET_DIR
BUILDDIR := $(CARGO_TARGET_DIR)/${PROFILE}
else
BUILDDIR := $(BASEDIR)/target/${PROFILE}
endif
PKG_BUILDDIR := $(BUILDDIR)/deps
DOCSDIR := $(BASEDIR)/docs