From 632716ada7932f3fd09aaa6892644e02b8ed41d7 Mon Sep 17 00:00:00 2001 From: Anhad Singh Date: Tue, 17 Dec 2024 02:57:44 +1100 Subject: [PATCH] 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 --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ca3737a682..ce16fe650e 100644 --- a/Makefile +++ b/Makefile @@ -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)