message.mk 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 awk --version 2>/dev/null),)
  11. AWK=awk
  12. else
  13. AWK=cat && test
  14. endif
  15. OK_STRING=$(OK_COLOR)[OK]$(NO_COLOR)\n
  16. ERROR_STRING=$(ERROR_COLOR)[ERRORS]$(NO_COLOR)\n
  17. WARN_STRING=$(WARN_COLOR)[WARNINGS]$(NO_COLOR)\n
  18. TAB_LOG = printf "\n$$LOG\n\n" | $(AWK) '{ sub(/^/," | "); print }'
  19. TAB_LOG_PLAIN = printf "$$LOG\n"
  20. AWK_STATUS = $(AWK) '{ printf " %-10s\n", $$1; }'
  21. AWK_CMD = $(AWK) '{ printf "%-99s", $$0; }'
  22. PRINT_ERROR = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG) && exit 1
  23. PRINT_WARNING = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG)
  24. PRINT_ERROR_PLAIN = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) && exit 1
  25. PRINT_WARNING_PLAIN = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN)
  26. PRINT_OK = $(SILENT) || printf " $(OK_STRING)" | $(AWK_STATUS)
  27. BUILD_CMD = LOG=$$($(CMD) 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING); else $(PRINT_OK); fi;
  28. MSG_NO_CMP = $(ERROR_COLOR)Error:$(NO_COLOR)$(BOLD) cmp command not found, please install diffutils\n$(NO_COLOR)
  29. # Define Messages
  30. # English
  31. MSG_ERRORS_NONE = Errors: none
  32. MSG_BEGIN = -------- begin --------
  33. MSG_END = -------- end --------
  34. MSG_SIZE_BEFORE = Size before:
  35. MSG_SIZE_AFTER = Size after:
  36. MSG_COFF = Converting to AVR COFF:
  37. MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
  38. MSG_FLASH = Creating load file for Flash:
  39. MSG_EEPROM = Creating load file for EEPROM:
  40. MSG_BIN = Creating binary load file for Flash:
  41. MSG_EXTENDED_LISTING = Creating Extended Listing:
  42. MSG_SYMBOL_TABLE = Creating Symbol Table:
  43. MSG_LINKING = Linking:
  44. MSG_COMPILING = Compiling:
  45. MSG_COMPILING_CPP = Compiling:
  46. MSG_ASSEMBLING = Assembling:
  47. MSG_CLEANING = Cleaning project:
  48. MSG_CREATING_LIBRARY = Creating library:
  49. MSG_SUBMODULE_DIRTY = $(WARN_COLOR)WARNING:$(NO_COLOR)\n \
  50. Some git sub-modules are out of date or modified, please consider runnning:$(BOLD)\n\
  51. git submodule sync --recursive\n\
  52. git submodule update --init --recursive$(NO_COLOR)\n\n\
  53. You can ignore this warning if you are not compiling any ChibiOS keyboards,\n\
  54. or if you have modified the ChibiOS libraries yourself. \n\n