forked from RIOT-OS/RIOT
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
makefiles/utils/ansi: Refactor ansi codes into their own file.
The escape codes and special chars now live in their own module. The color module is only concerned with detecting whether to use colors or not. Additional variables are defined with hard a coded ESC char, a tab and a newline. This removes the need for echo or printf.
- Loading branch information
Showing
4 changed files
with
33 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# ANSI Terminal codes and other escape sequences. | ||
# The objective of this definitions is to be able to write special characters | ||
# without resorting to shell commands like echo. | ||
|
||
include $(RIOTMAKE)/utils/ansi_special.mk | ||
|
||
ANSI_GREEN := $(ANSI_ESC)[1;32m | ||
ANSI_RED := $(ANSI_ESC)[1;31m | ||
ANSI_YELLOW := $(ANSI_ESC)[1;33m | ||
ANSI_PURPLE := $(ANSI_ESC)[1;35m | ||
ANSI_RESET := $(ANSI_ESC)[0m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Make does not recognize escaped characters (e.g. \t, \033, etc). | ||
# The following variables contain the characters themselves. | ||
# This file is inherently fragile (i.e. your editor could destroy the tab | ||
# without you realizing, to be careful when editing this. | ||
|
||
# To generate this: $ printf "ANSI_ESC := \033# comment" | ||
ANSI_ESC := # you may or may not be able to see that character in your editor | ||
|
||
# The third parameter to the subst is a tab - be careful not to replace it with | ||
# spaces! | ||
TAB := $(subst ,, ) | ||
|
||
define NEWLINE | ||
|
||
|
||
endef |