Skip to content

Commit

Permalink
Makefile handling no color terminal.
Browse files Browse the repository at this point in the history
  • Loading branch information
rsm-lisper committed Jul 20, 2024
1 parent 9fbd419 commit 4a2bdda
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions Exercise.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,21 @@ TEST_RESULTS=$(patsubst %.tin,%.res,$(TESTS))
CC=gcc
CFLAGS=-Wall -Wextra -Werror -ggdb -std=c89

ANSIGREEN="\033[32m"
ANSIYELLOW="\033[33m"
ANSIBOLD="\033[1m"
ANSIRST="\033[0m"
ANSIGOK=" ["$(ANSIGREEN)"OK"$(ANSIRST)"] "
ANSIYBIN=$(ANSIYELLOW)$(BINARY)$(ANSIRST)
ifneq ($(filter $(shell tput colors),8 16 88 256),)
ANSIGREEN="\033[32m"
ANSIYELLOW="\033[33m"
ANSIBOLD="\033[1m"
ANSIRST="\033[0m"
ANSIGOK=" ["$(ANSIGREEN)"OK"$(ANSIRST)"] "
ANSIYBIN=$(ANSIYELLOW)$(BINARY)$(ANSIRST)
else
ANSIGREEN=""
ANSIYELLOW=""
ANSIBOLD=""
ANSIRST=""
ANSIGOK=" [OK] "
ANSIYBIN=$(BINARY)
endif

MAKEFLAGS+=--silent

Expand Down

0 comments on commit 4a2bdda

Please sign in to comment.