Makefile
5.16 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
BLEND = avatar_Hozana_wikiLibras.blend
BLENDER = blender
BLUE = \33[34;5m
CACHE = ./__pycache__
CONTROLLER = controller.py
CORE = git@git.lavid.ufpb.br:wikilibras-core
DONE = [$(GREEN)Finalizado$(NONE)]
FAIL = [$(RED)Falhou$(NONE)] Codigo: $$?
GREEN = \33[32;5m
JSON = '{"userId": 2, "rightHand": ["circular", "plano", "horario", 1, 2, 0, 50, 20], "leftHand":[], "facialExp": [6], "signName":"teste_circular"}'
MAIN = libras.py
MODULE = Wikilibras
NONE = \33[m
PYTHON = python3
RED = \33[31;5m
WHITE = \33[37;5m
__default__: py
.clscr:
@echo -n "\033c"
bpy:
@echo "[$(GREEN)Executando$(NONE)]$(BLUE) $(BLENDER) -b "$(BLEND)" -P "$(MAIN)" JSON ...$(NONE)";\
$(BLENDER) -b "$(BLEND)" -P "$(MAIN)" $(JSON)\
&& echo "$(DONE)" || { echo "$(FAIL)"; exit $$?; }
clean: .clscr
@echo -n "$(WHITE)Limpando... $(NONE) ";\
rm -rf "$(CACHE)"\
&& echo "$(DONE)" || { echo "$(FAIL)"; exit $$?; }
git-clone:
@input="";\
while [ "$$input" != "s" ] && [ "$$input" != "n" ];\
do\
echo -n "$(GREEN)Clonar $(BLUE)$(CORE)?$(NONE) (s/n): ";\
read input;\
input="`echo $$input | tr [:upper:] [:lower:]`";\
done;\
if [ "$$input" = "s" ];\
then\
git clone $(CORE);\
else\
exit 0;\
fi\
&& echo "$(DONE)" || { echo "$(FAIL)"; exit $$?; }
git-config:
@echo -n "$(GREEN)Nome:$(BLUE) ";\
git config --global user.name;\
echo -n "$(GREEN)Email:$(BLUE) ";\
git config --global user.email;\
input="";\
while [ "$$input" != "s" ] && [ "$$input" != "n" ];\
do\
echo -n "$(GREEN)Configurar Git?$(NONE) (s/n): ";\
read input;\
input="`echo $$input | tr [:upper:] [:lower:]`";\
done;\
if [ "$$input" = "s" ];\
then\
name="";\
while [ -z "$$name" ];\
do\
echo -n "$(GREEN)Digite seu nome:$(NONE) ";\
read name;\
done;\
email="";\
while [ -z "$$email" ];\
do\
echo -n "$(GREEN)Digite seu email:$(NONE) ";\
read email;\
done;\
input="";\
while [ "$$input" != "s" ] && [ "$$input" != "n" ];\
do\
echo -n "$(GREEN)Confirma dados?$(NONE) (s/n): ";\
read input;\
input="`echo $$input | tr [:upper:] [:lower:]`";\
done;\
if [ "$$input" = "s" ];\
then\
git config --global user.name "$$name";\
git config --global user.email "$$email";\
git config --global color.diff auto;\
git config --global color.status auto;\
git config --global color.branch auto;\
git config --global color.ui true;\
git config --global push.default simple;\
else\
exit 0;\
fi;\
else\
exit 0;\
fi\
&& echo "$(DONE)" || { echo "$(FAIL)"; exit $$?; }
help:
@echo ""
@echo " $(WHITE) Make <args> $(NONE)"
@echo ""
@echo " $(GREEN) <args> $(NONE) $(BLUE) <funcao> $(NONE)"
@echo ""
@echo " $(GREEN) bpy $(NONE) $(BLUE) Executa: $(BLENDER) <$(MAIN)> com parametros JSON do Makefile $(NONE)"
@echo " $(GREEN) clean $(NONE) $(BLUE) Remove pasta(s) temporaria(s): $(CACHE) $(NONE)"
@echo " $(GREEN) git-clone $(NONE) $(BLUE) Clona repositorio: \"$(CORE)\" na pasta atual $(NONE)"
@echo " $(GREEN) git-config $(NONE) $(BLUE) Configura Git para o primeiro uso $(NONE)"
@echo " $(GREEN) help $(NONE) $(BLUE) Exibe ajuda $(NONE)"
@echo " $(GREEN) py $(NONE) $(BLUE) Executa: $(PYTHON) <$(CONTROLLER)> com parametros JSON do Makefile $(NONE)"
@echo " $(GREEN) recv $(NONE) $(BLUE) Recebe dados do repositorio: \"$(CORE)\" $(NONE)"
@echo " $(GREEN) send $(NONE) $(BLUE) Envia dados para o repositorio: \"$(CORE)\" $(NONE)"
@echo ""
py:
@echo "[$(GREEN)Executando$(NONE)]$(BLUE) $(PYTHON) "$(CONTROLLER)" JSON ...$(NONE)";\
$(PYTHON) "$(CONTROLLER)" $(JSON)\
&& echo "$(DONE)" || { echo "$(FAIL)"; exit $$?; }
recv:
@input="";\
while [ "$$input" != "s" ] && [ "$$input" != "n" ];\
do\
echo -n "$(GREEN)Receber dados alterados?$(NONE) (s/n): ";\
read input;\
input="`echo $$input | tr [:upper:] [:lower:]`";\
done;\
if [ "$$input" = "s" ];\
then\
git pull;\
else\
exit 0;\
fi\
&& echo "$(DONE)" || { echo "$(FAIL)"; exit $$?; }
send:
@input="";\
while [ "$$input" != "s" ] && [ "$$input" != "n" ];\
do\
echo -n "$(GREEN)Enviar alteracoes realizadas?$(NONE) (s/n): ";\
read input;\
input="`echo $$input | tr [:upper:] [:lower:]`";\
done;\
if [ "$$input" = "s" ];\
then\
comment="";\
while [ -z "$$comment" ];\
do\
echo -n "$(GREEN)Digite o comentario das alteracoes:$(NONE) ";\
read comment;\
done;\
input="";\
while [ "$$input" != "s" ] && [ "$$input" != "n" ];\
do\
echo -n "$(GREEN)Enviar dados?$(NONE) (s/n): ";\
read input;\
input="`echo $$input | tr [:upper:] [:lower:]`";\
done;\
if [ "$$input" = "s" ];\
then\
git add .;\
git commit -m "$$comment";\
git push;\
else\
exit 0;\
fi;\
else\
exit 0;\
fi\
&& echo "$(DONE)" || { echo "$(FAIL)"; exit $$?; }