mirror of
https://github.com/Savapitech/42sh.git
synced 2026-01-18 16:57:28 +01:00
37 lines
668 B
Makefile
37 lines
668 B
Makefile
##
|
|
## EPITECH PROJECT, 2024
|
|
## template
|
|
## File description:
|
|
## utils.mk
|
|
##
|
|
|
|
ifneq ($(shell command -v tput),)
|
|
ifneq ($(shell tput colors),0)
|
|
|
|
C_RESET := \033[00m
|
|
C_BOLD := \e[1m
|
|
C_RED := \e[31m
|
|
C_GREEN := \e[32m
|
|
C_YELLOW := \e[33m
|
|
C_BLUE := \e[34m
|
|
C_PURPLE := \e[35m
|
|
C_CYAN := \e[36m
|
|
|
|
C_BEGIN := \033[A
|
|
|
|
endif
|
|
endif
|
|
|
|
NOW = $(shell date +%s%3N)
|
|
STIME := $(call NOW)
|
|
TIME_NS = $(shell expr $(call NOW) - $(STIME))
|
|
TIME_MS = $(shell expr $(call TIME_NS))
|
|
|
|
BOXIFY = "[$(C_BLUE)$(1)$(C_RESET)] $(2)"
|
|
|
|
ifneq ($(shell command -v printf),)
|
|
LOG_TIME = printf $(call BOXIFY, %6s , %b\n) "$(call TIME_MS)"
|
|
else
|
|
LOG_TIME = echo -e $(call BOXIFY, $(call TIME_MS) ,)
|
|
endif
|