Copy of https://github.com/qmk/qmk_firmware Modified for our keyboard.
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.

96 lines
4.5KB

  1. COLOR ?= true
  2. ifeq ($(COLOR),true)
  3. NO_COLOR=\033[0m
  4. OK_COLOR=\033[32;01m
  5. ERROR_COLOR=\033[31;01m
  6. WARN_COLOR=\033[33;01m
  7. BLUE=\033[0;34m
  8. BOLD=\033[1m
  9. endif
  10. ifneq ($(shell echo "1 2 3" | awk '{ printf "%2s", $$3; }' 2>/dev/null)," 3")
  11. AWK=awk
  12. else
  13. AWK=cat && test
  14. endif
  15. ON_ERROR ?= exit 1
  16. OK_STRING=$(OK_COLOR)[OK]$(NO_COLOR)\n
  17. ERROR_STRING=$(ERROR_COLOR)[ERRORS]$(NO_COLOR)\n
  18. WARN_STRING=$(WARN_COLOR)[WARNINGS]$(NO_COLOR)\n
  19. TAB_LOG = printf "\n%s\n\n" "$$LOG" | $(AWK) '{ sub(/^/," | "); print }'
  20. TAB_LOG_PLAIN = printf "%s\n" "$$LOG"
  21. AWK_STATUS = $(AWK) '{ printf " %-10s\n", $$1; }'
  22. AWK_CMD = $(AWK) '{ printf "%-99s", $$0; }'
  23. PRINT_ERROR = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG) && $(ON_ERROR)
  24. PRINT_WARNING = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG)
  25. PRINT_ERROR_PLAIN = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) && $(ON_ERROR)
  26. PRINT_WARNING_PLAIN = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN)
  27. PRINT_OK = $(SILENT) || printf " $(OK_STRING)" | $(AWK_STATUS)
  28. BUILD_CMD = LOG=$$($(CMD) 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING); else $(PRINT_OK); fi;
  29. MAKE_MSG_FORMAT = $(AWK) '{ printf "%-118s", $$0;}'
  30. # Define Messages
  31. # English
  32. MSG_ERRORS_NONE = Errors: none
  33. MSG_ERRORS = $(ERROR_COLOR)Make finished with errors\n$(NO_COLOR)
  34. MSG_BEGIN = -------- begin --------
  35. MSG_END = -------- end --------
  36. MSG_SIZE_BEFORE = Size before:
  37. MSG_SIZE_AFTER = Size after:
  38. MSG_COFF = Converting to AVR COFF:
  39. MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
  40. MSG_FLASH = Creating load file for flashing:
  41. MSG_EEPROM = Creating load file for EEPROM:
  42. MSG_BIN = Creating binary load file for flashing:
  43. MSG_EXTENDED_LISTING = Creating Extended Listing:
  44. MSG_SYMBOL_TABLE = Creating Symbol Table:
  45. MSG_LINKING = Linking:
  46. MSG_COMPILING = Compiling:
  47. MSG_COMPILING_CPP = Compiling:
  48. MSG_ASSEMBLING = Assembling:
  49. MSG_CLEANING = Cleaning project:
  50. MSG_CREATING_LIBRARY = Creating library:
  51. MSG_SUBMODULE_DIRTY = $(WARN_COLOR)WARNING:$(NO_COLOR)\n \
  52. Some git sub-modules are out of date or modified, please consider running:$(BOLD)\n\
  53. make git-submodule\n\
  54. You can ignore this warning if you are not compiling any ChibiOS keyboards,\n\
  55. or if you have modified the ChibiOS libraries yourself. \n\n$(NO_COLOR)
  56. MSG_NO_CMP = $(ERROR_COLOR)Error:$(NO_COLOR)$(BOLD) cmp command not found, please install diffutils\n$(NO_COLOR)
  57. define GENERATE_MSG_MAKE_KB
  58. MSG_MAKE_KB_ACTUAL := Making $$(KB_SP) with keymap $(BOLD)$$(CURRENT_KM)$(NO_COLOR)
  59. ifneq ($$(MAKE_TARGET),)
  60. MSG_MAKE_KB_ACTUAL += and target $(BOLD)$$(MAKE_TARGET)$(NO_COLOR)
  61. endif
  62. endef
  63. MSG_MAKE_KB = $(eval $(call GENERATE_MSG_MAKE_KB))$(MSG_MAKE_KB_ACTUAL)
  64. define GENERATE_MSG_MAKE_TEST
  65. MSG_MAKE_TEST_ACTUAL := Making test $(BOLD)$(TEST_NAME)$(NO_COLOR)
  66. ifneq ($$(MAKE_TARGET),)
  67. MSG_MAKE_TEST_ACTUAL += with target $(BOLD)$$(MAKE_TARGET)$(NO_COLOR)
  68. endif
  69. endef
  70. MSG_MAKE_TEST = $(eval $(call GENERATE_MSG_MAKE_TEST))$(MSG_MAKE_TEST_ACTUAL)
  71. MSG_TEST = Testing $(BOLD)$(TEST_NAME)$(NO_COLOR)
  72. define GENERATE_MSG_AVAILABLE_KEYMAPS
  73. MSG_AVAILABLE_KEYMAPS_ACTUAL := Available keymaps for $(BOLD)$$(CURRENT_KB)$(NO_COLOR):
  74. endef
  75. MSG_AVAILABLE_KEYMAPS = $(eval $(call GENERATE_MSG_AVAILABLE_KEYMAPS))$(MSG_AVAILABLE_KEYMAPS_ACTUAL)
  76. MSG_CHECK_FILESIZE = Checking file size of $(TARGET).hex
  77. MSG_FILE_TOO_BIG = $(ERROR_COLOR)The firmware is too large!$(NO_COLOR) $(CURRENT_SIZE)/$(MAX_SIZE) ($(OVER_SIZE) bytes over)\n
  78. MSG_FILE_TOO_SMALL = The firmware is too small! $(CURRENT_SIZE)/$(MAX_SIZE)\n
  79. MSG_FILE_JUST_RIGHT = The firmware size is fine - $(CURRENT_SIZE)/$(MAX_SIZE) ($(PERCENT_SIZE)%%, $(FREE_SIZE) bytes free)\n
  80. MSG_FILE_NEAR_LIMIT = The firmware size is approaching the maximum - $(CURRENT_SIZE)/$(MAX_SIZE) ($(PERCENT_SIZE)%%, $(FREE_SIZE) bytes free)\n
  81. MSG_PYTHON_MISSING = $(WARN_COLOR)WARNING:$(NO_COLOR)\n \
  82. Python 3 is not installed. It will be required by a future version\n\
  83. of qmk_firmware.\n\n\
  84. Please run $(BOLD)util/qmk_install.sh$(NO_COLOR) to install all the dependencies QMK requires.\n\n
  85. MSG_FLASH_BOOTLOADER = $(WARN_COLOR)WARNING:$(NO_COLOR) This board's bootloader is not specified or is not supported by the \":flash\" target at this time.\n\n
  86. MSG_FLASH_ARCH = $(WARN_COLOR)WARNING:$(NO_COLOR) This board's architecture is not supported by the \":flash\" target at this time.\n\n
  87. MSG_BOOTLOADER_NOT_FOUND = $(ERROR_COLOR)ERROR:$(NO_COLOR) Bootloader not found. Trying again in 5s.\n