From 9fe8f54db99ed9c9b6f548576250f44429d727f0 Mon Sep 17 00:00:00 2001 From: Juan Carrano Date: Mon, 2 Sep 2019 17:57:42 +0200 Subject: [PATCH] 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. --- makefiles/color.inc.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/makefiles/color.inc.mk b/makefiles/color.inc.mk index ea494442db..4e14ea3ea0 100644 --- a/makefiles/color.inc.mk +++ b/makefiles/color.inc.mk @@ -27,3 +27,11 @@ ifneq ($(CC_NOCOLOR),1) endif endif endif + +# Colorizer functions: +# These functions wrap a block of text in $(COLOR_X)...$(COLOR_RESET). +# Do not nest calls to this functions or the colors will be wrong. +c_green = $(COLOR_GREEN)$(1)$(COLOR_RESET) +c_red = $(COLOR_RED)$(1)$(COLOR_RESET) +c_yellow = $(COLOR_YELLOW)$(1)$(COLOR_RESET) +c_purple = $(COLOR_PURPLE)$(1)$(COLOR_RESET)