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.

41 lines
1.7 KiB

  1. # Note for new boards -- CTPC and CONVERT_TO_PROTON_C are deprecated terms
  2. # and should not be replicated for new boards. These will be removed from
  3. # documentation as well as existing keymaps in due course.
  4. ifneq ($(findstring yes, $(CTPC)$(CONVERT_TO_PROTON_C)),)
  5. $(call CATASTROPHIC_ERROR,The `CONVERT_TO_PROTON_C` and `CTPC` options are now deprecated. `CONVERT_TO=proton_c` should be used instead.)
  6. endif
  7. # TODO: opt in rather than assume everything uses a pro micro
  8. PIN_COMPATIBLE ?= promicro
  9. # Remove whitespace from any rule.mk provided vars
  10. # - env cannot be overwritten but cannot have whitespace anyway
  11. CONVERT_TO:=$(strip $(CONVERT_TO))
  12. ifneq ($(CONVERT_TO),)
  13. # stash so we can overwrite env provided vars if needed
  14. ACTIVE_CONVERTER=$(CONVERT_TO)
  15. # glob to search each platfrorm and/or check for valid converter
  16. CONVERTER := $(wildcard $(PLATFORM_PATH)/*/converters/$(PIN_COMPATIBLE)_to_$(CONVERT_TO)/)
  17. ifeq ($(CONVERTER),)
  18. $(call CATASTROPHIC_ERROR,Converting from '$(PIN_COMPATIBLE)' to '$(CONVERT_TO)' not possible!)
  19. endif
  20. -include $(CONVERTER)/pre_converter.mk
  21. PLATFORM_KEY = $(shell echo $(CONVERTER) | cut -d "/" -f2)
  22. TARGET := $(TARGET)_$(CONVERT_TO)
  23. # Configure any defaults
  24. OPT_DEFS += -DCONVERT_TO_$(shell echo $(CONVERT_TO) | tr '[:lower:]' '[:upper:]')
  25. OPT_DEFS += -DCONVERTER_TARGET=\"$(CONVERT_TO)\"
  26. OPT_DEFS += -DCONVERTER_ENABLED
  27. VPATH += $(CONVERTER)
  28. # Configure for "alias" - worst case it produces an idential define
  29. OPT_DEFS += -DCONVERT_TO_$(shell echo $(ACTIVE_CONVERTER) | tr '[:lower:]' '[:upper:]')
  30. # Finally run any converter specific logic
  31. include $(CONVERTER)/converter.mk
  32. endif