You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.6 KiB
54 lines
1.6 KiB
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
|
mkfile_dir := $(dir $(mkfile_path))
|
|
include $(mkfile_dir)/arduino-cli-prop.mk
|
|
|
|
export KALEIDOSCOPE_DIR ?= $(abspath $(mkfile_dir)/../..)
|
|
export KALEIDOSCOPE_BIN_DIR ?= $(KALEIDOSCOPE_DIR)/bin
|
|
|
|
# Arduino CLI config
|
|
|
|
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_BOARD_MANAGER_ADDITIONAL_URLS ?= https://raw.githubusercontent.com/keyboardio/boardsmanager/master/package_keyboardio_index.json
|
|
|
|
system_arduino_cli=$(shell command -v arduino-cli || true)
|
|
|
|
ifeq ($(system_arduino_cli),)
|
|
export ARDUINO_CLI ?= $(KALEIDOSCOPE_BIN_DIR)/arduino-cli
|
|
else
|
|
export ARDUINO_CLI ?= $(system_arduino_cli)
|
|
endif
|
|
|
|
ifneq ($(VERBOSE),)
|
|
export ARDUINO_VERBOSE ?= --verbose
|
|
else
|
|
export ARDUINO_VERBOSE ?=
|
|
endif
|
|
|
|
|
|
.PHONY: configure-arduino-cli install-arduino-core-kaleidoscope install-arduino-core-avr
|
|
.PHONY: all
|
|
|
|
.DEFAULT_GOAL := non-goal
|
|
|
|
non-goal:
|
|
@echo "Make without a target doesn't do anything"
|
|
@: ## Do not remove this line, otherwise `make all` will trigger the `%` rule too.
|
|
|
|
|
|
install-arduino-cli:
|
|
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR="$(KALEIDOSCOPE_BIN_DIR)" sh
|
|
|
|
configure-arduino-cli:
|
|
$(ARDUINO_CLI) config init
|
|
|
|
install-arduino-core-kaleidoscope:
|
|
$(ARDUINO_CLI) core install "keyboardio:avr"
|
|
|
|
install-arduino-core-avr:
|
|
$(ARDUINO_CLI) core install "arduino:avr"
|
|
|