diff --git a/Makefile b/Makefile index 989b6674..054dabc6 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,7 @@ endif BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV) KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/ KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/ +KALEIDOSCOPE_ETC_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/etc/ @@ -51,6 +52,7 @@ endif BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/build-tools/makefiles/ +KALEIDOSCOPE_ETC_DIR ?= keyboardio/avr/libraries/Kaleidoscope/etc/ # If Kaleidoscope's Arduino libraries cannot be found, e.g. because # they reside outside of SKETCHBOOK_DIR, we fall back to assuming that @@ -69,7 +71,7 @@ $(info ************************************************************************* $(info ) endif -include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/sketch-arduino-cli.mk +include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_ETC_DIR)/sketch-arduino-cli.mk # Set up an argument for passing to the simulator tests in docker # but if the var isn't set, don't even pass the definition diff --git a/etc/sketch-arduino-cli.mk b/etc/sketch-arduino-cli.mk new file mode 100644 index 00000000..879ec75a --- /dev/null +++ b/etc/sketch-arduino-cli.mk @@ -0,0 +1,17 @@ +KALEIDOSCOPE_BUILDER_DIR ?= $(BOARD_HARDWARE_PATH)/keyboardio/avr/libraries/Kaleidoscope/bin/ + +.DEFAULT_GOAL := compile + +all: + @echo "Make all target doesn't do anything" + @: ## Do not remove this line, otherwise `make all` will trigger the `%` rule too. + +decompile: disassemble + @: ## Do not remove this line, otherwise `make all` will trigger the `%` rule too. + +xbuild: compile + @: ## Do not remove this line, otherwise `make all` will trigger the `%` rule too. + +%: + @BOARD_HARDWARE_PATH="$(BOARD_HARDWARE_PATH)" $(KALEIDOSCOPE_BUILDER_DIR)/kaleidoscope-builder $@ + diff --git a/examples/Devices/EZ/ErgoDox/Makefile b/examples/Devices/EZ/ErgoDox/Makefile index 5d1b814e..e90e531a 100644 --- a/examples/Devices/EZ/ErgoDox/Makefile +++ b/examples/Devices/EZ/ErgoDox/Makefile @@ -43,6 +43,7 @@ endif BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV) KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/ KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/ +KALEIDOSCOPE_ETC_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/etc/ @@ -51,5 +52,6 @@ endif BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/ +KALEIDOSCOPE_ETC_DIR ?= $(BOARD_HARDWARE_PATH)/keyboardio/avr/libraries/Kaleidoscope/etc/ -include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/sketch-arduino-cli.mk +include $(KALEIDOSCOPE_ETC_DIR)/sketch-arduino-cli.mk diff --git a/examples/Devices/KBDFans/KBD4x/Makefile b/examples/Devices/KBDFans/KBD4x/Makefile index 81a29443..e90e531a 100644 --- a/examples/Devices/KBDFans/KBD4x/Makefile +++ b/examples/Devices/KBDFans/KBD4x/Makefile @@ -37,12 +37,13 @@ $(info $(SKETCHBOOK_DIR)/hardware/keyboardio/ which was installed by hand.) $(info ) $(info ***************************************************************************) $(info ) - + endif BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV) KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/ KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/ +KALEIDOSCOPE_ETC_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/etc/ @@ -51,5 +52,6 @@ endif BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/ +KALEIDOSCOPE_ETC_DIR ?= $(BOARD_HARDWARE_PATH)/keyboardio/avr/libraries/Kaleidoscope/etc/ -include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/sketch-arduino-cli.mk +include $(KALEIDOSCOPE_ETC_DIR)/sketch-arduino-cli.mk diff --git a/examples/Devices/Keyboardio/Atreus/Makefile b/examples/Devices/Keyboardio/Atreus/Makefile index 51da5a83..e90e531a 100644 --- a/examples/Devices/Keyboardio/Atreus/Makefile +++ b/examples/Devices/Keyboardio/Atreus/Makefile @@ -12,7 +12,6 @@ PACKAGE_DIR ?= $(HOME)/.arduino15 endif - ARDUINO_INSTALLED_ENV=$(shell ls -dt $(PACKAGE_DIR)/packages/keyboardio/hardware/avr 2>/dev/null |head -n 1) MANUALLY_INSTALLED_ENV=$(shell ls -dt $(SKETCHBOOK_DIR)/hardware/keyboardio/avr 2>/dev/null |head -n 1) @@ -44,6 +43,7 @@ endif BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV) KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/ KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/ +KALEIDOSCOPE_ETC_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/etc/ @@ -52,5 +52,6 @@ endif BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/ +KALEIDOSCOPE_ETC_DIR ?= $(BOARD_HARDWARE_PATH)/keyboardio/avr/libraries/Kaleidoscope/etc/ -include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/sketch-arduino-cli.mk +include $(KALEIDOSCOPE_ETC_DIR)/sketch-arduino-cli.mk diff --git a/examples/Devices/Keyboardio/Imago/Makefile b/examples/Devices/Keyboardio/Imago/Makefile index 5d1b814e..e90e531a 100644 --- a/examples/Devices/Keyboardio/Imago/Makefile +++ b/examples/Devices/Keyboardio/Imago/Makefile @@ -43,6 +43,7 @@ endif BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV) KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/ KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/ +KALEIDOSCOPE_ETC_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/etc/ @@ -51,5 +52,6 @@ endif BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/ +KALEIDOSCOPE_ETC_DIR ?= $(BOARD_HARDWARE_PATH)/keyboardio/avr/libraries/Kaleidoscope/etc/ -include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/sketch-arduino-cli.mk +include $(KALEIDOSCOPE_ETC_DIR)/sketch-arduino-cli.mk diff --git a/examples/Devices/Keyboardio/Model01/Makefile b/examples/Devices/Keyboardio/Model01/Makefile index 6edab0aa..e90e531a 100644 --- a/examples/Devices/Keyboardio/Model01/Makefile +++ b/examples/Devices/Keyboardio/Model01/Makefile @@ -43,29 +43,15 @@ endif BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV) KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/ KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/ +KALEIDOSCOPE_ETC_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/etc/ -endif - -BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware -KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/ -ifneq ("$(wildcard $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/sketch-arduino-cli.mk)","") -include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/sketch-arduino-cli.mk +endif -else - -$(info ****************************************************************************) -$(info I can't find an installed copy of Kaleidoscope's source code.) -$(info ) -$(info This usually means you're attempting to build a device's firmware from a git) -$(info checkout without having previously told Arduino where to find Kaleidoscope.) -$(info ) -$(info It is probably the case that you want to move or symlink your git checkout ) -$(info of the Kaleidoscope bundle to the directory: ) -$(info ) -$(info $(SKETCHBOOK_DIR)/hardware/keyboardio ) -$(info ****************************************************************************) +BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware +KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/ +KALEIDOSCOPE_ETC_DIR ?= $(BOARD_HARDWARE_PATH)/keyboardio/avr/libraries/Kaleidoscope/etc/ -endif +include $(KALEIDOSCOPE_ETC_DIR)/sketch-arduino-cli.mk diff --git a/examples/Devices/OLKB/Planck/Makefile b/examples/Devices/OLKB/Planck/Makefile index 5d1b814e..e90e531a 100644 --- a/examples/Devices/OLKB/Planck/Makefile +++ b/examples/Devices/OLKB/Planck/Makefile @@ -43,6 +43,7 @@ endif BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV) KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/ KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/ +KALEIDOSCOPE_ETC_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/etc/ @@ -51,5 +52,6 @@ endif BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/ +KALEIDOSCOPE_ETC_DIR ?= $(BOARD_HARDWARE_PATH)/keyboardio/avr/libraries/Kaleidoscope/etc/ -include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/sketch-arduino-cli.mk +include $(KALEIDOSCOPE_ETC_DIR)/sketch-arduino-cli.mk diff --git a/examples/Devices/SOFTHRUF/Splitography/Makefile b/examples/Devices/SOFTHRUF/Splitography/Makefile index b2a84731..e90e531a 100644 --- a/examples/Devices/SOFTHRUF/Splitography/Makefile +++ b/examples/Devices/SOFTHRUF/Splitography/Makefile @@ -37,16 +37,21 @@ $(info $(SKETCHBOOK_DIR)/hardware/keyboardio/ which was installed by hand.) $(info ) $(info ***************************************************************************) $(info ) - + endif BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV) KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/ KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/ +KALEIDOSCOPE_ETC_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/etc/ + + endif + BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/ +KALEIDOSCOPE_ETC_DIR ?= $(BOARD_HARDWARE_PATH)/keyboardio/avr/libraries/Kaleidoscope/etc/ -include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/sketch-arduino-cli.mk +include $(KALEIDOSCOPE_ETC_DIR)/sketch-arduino-cli.mk diff --git a/examples/Devices/Technomancy/Atreus/Makefile b/examples/Devices/Technomancy/Atreus/Makefile index 5d1b814e..e90e531a 100644 --- a/examples/Devices/Technomancy/Atreus/Makefile +++ b/examples/Devices/Technomancy/Atreus/Makefile @@ -43,6 +43,7 @@ endif BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV) KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/ KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/ +KALEIDOSCOPE_ETC_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/etc/ @@ -51,5 +52,6 @@ endif BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/ +KALEIDOSCOPE_ETC_DIR ?= $(BOARD_HARDWARE_PATH)/keyboardio/avr/libraries/Kaleidoscope/etc/ -include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/sketch-arduino-cli.mk +include $(KALEIDOSCOPE_ETC_DIR)/sketch-arduino-cli.mk diff --git a/examples/Devices/gHeavy/ButterStick/Makefile b/examples/Devices/gHeavy/ButterStick/Makefile index 5d1b814e..e90e531a 100644 --- a/examples/Devices/gHeavy/ButterStick/Makefile +++ b/examples/Devices/gHeavy/ButterStick/Makefile @@ -43,6 +43,7 @@ endif BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV) KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/ KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/ +KALEIDOSCOPE_ETC_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/etc/ @@ -51,5 +52,6 @@ endif BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/ +KALEIDOSCOPE_ETC_DIR ?= $(BOARD_HARDWARE_PATH)/keyboardio/avr/libraries/Kaleidoscope/etc/ -include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/sketch-arduino-cli.mk +include $(KALEIDOSCOPE_ETC_DIR)/sketch-arduino-cli.mk diff --git a/examples/Devices/gHeavy/FaunchPad/Makefile b/examples/Devices/gHeavy/FaunchPad/Makefile index 5d1b814e..e90e531a 100644 --- a/examples/Devices/gHeavy/FaunchPad/Makefile +++ b/examples/Devices/gHeavy/FaunchPad/Makefile @@ -43,6 +43,7 @@ endif BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV) KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/ KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/ +KALEIDOSCOPE_ETC_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/etc/ @@ -51,5 +52,6 @@ endif BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/ +KALEIDOSCOPE_ETC_DIR ?= $(BOARD_HARDWARE_PATH)/keyboardio/avr/libraries/Kaleidoscope/etc/ -include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/sketch-arduino-cli.mk +include $(KALEIDOSCOPE_ETC_DIR)/sketch-arduino-cli.mk diff --git a/examples/Internal/Sketch_Exploration/Makefile b/examples/Internal/Sketch_Exploration/Makefile index 5d1b814e..e90e531a 100644 --- a/examples/Internal/Sketch_Exploration/Makefile +++ b/examples/Internal/Sketch_Exploration/Makefile @@ -43,6 +43,7 @@ endif BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV) KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/ KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/ +KALEIDOSCOPE_ETC_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/etc/ @@ -51,5 +52,6 @@ endif BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/ +KALEIDOSCOPE_ETC_DIR ?= $(BOARD_HARDWARE_PATH)/keyboardio/avr/libraries/Kaleidoscope/etc/ -include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/sketch-arduino-cli.mk +include $(KALEIDOSCOPE_ETC_DIR)/sketch-arduino-cli.mk diff --git a/testing/makefiles/delegate.mk b/testing/makefiles/delegate.mk index 2819f18a..e90e531a 100644 --- a/testing/makefiles/delegate.mk +++ b/testing/makefiles/delegate.mk @@ -1,5 +1,5 @@ -# This stub makefile for a Kaleidoscope plugin pulls in -# all targets from the Kaleidoscope-Plugin library +# This stub makefile for a Kaleidoscope example pulls in all the targets +# required to build the example UNAME_S := $(shell uname -s) @@ -43,6 +43,7 @@ endif BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV) KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/ KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/ +KALEIDOSCOPE_ETC_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/etc/ @@ -50,24 +51,7 @@ endif BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware -KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/build-tools/makefiles/ - -# If Kaleidoscope's Arduino libraries cannot be found, e.g. because -# they reside outside of SKETCHBOOK_DIR, we fall back to assuming that -# the hardware directory can be determined in relation to the position of -# this Makefile. -ifeq ("$(wildcard $(BOARD_HARDWARE_PATH)/keyboardio/build-tools/makefiles/rules.mk)","") - # Determine the path of this Makefile - MKFILE_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) - BOARD_HARDWARE_PATH = $(MKFILE_DIR)/../../../../../.. -endif - -ifeq ("$(wildcard $(BOARD_HARDWARE_PATH)/keyboardio/build-tools/makefiles/rules.mk)","") -$(info ***************************************************************************) -$(info Unable to autodetect a proper BOARD_HARDWARE_PATH. Please define it manually.) -$(info ***************************************************************************) -$(info ) -endif - -include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/sketch-arduino-cli.mk +KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/ +KALEIDOSCOPE_ETC_DIR ?= $(BOARD_HARDWARE_PATH)/keyboardio/avr/libraries/Kaleidoscope/etc/ +include $(KALEIDOSCOPE_ETC_DIR)/sketch-arduino-cli.mk