Adding newline at end of file.
[shapes.git] / doc / build / Makefile.common
blob462ec1ce445270a52743319e18dab827450387ce
1 # This file is part of Shapes.
3 # Shapes is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # any later version.
8 # Shapes is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with Shapes.  If not, see <http://www.gnu.org/licenses/>.
16 # Copyright 2008 Gustaf Hendeby
18 %.pdf %.stdout: %.shape $(SHEXT_FILES)
19         test -d  $(@D) || ${mkdir_p} $(@D)
20         $(SHAPES) $(SHAPESFLAGS) --in $< --out $*.pdf > $*.stdout
22 %_3.pdf %.stdout: %.shape $(SHEXT_FILES)
23         test -d  $(@D) || ${mkdir_p} $(@D)
24         $(SHAPES) $(SHAPESFLAGS) -vs1.3 --in $< --out $*_3.pdf > $*.stdout
26 # Some stupid versions of convert exit with a non-zero value even though the conversion was a success...
27 %_70%.jpg: %.pdf
28         -convert -antialias -density 100 -resize $(shell echo $@ | ${SED} -e 's!.*_\([^._]*\).jpg!\1!') $< $@
30 %_y_big.jpg: %.pdf
31         -convert -antialias -density `echo 150 \* 150 / $$(identify $< | sed -e 's!.* PDF \([^x]*\)x\([^ ]*\).*!\2!') | bc` -resize x150 $< $@
33 %_y_small.jpg: %.pdf
34         -convert -antialias -density `echo 50 \* 150 / $$(identify $< | sed -e 's!.* PDF \([^x]*\)x\([^ ]*\).*!\2!') | bc` -resize x50 $< $@
36 %_x_big.jpg: %.pdf
37         -convert -antialias -density `echo 150 \* 150 / $$(identify $< | sed -e 's!.* PDF \([^x]*\)x\([^ ]*\).*!\1!') | bc` -resize 150x $< $@
39 %_x_small.jpg: %.pdf
40         -convert -antialias -density `echo 50 \* 150 / $$(identify $< | sed -e 's!.* PDF \([^x]*\)x\([^ ]*\).*!\1!') | bc` -resize 50x $< $@
42 %.xml : ${partsdir}/%/index.sxml ${formatsdir}/html.xsl ${DEPDIR}/%.ssidep
43         if ${SSI} --in $< ${SSIFLAGS} > $*.Txml; \
44         then \
45                 mv $*.Txml $@; \
46         else \
47                 ${RM} $*.Txml; \
48                 exit 1; \
49         fi
51 ${DEPDIR}/%.ssidep : ${partsdir}/%/index.sxml Makefile
52         test -d  $(@D) || ${mkdir_p} ${@D}
53         if $(SSI) --in $< $(SSIFLAGS) --head $*.xml --deps > \
54           ${DEPDIR}/$*.Tssidep; \
55         then \
56                 ${SED} -e 's!^.*:!nobase_dist_noinst_DATA += $< !' \
57                   ${DEPDIR}/$*.Tssidep > ${DEPDIR}/$*.dist ; \
58           ${SED} -e 's!^!$@ !' ${DEPDIR}/$*.Tssidep > $@ ; \
59                 mv ${DEPDIR}/$*.Tssidep $@; \
60         else \
61                 ${RM} ${DEPDIR}/$*.Tssidep; \
62                 exit 1; \
63         fi
65 if HAVE_SAXON
66 %.html : %.xml ${partsdir}/%/formats/html.xsl ${formatsdir}/html.xsl
67         test -d  ${@D} || ${mkdir_p} ${@D} ; \
68         ( $(SAXON) $< $$( test -f ${partsdir}/$*/formats/html.xsl || \
69           echo '${srcdir}'/ )${partsdir}/$*/formats/html.xsl || exit 1 ) | \
70           ${POSTPROC_HTML} > $*.html
71         if $(SAXON) $@ $$( test -f ${toolsdir}/xhtml-deps/filter.xsl || \
72           echo '${srcdir}'/)${toolsdir}/xhtml-deps/filter.xsl  > \
73           ${DEPDIR}/$*.Thtmldep ; \
74         then \
75                 echo "${htmldepvar} += $$( tr ' ' '\n' < ${DEPDIR}/$*.Thtmldep | sort -u | tr '\n' ' ' )" > ${DEPDIR}/$*.htmldep ; \
76                 ${RM} ${DEPDIR}/$*.Thtmldep ; \
77         else \
78                 ${RM} ${DEPDIR}/$*.Thtmldep ; \
79                 exit 1; \
80         fi
81 endif