Skip to content

Commit 9fe8f54

Browse files
jcarranofjmolinas
authored andcommitted
makefiles/color: Add color functions.
c_xxxx functions can be used to wrap a piece of text in a $(COLOR_X)...$(COLOR_RESET) block, thereby avoiding the easy mistake of forgetting to place a COLOR_RESET.
1 parent 1036115 commit 9fe8f54

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

makefiles/color.inc.mk

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,11 @@ ifneq ($(CC_NOCOLOR),1)
2727
endif
2828
endif
2929
endif
30+
31+
# Colorizer functions:
32+
# These functions wrap a block of text in $(COLOR_X)...$(COLOR_RESET).
33+
# Do not nest calls to this functions or the colors will be wrong.
34+
c_green = $(COLOR_GREEN)$(1)$(COLOR_RESET)
35+
c_red = $(COLOR_RED)$(1)$(COLOR_RESET)
36+
c_yellow = $(COLOR_YELLOW)$(1)$(COLOR_RESET)
37+
c_purple = $(COLOR_PURPLE)$(1)$(COLOR_RESET)

0 commit comments

Comments
 (0)