diff options
author | Joel Challis <git@zvecr.com> | 2023-01-18 23:16:33 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-18 23:16:33 +0000 |
commit | 12f1a30d165ea89c5d8dbee916500ed1226ab56d (patch) | |
tree | 9df3e31910c01dde358ebfbafbfc8a4b1475d6c5 | |
parent | 364a910b92380559a9202f11bbf5f760d4534979 (diff) |
Add alias support for converters (#19563)
-rw-r--r-- | builddefs/converters.mk | 8 | ||||
-rw-r--r-- | platforms/chibios/converters/promicro_to_bonsai_c3/pre_converter.mk | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/builddefs/converters.mk b/builddefs/converters.mk index 4593c7113f..581276c2e0 100644 --- a/builddefs/converters.mk +++ b/builddefs/converters.mk @@ -8,12 +8,17 @@ endif # TODO: opt in rather than assume everything uses a pro micro PIN_COMPATIBLE ?= promicro ifneq ($(CONVERT_TO),) + # stash so we can overwrite env provided vars if needed + ACTIVE_CONVERTER=$(CONVERT_TO) + # glob to search each platfrorm and/or check for valid converter CONVERTER := $(wildcard $(PLATFORM_PATH)/*/converters/$(PIN_COMPATIBLE)_to_$(CONVERT_TO)/) ifeq ($(CONVERTER),) $(call CATASTROPHIC_ERROR,Converting from '$(PIN_COMPATIBLE)' to '$(CONVERT_TO)' not possible!) endif + -include $(CONVERTER)/pre_converter.mk + TARGET := $(TARGET)_$(CONVERT_TO) # Configure any defaults @@ -22,6 +27,9 @@ ifneq ($(CONVERT_TO),) OPT_DEFS += -DCONVERTER_ENABLED VPATH += $(CONVERTER) + # Configure for "alias" - worst case it produces an idential define + OPT_DEFS += -DCONVERT_TO_$(strip $(shell echo $(ACTIVE_CONVERTER) | tr '[:lower:]' '[:upper:]')) + # Finally run any converter specific logic include $(CONVERTER)/converter.mk endif diff --git a/platforms/chibios/converters/promicro_to_bonsai_c3/pre_converter.mk b/platforms/chibios/converters/promicro_to_bonsai_c3/pre_converter.mk new file mode 100644 index 0000000000..a0ef52a6e2 --- /dev/null +++ b/platforms/chibios/converters/promicro_to_bonsai_c3/pre_converter.mk @@ -0,0 +1,2 @@ +CONVERTER:=platforms/chibios/converters/promicro_to_proton_c +ACTIVE_CONVERTER:=proton_c |