From 06cfc43a720a81bc8ccc3fcc8b1d584ba7cf564e Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sat, 14 Nov 2020 18:05:59 -0800 Subject: [PATCH] Start to lift code to the makefile --- bin/kaleidoscope-builder | 11 ----------- etc/sketch-arduino-cli.mk | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index 9baef7c9..f3f52849 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -48,13 +48,6 @@ _configure_arduino_cli_env() { : "${ARDUINO_CLI:=${system_arduino_cli}}" fi - - : "${ARDUINO_CONTENT:=${KALEIDOSCOPE_DIR}/.arduino}" - : "${ARDUINO_DIRECTORIES_DATA:=${ARDUINO_CONTENT}/data}" - : "${ARDUINO_DIRECTORIES_DOWNLOADS:=${ARDUINO_CONTENT}/downloads}" - : "${ARDUINO_DIRECTORIES_USER:=${ARDUINO_CONTENT}/user}" - : "${ARDUINO_CLI_CONFIG:=${ARDUINO_DIRECTORIES_DATA}/arduino-cli.yaml}" - : "${ARDUINO_BOARDS_MANAGER_KALEIDOSCOPE:=https://raw.githubusercontent.com/keyboardio/boardsmanager/master/package_keyboardio_index.json}" } cmd_install_arduino_cli() { @@ -365,10 +358,6 @@ if [ $# -lt 1 ]; then exit 1 fi -: "${KALEIDOSCOPE_DIR:=$( cd "$(dirname "$0")"/.. ; pwd)}" -# shellcheck disable=SC2034 -: "${KALEIDOSCOPE_BIN_DIR:=${KALEIDOSCOPE_DIR}/bin/}" - _identify_os _read_conf_files _configure_arduino_cli_env diff --git a/etc/sketch-arduino-cli.mk b/etc/sketch-arduino-cli.mk index d27ab776..ae3a9bad 100644 --- a/etc/sketch-arduino-cli.mk +++ b/etc/sketch-arduino-cli.mk @@ -1,7 +1,18 @@ mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) mkfile_dir := $(dir $(mkfile_path)) -KALEIDOSCOPE_BUILDER_DIR ?= $(abspath $(mkfile_dir)/../bin) + +export KALEIDOSCOPE_DIR ?= $(abspath $(mkfile_dir)/..) +export KALEIDOSCOPE_BIN_DIR ?= $(KALEIDOSCOPE_DIR)/bin +export ARDUINO_CONTENT ?= $(KALEIDOSCOPE_DIR)/.arduino +export ARDUINO_DIRECTORIES_DATA ?= $(ARDUINO_CONTENT)/data +export ARDUINO_DIRECTORIES_DOWNLOADS ?= $(ARDUINO_CONTENT)/downloads +export ARDUINO_DIRECTORIES_USER ?= $(ARDUINO_CONTENT)/user +export ARDUINO_CLI_CONFIG ?= $(ARDUINO_DIRECTORIES_DATA)/arduino-cli.yaml +export ARDUINO_BOARDS_MANAGER_KALEIDOSCOPE ?= https://raw.githubusercontent.com/keyboardio/boardsmanager/master/package_keyboardio_index.json + + + .DEFAULT_GOAL := compile @@ -20,5 +31,5 @@ flash: compile %: - ARDUINO_DIRECTORIES_USER=$(ARDUINO_DIRECTORIES_USER) $(KALEIDOSCOPE_BUILDER_DIR)/kaleidoscope-builder $@ + ARDUINO_DIRECTORIES_USER=$(ARDUINO_DIRECTORIES_USER) $(KALEIDOSCOPE_BIN_DIR)/kaleidoscope-builder $@