-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.print.mk
39 lines (33 loc) · 2.11 KB
/
.print.mk
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
# printing functions
printseptop = ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
printsepbot = ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
print_template = "┃ %-100s ┃\n"
print_template_dep = "┠── %-98s ┃\n"
define printdeps =
@echo "$(printseptop)"
@printf $(print_template) "Making $(1)"
@if [[ -n "$(2)" ]]; then \
printf $(print_template) "depends:"; \
for dep in $(subst $(GOPATH)/src/,,$(2)); do \
printf $(print_template_dep) "$$dep"; \
done; \
printf $(print_template) "changed:"; \
for changed in $(subst $(GOPATH)/src/,,$(3)); do \
printf $(print_template_dep) "$$changed"; \
done; \
fi;
@echo "$(printsepbot)"
endef
define printfoot =
@echo "$(printseptop)"
@printf "┃ ✓ %-98s ┃\n" "Made $(1)"
@echo "$(printsepbot)"
endef
alertseptop = ╔══════════════════════════════════════════════════════════════════════════════════════════════════════╗
alertsepbot = ╚══════════════════════════════════════════════════════════════════════════════════════════════════════╝
alert_template = "║ %-100s ║\n"
define message =
echo "$(alertseptop)"; \
echo -e "$(shell echo -n $(1))" | while read ln; do printf $(alert_template) "$$ln"; done; \
echo "$(alertsepbot)"
endef