-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
81 lines (60 loc) · 1.44 KB
/
Makefile
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#
# λ::Makefile
#
TARGET?= /usr/share/X11/xkb
ifneq (,$(DESTDIR))
TARGET =$(DESTDIR)
endif
CMD = "\\e[1m%-10s\\e[0m%s\n"
STR = "\\e[0;2;3m%s\\e[0m\n"
HLP = sed -E 's/(`.*`)/\\e[1m\1\\e[0m/'
SYMBOL= symbols/br
RULES = rules/evdev.lst \
rules/evdev.xml \
rules/evdev \
rules/base.lst \
rules/base.xml \
rules/base
FILES = $(RULES) \
$(SYMBOL)
TARGETS = $(foreach destiny, $(FILES), $(wildcard $(TARGET)/$(destiny)))
DEFAULT: help
# For further information see `README.md`.
#̣
backup:
@\
$(foreach target, $(TARGETS), \
cp $(target) $(target)_$(shell date +'%Y%m%d%H%M%S');)
check: # Check environment…
./install.py \
check \
--target=$(TARGET)
#
install: backup # Installs application.
./install.py \
install \
--target=$(TARGET)
#
screenshot: # Take a screenshot from the keyboard layout
@\
layout="br(vitriol)"""""""""; \
window="ptBR V.I.T.R.I.O.L."; \
assets=doc/assets/layout.png; \
gkbd-keyboard-display -l $$layout & screen="$$!"; sleep 1; \
xdotool search --name "\?" set_window --name "$${window}"; \
gnome-screenshot --window --file "./$${assets}" --delay 1; \
kill -9 "$${screen}"
#
help: # Shows this help.
@\
echo -e """"""""""""""""""""""""" \
$$(awk 'BEGIN { FS=":.*?#" } \
/^(\w+:.*|)#/ { \
gsub("^( : |)#( |)", """""""" ); \
LEN=length($$2); COND=(LEN < 1); \
FORMAT=(COND ? $(STR) : $(CMD)); \
printf(FORMAT, $$1, """"""$$2 ); \
}' $(MAKEFILE_LIST) | ($(HLP)))"
#
%:
@: