From d8c8549e1d7293f32a914558e5fb91754edc87ab Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sat, 14 Nov 2020 23:52:18 -0800 Subject: [PATCH] lift more paths out to the makefile --- bin/kaleidoscope-builder | 11 ----------- etc/sketch-arduino-cli.mk | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index db66696c..0d17f6af 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -93,17 +93,6 @@ _set_executable_paths() { } _set_build_paths() { - # We need that echo because we\re piping to cksum - # shellcheck disable=SC2005 - SKETCH_IDENTIFIER="$(echo "${SKETCH_FILE_PATH}" | cksum | cut -d ' ' -f 1)-${SKETCH_FILE_NAME}" - - : "${SKETCH_BUILD_DIR:=${SKETCH_IDENTIFIER}/build}" - : "${SKETCH_OUTPUT_DIR:=${SKETCH_IDENTIFIER}/output}" - - : "${BUILD_PATH:=${KALEIDOSCOPE_BUILD_PATH}/${SKETCH_BUILD_DIR}}" - : "${OUTPUT_PATH:=${KALEIDOSCOPE_OUTPUT_PATH}/${SKETCH_OUTPUT_DIR}}" - - : "${LIB_PROPERTIES_PATH:="../.."}" GIT_VERSION="$( cd "${SKETCH_DIR}" if [ -d .git ]; then echo -n '-g' && git describe --abbrev=4 --dirty --always; fi diff --git a/etc/sketch-arduino-cli.mk b/etc/sketch-arduino-cli.mk index e7aaaee8..05c63a76 100644 --- a/etc/sketch-arduino-cli.mk +++ b/etc/sketch-arduino-cli.mk @@ -63,6 +63,24 @@ sketch_exists_p = $(realpath $(wildcard $(dir)/$(SKETCH_FILE_NAME))) export SKETCH_FILE_PATH := $(firstword $(foreach dir,$(sketch_dir_candidates),$(sketch_exists_p))) + + + + +export SKETCH_IDENTIFIER := $(shell echo "$${SKETCH_FILE_PATH}" | cksum | cut -d ' ' -f 1)-$(SKETCH_FILE_NAME) + +export SKETCH_BUILD_DIR := $(SKETCH_IDENTIFIER)/build +export SKETCH_OUTPUT_DIR := $(SKETCH_IDENTIFIER)/output + +export BUILD_PATH := $(KALEIDOSCOPE_BUILD_PATH)/$(SKETCH_BUILD_DIR) +export OUTPUT_PATH := $(KALEIDOSCOPE_OUTPUT_PATH)/$(SKETCH_OUTPUT_DIR) + +export LIB_PROPERTIES_PATH := "../.." + + + + + $(SKETCH_FILE_PATH): @echo "Sketch is $(SKETCH_FILE_PATH)"