Roine

Colours for Makefile

May 15, 2019

I’ve added colours to Makefiles few times in the past. Each and every single time I have spent way too much time figuring out the code for the colours. So here it is, my most used colours in one place:

COLOUR_GREEN=\033[0;32m
COLOUR_RED=\033[0;31m
COLOUR_BLUE=\033[0;34m
COLOUR_END=\033[0m

Usage:

@echo "$(COLOUR_GREEN)Test Passed$(COLOUR_END)"

More info on stackoverflow.