s/DUMP/DUMPVAL/.
[ttfautohint.git] / doc / Makefile.am
blobd44b7f7a99b7ecda29deb2cae48907d48770c159
1 # Makefile.am
3 # Copyright (C) 2011-2012 by Werner Lemberg.
5 # This file is part of the ttfautohint library, and may only be used,
6 # modified, and distributed under the terms given in `COPYING'.  By
7 # continuing to use, modify, or distribute this file you indicate that you
8 # have read `COPYING' and understand and accept it fully.
10 # The file `COPYING' mentioned in the previous paragraph is distributed
11 # with the ttfautohint library.
13 DOCSRC = ttfautohint-1.pandoc \
14          ttfautohint-2.pandoc \
15          ttfautohint-3.pandoc
17 DOCIMGSVG = img/blue-zones.svg \
18             img/glyph-terms.svg \
19             img/o-and-i.svg \
20             img/segment-edge.svg
22 DOCIMGPDF = img/blue-zones.pdf \
23             img/glyph-terms.pdf \
24             img/o-and-i.pdf \
25             img/segment-edge.pdf
27 DOCIMGPNG = img/ttfautohintGUI.png \
28             img/a-before-hinting.png \
29             img/a-after-hinting.png \
30             img/a-after-autohinting.png \
31             img/afii10108-11px-after-hinting.png \
32             img/afii10108-11px-before-hinting.png \
33             img/afii10108-12px-after-hinting.png \
34             img/afii10108-12px-before-hinting.png \
35             img/e-17px-x14.png \
36             img/e-17px-x17.png \
37             img/ff-g-26px.png \
38             img/ff-g-26px-wD.png
40 DOC = ttfautohint.html \
41       ttfautohint.pdf \
42       ttfautohint.txt \
43       $(DOCIMGPNG) \
44       $(DOCIMGSVG)
46 EXTRA_DIST = c2pandoc.sed \
47              handle-images.hs \
48              make-snapshot.sh \
49              strip-comments.sh \
50              ttfautohint-1.pandoc \
51              ttfautohint-2.pandoc \
52              ttfautohint-3.pandoc \
53              template.html \
54              template.tex \
55              ttfautohint.css
57 if WITH_DOC
58   nobase_dist_doc_DATA = $(DOC)
59 endif
62 ttfautohint-2.pandoc: $(top_srcdir)/lib/ttfautohint.h
63         $(SED) -f $(srcdir)/c2pandoc.sed < $< > $@
65 ttfautohint.txt: $(DOCSRC)
66         $(SHELL) $(srcdir)/strip-comments.sh $^ > $@
68 if WITH_DOC
70   # the pandoc image filter
71   handle-images: handle-images.hs
72           $(GHC) -dynamic --make $@
74   # suffix rules must always start in column 0
75 .svg.pdf:
76           $(INKSCAPE) --export-pdf=$@ $<
78   # build snapshot image of ttfautohintGUI:
79   # this needs X11 and ImageMagick's `import' tool
80   # (in the `make-snaphshot.sh' script)
81   img/ttfautohintGUI.png: $(top_srcdir)/frontend/maingui.cpp \
82                           $(top_srcdir)/configure.ac
83           cd $(top_builddir)/frontend \
84             && $(MAKE) $(AM_MAKEFLAGS) ttfautohintGUI$(EXEEXT)
85           -mkdir img 2> /dev/null
86           $(SHELL) $(srcdir)/make-snapshot.sh \
87                      $(top_builddir)/frontend/ttfautohintGUI$(EXEEXT) $@
89   ttfautohint.html: ttfautohint.txt $(DOCIMGPNG) $(DOCIMGSVG) handle-images \
90                     ttfautohint.css template.html $(top_srcdir)/.version
91           $(PANDOC) --to=json \
92                     --smart \
93                     $< \
94           | ./handle-images ".svg" \
95           | $(PANDOC) --from=json \
96                       --template=$(srcdir)/template.html \
97                       --variable="version:$(VERSION)" \
98                       --toc \
99                       --include-in-header=$(srcdir)/ttfautohint.css \
100                       --standalone \
101                       --output=$@
103   ttfautohint.pdf: ttfautohint.txt $(DOCIMGPNG) $(DOCIMGPDF) handle-images \
104                    template.tex $(top_srcdir)/.version
105           $(PANDOC) --to=json \
106                     --smart \
107                     $< \
108           | ./handle-images ".pdf" \
109           | TEXINPUTS="$(srcdir);" \
110             $(PANDOC) --from=json \
111                       --latex-engine=$(PDFLATEX) \
112                       --template=$(srcdir)/template.tex \
113                       --variable="version:$(VERSION)" \
114                       --number-sections \
115                       --toc \
116                       --chapters \
117                       --standalone \
118                       --output=$@
119 else
120 .svg.pdf:
121           @echo 1>&2 "warning: can't generate \`$@'"
122           @echo 1>&2 "         please install inkscape and reconfigure"
124   img/ttfautohintGUI.png: $(top_srcdir)/frontend/maingui.cpp \
125                           $(top_srcdir)/configure.ac
126           @echo 1>&2 "warning: can't generate \`$@'"
127           @echo 1>&2 "         please install ImageMagick's \`import' tool and reconfigure"
129   ttfautohint.html: ttfautohint.txt $(DOCIMGPNG) $(DOCIMGSVG) \
130                     ttfautohint.css template.html $(top_srcdir)/.version
131           @echo 1>&2 "warning: can't generate \`$@'"
132           @echo 1>&2 "         pleasae install pandoc and reconfigure"
134   ttfautohint.pdf: $ttfautohint.txt $(DOCIMGPNG) $(DOCIMGPDF) \
135                    template.tex $(top_srcdir)/.version
136           @echo 1>&2 "warning: can't generate \`$@'"
137           @echo 1>&2 "         please install pdftex and pandoc, then reconfigure"
138 endif
140 # end of Makefile.am