-
Notifications
You must be signed in to change notification settings - Fork 50
/
Makefile
40 lines (32 loc) · 1.02 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
DOC=ErlangHandbook
DOC_RU=ErlangHandbook-RU
REV=`git log -n1 | grep 'Date:' | sed 's/Date: //g'`
.PHONY: all
all: english
.PHONY: english
english: output/$(DOC).pdf
.PHONY: russian
russian: output/$(DOC_RU).pdf
.PHONY: release
release: clean all
git add output/$(DOC).pdf output/$(DOC_RU).pdf
git commit -m "release: $(REV)"
git push
.PHONY: clean
clean:
rm -f *.pdf *.dvi *.aux *.log *.nav *.out *.snm *.toc *.vrb *.bbl *.blg \
*.lof *.lot *.ilg *.ind *.nlo *.nls *.tdo *.gz *.depend
.PHONY: view
view:
evince $(DOC).pdf &
XELATEX=xelatex -synctex=1 -interaction=nonstopmode --shell-escape
output/$(DOC_RU).pdf: chapters-RU/*.tex $(DOC_RU).tex
$(XELATEX) $(DOC_RU).tex && \
$(XELATEX) $(DOC_RU).tex; \
mv -f $(DOC_RU).pdf output/
PDFLATEX=pdflatex -synctex=1 -interaction=nonstopmode --shell-escape
output/$(DOC).pdf: chapters/*.tex $(DOC).tex
$(PDFLATEX) $(DOC).tex && \
$(PDFLATEX) $(DOC).tex; \
mv -f $(DOC).pdf output/
# NOTE the ; after pdflatex call, sometimes pdflatex ends with error but still produces the document