logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

converters.mk (1432B)


  1. ifneq (,$(filter $(MCU),atmega32u4))
  2. # TODO: opt in rather than assume everything uses a pro micro
  3. PIN_COMPATIBLE ?= promicro
  4. endif
  5. # Remove whitespace from any rule.mk provided vars
  6. # - env cannot be overwritten but cannot have whitespace anyway
  7. CONVERT_TO:=$(strip $(CONVERT_TO))
  8. ifneq ($(CONVERT_TO),)
  9. # stash so we can overwrite env provided vars if needed
  10. ACTIVE_CONVERTER=$(CONVERT_TO)
  11. ifeq ($(PIN_COMPATIBLE),)
  12. $(call CATASTROPHIC_ERROR,Converting to '$(CONVERT_TO)' not possible!)
  13. endif
  14. # glob to search each platfrorm and/or check for valid converter
  15. CONVERTER := $(wildcard $(PLATFORM_PATH)/*/converters/$(PIN_COMPATIBLE)_to_$(CONVERT_TO)/)
  16. ifeq ($(CONVERTER),)
  17. $(call CATASTROPHIC_ERROR,Converting from '$(PIN_COMPATIBLE)' to '$(CONVERT_TO)' not possible!)
  18. endif
  19. -include $(CONVERTER)/pre_converter.mk
  20. PLATFORM_KEY = $(shell echo $(CONVERTER) | cut -d "/" -f2)
  21. # Configure any defaults
  22. OPT_DEFS += -DCONVERT_TO_$(shell echo $(CONVERT_TO) | tr '[:lower:]' '[:upper:]')
  23. OPT_DEFS += -DCONVERTER_TARGET=\"$(CONVERT_TO)\"
  24. OPT_DEFS += -DCONVERTER_ENABLED
  25. VPATH += $(CONVERTER)
  26. # Configure for "alias" - worst case it produces an idential define
  27. OPT_DEFS += -DCONVERT_TO_$(shell echo $(ACTIVE_CONVERTER) | tr '[:lower:]' '[:upper:]')
  28. # Finally run any converter specific logic
  29. include $(CONVERTER)/converter.mk
  30. endif