Thinko.
[ttfautohint.git] / doc / Makefile.am
blob7afb3bb64026ff1f06dea41292d7d5c23aab96b8
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) \
45       $(DOCIMGPDF)
47 EXTRA_DIST = c2pandoc.sed \
48              handle-images.hs \
49              make-snapshot.sh \
50              strip-comments.sh \
51              ttfautohint-1.pandoc \
52              ttfautohint-2.pandoc \
53              ttfautohint-3.pandoc \
54              template.html \
55              template.tex \
56              ttfautohint.css
58 if WITH_DOC
59   nobase_dist_doc_DATA = $(DOC)
60 endif
63 ttfautohint-2.pandoc: $(top_srcdir)/lib/ttfautohint.h
64         $(SED) -f $(srcdir)/c2pandoc.sed < $< > $@
66 ttfautohint.txt: $(DOCSRC)
67         $(SHELL) $(srcdir)/strip-comments.sh $^ > $@
69 if WITH_DOC
71   # the pandoc image filter
72   handle-images: handle-images.hs
73           $(GHC) -dynamic --make $@
75   # suffix rules must always start in column 0
76 .svg.pdf:
77           $(INKSCAPE) --export-pdf=$@ $<
79   # build snapshot image of ttfautohintGUI:
80   # this needs X11 and ImageMagick's `import' tool
81   # (in the `make-snaphshot.sh' script)
82   img/ttfautohintGUI.png: $(top_srcdir)/frontend/maingui.cpp \
83                           $(top_srcdir)/configure.ac
84           cd $(top_builddir)/frontend \
85             && $(MAKE) $(AM_MAKEFLAGS) ttfautohintGUI$(EXEEXT)
86           -mkdir img 2> /dev/null
87           $(SHELL) $(srcdir)/make-snapshot.sh \
88                      $(top_builddir)/frontend/ttfautohintGUI$(EXEEXT) $@
90   ttfautohint.html: ttfautohint.txt $(DOCIMGPNG) $(DOCIMGSVG) handle-images \
91                     ttfautohint.css template.html $(top_srcdir)/.version
92           $(PANDOC) --to=json \
93                     --smart \
94                     $< \
95           | ./handle-images ".svg" \
96           | $(PANDOC) --from=json \
97                       --template=$(srcdir)/template.html \
98                       --variable="version:$(VERSION)" \
99                       --toc \
100                       --include-in-header=$(srcdir)/ttfautohint.css \
101                       --standalone \
102                       --output=$@
104   ttfautohint.pdf: ttfautohint.txt $(DOCIMGPNG) $(DOCIMGPDF) handle-images \
105                    template.tex $(top_srcdir)/.version
106           $(PANDOC) --to=json \
107                     --smart \
108                     $< \
109           | ./handle-images ".pdf" \
110           | TEXINPUTS="$(srcdir);" \
111             $(PANDOC) --from=json \
112                       --latex-engine=$(PDFLATEX) \
113                       --template=$(srcdir)/template.tex \
114                       --variable="version:$(VERSION)" \
115                       --number-sections \
116                       --toc \
117                       --chapters \
118                       --standalone \
119                       --output=$@
120 else
121 .svg.pdf:
122           @echo 1>&2 "warning: can't generate \`$@'"
123           @echo 1>&2 "         please install inkscape and reconfigure"
125   img/ttfautohintGUI.png: $(top_srcdir)/frontend/maingui.cpp \
126                           $(top_srcdir)/configure.ac
127           @echo 1>&2 "warning: can't generate \`$@'"
128           @echo 1>&2 "         please install ImageMagick's \`import' tool and reconfigure"
130   ttfautohint.html: ttfautohint.txt $(DOCIMGPNG) $(DOCIMGSVG) \
131                     ttfautohint.css template.html $(top_srcdir)/.version
132           @echo 1>&2 "warning: can't generate \`$@'"
133           @echo 1>&2 "         pleasae install pandoc and reconfigure"
135   ttfautohint.pdf: $ttfautohint.txt $(DOCIMGPNG) $(DOCIMGPDF) \
136                    template.tex $(top_srcdir)/.version
137           @echo 1>&2 "warning: can't generate \`$@'"
138           @echo 1>&2 "         please install pdftex and pandoc, then reconfigure"
139 endif
141 # end of Makefile.am