-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.msg
54 lines (43 loc) · 1009 Bytes
/
Makefile.msg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/make -f
# Used colors ANSI modifiers escape codes
color_green := 32
color_red := 31
color_yellow := 33
# Newline - comes handy in some situations
define \n
endef
# Command message - display basic info about the command, and run it.
define cmd
@$(if $(MAKE_FULL_LOG),,\
printf "\033[1;""$4""m>\033[0m \033[1m%s\033[0m %s\n" "$1" "$2";)
$(if $(MAKE_FULL_LOG),,@)$3
endef
# Quiet command - make it non-quiet if full log is enabled.
define qcmd
$(if $(MAKE_FULL_LOG),,@)$1
endef
# Unconditionnal message.
define amsg
@printf "\033[1;""$(color_green)""m>\033[0m \033[1m%s\033[0m\n" "$1"
endef
# Normal message - display it.
define msg
$(if $(MAKE_FULL_LOG),,\
@printf "\033[1;""$2""m>\033[0m \033[1m%s\033[0m\n" "$1")
endef
# Build command
define bcmd
$(call cmd,$1,$2,$3,$(color_green))
endef
# Build message
define bmsg
$(call msg,$1,$(color_green))
endef
# Remove message
define rmsg
$(call msg,$1,$(color_red))
endef
# Install message
define imsg
$(call msg,$1,$(color_yellow))
endef