-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (52 loc) · 2.01 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
# -*- coding: utf-8-unix -*-
IMPORT_STYLE=/usr/share/xml/gnome/xslt/docbook/html/db2html.xsl
JAMAINFONT=IPA明朝
JASANSFONT=IPAゴシック
JAMONOFONT=IPAゴシック
# JAMAINFONT=IPA明朝
# JASANSFONT=VL ゴシック
# JAMONOFONT=VL ゴシック
# JAMAINFONT=IPA明朝
# JASANSFONT=IPAゴシック
# JAMONOFONT=VL ゴシック
# JAMAINFONT=ヒラギノ明朝 ProN W3
# JASANSFONT=ヒラギノ角ゴ ProN W3
# JAMONOFONT=ヒラギノ丸ゴ ProN W4
PAPERSIZE=b5paper
# PAPERSIZE=a4paper
html: gnomeja-guide.xml
gnome-doc-tool html $<
draft: draft.xsl gnomeja-guide.xml
xsltproc draft.xsl gnomeja-guide.xml
draft.xsl: draft.xsl.in
sed -e "s|@IMPORT_STYLE@|${IMPORT_STYLE}|" $< > $@
pdf: gnomeja-guide.tex
for x in 1 2 3; do \
xelatex -synctex=1 -file-line-error -interaction=nonstopmode $< < /dev/null || exit 1; \
grep 'Rerun to get cross-references right.' $(<:.tex=.log) || \
grep 'Package longtable Warning: Table widths have changed. Rerun LaTeX.' $(<:.tex=.log) || \
grep 'Package hyperref Warning: Rerun to get /PageLabels entry.' $(<:.tex=.log) || \
exit 0; \
done
gnomeja-guide.tex: gnomeja-guide.xml gnomeja-guide-param.xsl 88x31.png
dblatex -t tex -p gnomeja-guide-param.xsl gnomeja-guide.xml
sed -i -e "s,http://i.creativecommons.org/l/by-sa/2.1/jp/,,g" $@ || exit 1
for png in `find figures -name "*.png"`; do \
pdf=figures/`basename $${png} .png`.pdf; \
convert $${png} $${pdf}; \
sed -i -e "s|$${png}|$${pdf}|g" gnomeja-guide.tex; \
done
patch -p0 gnomeja-guide.tex < gnomeja-guide-tex-contents.patch
gnomeja-guide-param.xsl: gnomeja-guide-param.xsl.in
sed -e "s|@@JAMAINFONT@@|${JAMAINFONT}|" \
-e "s|@@JASANSFONT@@|${JASANSFONT}|" \
-e "s|@@JAMONOFONT@@|${JAMONOFONT}|" \
-e "s|@@PAPERSIZE@@|${PAPERSIZE}|" $< > $@
88x31.png:
wget http://i.creativecommons.org/l/by-sa/2.1/jp/88x31.png
clean:
rm -f *.html draft.xsl
rm -f 88x31.png
rm -f figures/*.pdf *~ gnomeja-guide-param.xsl
rm -f *.aux *.cb *.dvi *.glo *.idx *.lof *.log *.out *.toc *.synctex.gz
rm -f *.tex *.pdf