fix(Makefile): delay

I noticed a pretty significant delay (of ~5s on my machine) after
executing `make`.

This was because TARGET was currently defined as a recursively expanded
variable. This means that the command:

rustc -Z unstable-options --print target-spec-json | grep llvm-target | cut -d '"' -f4

..will get run everytime TARGET is mentioned. This patch fixes the above
by defining the variable as an immediately expanded value. This will
ensure the command only get run once and still skips if predefined.

Signed-off-by: Anhad Singh <andypython@protonmail.com>
This commit is contained in:
Anhad Singh
2024-12-17 02:57:44 +11:00
parent 14ecc9540a
commit 632716ada7
+3 -1
View File
@@ -1,4 +1,6 @@
export TARGET?=$(shell rustc -Z unstable-options --print target-spec-json | grep llvm-target | cut -d '"' -f4)
ifndef TARGET
export TARGET:=$(shell rustc -Z unstable-options --print target-spec-json | grep llvm-target | cut -d '"' -f4)
endif
CARGO?=cargo
CARGO_TEST?=$(CARGO)