From 3bf320e039d513edfc5be5e49030a368b7d44721 Mon Sep 17 00:00:00 2001 From: Bernhard Suttner Date: Mon, 29 Nov 2021 20:41:36 +0100 Subject: [PATCH] Setup makefile build environment --- Makefile | 13 +++++++++---- config.yaml | 3 +++ 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 config.yaml diff --git a/Makefile b/Makefile index 4f49de1..ab9f472 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ PROJECT = CO2-Ampel_Plus BOARD_TYPE = co2ampel:samd:sb ARDUINO_CLI = arduino-cli -ARDUINO_CLI_DIR = /usr/bin +CONFIG_FILE = config.yaml SERIAL_PORT = COM18 VERBOSE = 1 @@ -19,13 +19,18 @@ endif .PHONY: all example program clean -all: example +all: prepare build + +prepare: + $(ARDUINO_CLI) --config-file $(CONFIG_FILE) core install co2ampel:samd + $(ARDUINO_CLI) --config-file $(CONFIG_FILE) core install arduino:samd + $(ARDUINO_CLI) --config-file $(CONFIG_FILE) lib install ArduinoJson build: - $(ARDUINO_CLI_DIR)/$(ARDUINO_CLI) compile $(VERBOSE_FLAG) --build-path=$(BUILD_PATH) --build-cache-path=$(BUILD_CACHE_PATH) -b $(BOARD_TYPE) $(PROJECT) + $(ARDUINO_CLI) --config-file $(CONFIG_FILE) compile $(VERBOSE_FLAG) --build-path=$(BUILD_PATH) --build-cache-path=$(BUILD_CACHE_PATH) -b $(BOARD_TYPE) $(PROJECT) program: - $(ARDUINO_CLI_DIR)/$(ARDUINO_CLI) upload $(VERBOSE_FLAG) -p $(SERIAL_PORT) --fqbn $(BOARD_TYPE) $(PROJECT) + $(ARDUINO_CLI) --config-file $(CONFIG_FILE) upload $(VERBOSE_FLAG) -p $(SERIAL_PORT) --fqbn $(BOARD_TYPE) $(PROJECT) clean: -@rm -rf $(BUILD_PATH) diff --git a/config.yaml b/config.yaml new file mode 100644 index 0000000..7269b3a --- /dev/null +++ b/config.yaml @@ -0,0 +1,3 @@ +board_manager: + additional_urls: + - https://github.com/watterott/CO2-Ampel/raw/master/package_co2ampel_index.json