Skip to content

Commit

Permalink
Add a compiler coloring tool to highlight warning and errors in the o…
Browse files Browse the repository at this point in the history
…utput.
  • Loading branch information
sjwilks committed Jan 28, 2015
1 parent 27b2701 commit a25dbb3
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Tools/make_color.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/sh
# make_color.sh
#
# Author: Simon Wilks ([email protected])
#
# A compiler color coder.
#
# To invoke this script everytime you run make simply create the alias:
#
# alias make='<your-firmware-directory>/Tools/make_color.sh'
#
# Color codes:
#
# white "\033[1,37m"
# yellow "\033[1,33m"
# green "\033[1,32m"
# blue "\033[1,34m"
# cyan "\033[1,36m"
# red "\033[1,31m"
# magenta "\033[1,35m"
# black "\033[1,30m"
# darkwhite "\033[0,37m"
# darkyellow "\033[0,33m"
# darkgreen "\033[0,32m"
# darkblue "\033[0,34m"
# darkcyan "\033[0,36m"
# darkred "\033[0,31m"
# darkmagenta "\033[0,35m"
# off "\033[0,0m"
#
OFF="\o033[0m"
WARN="\o033[1;33m"
ERROR="\o033[1;31m"
INFO="\o033[0;37m"

make ${@} 2>&1 | sed "s/make\[[0-9]\].*/$INFO & $OFF/;s/.*: warning: .*/$WARN & $OFF/;s/.*: error: .*/$ERROR & $OFF/"

0 comments on commit a25dbb3

Please sign in to comment.