-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
127 lines (93 loc) · 3.66 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
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
TIMESTAMP != date "+%FT%T%z"
TEX = lualatex -halt-on-error -8bit # -papersize=A4 -interaction=batchmode
MKIDX = ~/.local/bin/zhmakeindex -s ./config/dicionario.ist
BOOK = pdfjam --landscape --signature 20 --twoside --a4paper --suffix booklet
INCDIR = ./include
BKPDIR = ./backup
DSTSITE = /var/www/ler.cordeiro.nom.br/dicionario
DSTREPO = /var/www/repo.ler.cordeiro.nom.br/Dicionário
PGENGRP = ./bin/gengroupsbypinyin.py
PVERBTAR = ~/Documentos/Chinês/DCP/entries_by_pinyin.tar.gz
PVERBDIR = ./entries_by_pinyin
PGRPDIR = ./groups_by_pinyin
SGENGRP = ./bin/gengroupsbystrokes.py
SVERBTAR = ~/Documentos/Chinês/DCP/entries_by_strokes.tar.gz
SVERBDIR = ./entries_by_strokes
SGRPDIR = ./groups_by_strokes
all : dicionario_por_pinyin dicionario_por_tracos
dicionario_por_pinyin : dicionario_por_pinyin.pdf dicionario_por_pinyin_livreto.pdf
dicionario_por_tracos : dicionario_por_tracos.pdf dicionario_por_tracos_livreto.pdf
$(PVERBTAR) :
echo Already done...
$(SVERBTAR) :
echo Already done...
entries_by_pinyin.tar.gz : $(PVERBTAR)
cp entries_by_pinyin.tar.gz backup/entries_by_pinyin.tar.gz.${TIMESTAMP}
cp $(PVERBTAR) .
rm -f ${PVERBDIR}/* ${PGRPDIR}/*
entries_by_strokes.tar.gz : $(PVERBTAR)
cp entries_by_strokes.tar.gz backup/entries_by_strokes.tar.gz.${TIMESTAMP}
cp $(SVERBTAR) .
rm -f ${SVERBDIR}/* ${SGRPDIR}/*
pinyin : pinyin.pdf
cp pinyin.pdf ${BKPDIR}/pinyin.pdf.${TIMESTAMP}
strokes: strokes.pdf
cp strokes.pdf $(BKPDIR)/strokes.pdf.$(TIMESTAMP)
$(INCDIR)/%.tex :
echo Already done...
$(PVERBDIR)/%.tex : entries_by_pinyin.tar.gz
tar xvzf entries_by_pinyin.tar.gz
$(SVERBDIR)/%.tex : entries_by_strokes.tar.gz
tar xvzf entries_by_strokes.tar.gz
$(PGRPDIR)/%.tex : $(PVERBDIR)/%.tex
$(PGENGRP) -r $(PVERBDIR) -w $(PGRPDIR)
$(SGRPDIR)/%.tex : $(SVERBDIR)/%.tex
$(SGENGRP) -r $(SVERBDIR) -w $(SGRPDIR)
pinyin.pdf : pinyin.tex $(INCDIR)/%.tex $(PGRPDIR)/%.tex
$(TEX) pinyin.tex
$(MKIDX) -z bihua pstroke
$(MKIDX) -z bushou pradical
$(TEX) pinyin.tex
$(TEX) pinyin.tex
echo -n "Verbetes: "
@grep begin $(PVERBDIR)/* | grep entries | wc -l
strokes.pdf : strokes.tex $(INCDIR)/%.tex $(SGRPDIR)/%.tex
$(TEX) strokes.tex
$(MKIDX) -z bushou sradical
$(TEX) strokes.tex
$(TEX) strokes.tex
echo -n "Verbetes: "
@grep begin $(SVERBDIR)/* | grep entries | wc -l
pinyin-booklet.pdf : pinyin.pdf
$(BOOK) pinyin.pdf
strokes-booklet.pdf : strokes.pdf
$(BOOK) strokes.pdf
dicionario_por_pinyin.pdf : pinyin.pdf
cp pinyin.pdf dicionario_por_pinyin.pdf
dicionario_por_tracos.pdf : strokes.pdf
cp strokes.pdf dicionario_por_tracos.pdf
dicionario_por_pinyin_livreto.pdf : pinyin-booklet.pdf
cp pinyin-booklet.pdf dicionario_por_pinyin_livreto.pdf
dicionario_por_tracos_livreto.pdf : strokes-booklet.pdf
cp strokes-booklet.pdf dicionario_por_tracos_livreto.pdf
deploy-pinyin : dicionario_por_pinyin.pdf dicionario_por_pinyin_livreto.pdf
cp dicionario_por_pinyin.pdf $(DSTSITE)
cp dicionario_por_pinyin_livreto.pdf $(DSTSITE)
cp dicionario_por_pinyin.pdf $(DSTREPO)
cp dicionario_por_pinyin_livreto.pdf $(DSTREPO)
deploy-strokes : dicionario_por_tracos.pdf dicionario_por_tracos_livreto.pdf
cp dicionario_por_tracos.pdf $(DSTSITE)
cp dicionario_por_tracos_livreto.pdf $(DSTSITE)
cp dicionario_por_tracos.pdf $(DSTREPO)
cp dicionario_por_tracos_livreto.pdf $(DSTREPO)
deploy : deploy-pinyin deploy-strokes
total:
@echo -n "***** Verbetes Pinyin: "
@grep begin $(PVERBDIR)/* | grep entries | wc -l
@echo -n "\***** Verbetes Tracos: "
@grep begin $(SVERBDIR)/* | grep entries | wc -l
clean :
rm -f $(ALLDIR)/*.tex
rm -f $(PVERBDIR)/*.tex $(PGRPDIR)/*.tex
rm -f $(SVERBDIR)/*.tex $(SGRPDIR)/*.tex
rm -f *.aux *.idx *.ilg *.ind *.log *.toc *.out