From 82515e46d96d754479e61fdfb84a6b534d61c593 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sat, 19 Dec 2020 14:42:14 -0800 Subject: [PATCH] A small optimization for recursive makefile calls to stop shelling out to look for arduino-cli when we already know the answer --- etc/makefiles/arduino-cli.mk | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/etc/makefiles/arduino-cli.mk b/etc/makefiles/arduino-cli.mk index 71577647..8560a76b 100644 --- a/etc/makefiles/arduino-cli.mk +++ b/etc/makefiles/arduino-cli.mk @@ -75,19 +75,20 @@ endif endif - - -system_arduino_cli := $(shell command -v arduino-cli || true) - arduino_env = ARDUINO_DIRECTORIES_USER=$(ARDUINO_DIRECTORIES_USER) \ ARDUINO_DIRECTORIES_DATA=$(ARDUINO_DIRECTORIES_DATA) +ifeq ($(ARDUINO_CLI_PATH),) + +system_arduino_cli ?= $(shell command -v arduino-cli || true) + ifeq ($(system_arduino_cli),) export ARDUINO_CLI_PATH ?= $(KALEIDOSCOPE_BIN_DIR)/arduino-cli else export ARDUINO_CLI_PATH ?= $(system_arduino_cli) endif +endif export ARDUINO_CLI ?= $(arduino_env) $(ARDUINO_CLI_PATH)