1 # This is the prototype Makefile for all of GiNaC's documentation. It tries to
2 # be tolerant---if some tools were not found it skips the built of that part
3 # of documentation and tries to continue.
5 # Substitution variables from configure skript:
6 # Here come the usual install directories in GNU-configure fashion:
8 docdir = @datadir@/doc/GiNaC
10 # Dimitri van Heesch's Doxygen is needed for developer's resource:
12 # LaTeX and friends are needed for processing developer's resource for print:
14 MAKEINDEX = @MAKEINDEX@
17 # Jade and friends needed for generating the tutorial:
20 # Arguments for Jade and friends (does anybody know how to find them out?)
21 # JADEARGS_TEX = -t tex -o tutorial.tex -d /usr/lib/dsssl/stylesheets/docbook/print/docbook.dsl
22 JADEARGS_TEX = -t tex -o tutorial.tex -d /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/print/docbook.dsl
23 # JADEARGS_HTML = -t sgml -d /usr/lib/dsssl/stylesheets/docbook/html/docbook.dsl
24 JADEARGS_HTML = -t sgml -d /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/html/docbook.dsl
25 # Autoconf macro AC_PROC_INSTALL sets these:
27 INSTALL_DATA = @INSTALL_DATA@
28 # All LaTeX builds will take place in a separate subdirectory:
29 VPATH = @srcdir@:@srcdir@/latex:@srcdir@/tutorial
32 all: reference tutorial
35 # This section produces HTML'ed and TeX'ed developer's reference from the
36 # sources with a JavaDoc-like tool (in this case doxygen):
38 @ if [ ! -d ${srcdir}/reference ]; then mkdir ${srcdir}/reference; fi
39 @ if [ "${DOXYGEN}" ]; then \
40 echo "Running ${DOXYGEN} ./DoxyfileHTML..."; \
41 cd ..; ${DOXYGEN} ./doc/DoxyfileHTML; \
43 echo "warning: target reference_html disabled by configuration"; \
47 @ if [ ! -d ${srcdir}/latex ]; then mkdir ${srcdir}/latex; fi
48 @ if [ "${DOXYGEN}" ]; then \
49 echo "Running ${DOXYGEN} ./DoxyfileTEX..."; \
50 cd ..; ${DOXYGEN} ./doc/DoxyfileTEX; \
52 echo "warning: target reference.tex disabled by configuration"; \
54 - mv ${srcdir}/latex/refman.tex ${srcdir}/latex/reference.tex
56 reference.dvi: reference.tex
57 @ if [ "${LATEX}" -a "${MAKEINDEX}" ]; then \
59 ${LATEX} reference.tex && \
60 ${MAKEINDEX} reference.idx && \
61 ${LATEX} reference.tex; \
63 echo "warning: target reference.dvi disabled by configuration"; \
66 reference.ps: reference.dvi
67 @ if [ "${DVIPS}" ]; then \
68 echo "Running ${DVIPS} -o reference.ps reference.dvi..."; \
69 cd latex; ${DVIPS} -o reference.ps reference.dvi; \
71 echo "warning: target reference.ps disabled by configuration"; \
74 reference: reference_html reference.ps
77 # This section produces HTML'ed and TeX'ed versions of the tutorial using a
78 # SGML to TeX converter (in this case jade). As a dirty hack, we are doing
79 # some regexpese to tutorial.sgml prior to parsing it, in order to allow for
80 # different graphics output. This seems to be an ugly limitation of docbook...
82 EPS = classhierarchy.eps rep_naive.eps rep_pair.eps
83 PNG = classhierarchy.png rep_naive.png rep_pair.png
85 tutorial/index.html: tutorial.sgml.in ${PNG}
86 @ if [ ! -d ${srcdir}/latex ]; then mkdir ${srcdir}/latex; fi
87 @ if [ "${JADE}" ]; then \
88 sed -e 's/graext/png/g' -e 's/GRAEXT/GIF/g' tutorial.sgml.in > tutorial.sgml; \
89 echo "Running ${JADE} ${JADEARGS_HTML} tutorial.sgml..."; \
90 cd tutorial/; ${JADE} ${JADEARGS_HTML} ../tutorial.sgml; \
91 if [ -f book1.html ]; then cp book1.html index.html; fi; \
93 echo "warning: target tutorial_html disabled by configuration"; \
96 tutorial.tex: tutorial.sgml.in ${EPS}
97 @ if [ ! -d ${srcdir}/latex ]; then mkdir ${srcdir}/latex; fi
98 @ if [ "${JADE}" -a "${LATEX}" ]; then \
99 sed -e 's/graext/eps/g' -e 's/GRAEXT/EPS/g' tutorial.sgml.in > tutorial.sgml; \
100 echo "Running ${JADE} ${JADEARGS_TEX} tutorial.sgml..."; \
101 cd latex; ${JADE} ${JADEARGS_TEX} ../tutorial.sgml ; \
103 echo "warning: target tutorial.tex disabled by configuration"; \
106 tutorial.dvi: tutorial.tex
107 @ if [ "${JADETEX}" ]; then \
108 echo "Running ${JADETEX} tutorial.tex..."; \
109 cd latex; ${JADETEX} tutorial.tex && ${JADETEX} tutorial.tex && ${JADETEX} tutorial.tex; \
111 echo "warning: target tutorial.dvi disabled by configuration"; \
114 tutorial.ps: tutorial.dvi
115 @ if [ "${DVIPS}" ]; then \
116 echo "Running ${DVIPS} tutorial.dvi -o tutorial.ps..."; \
117 cd latex; ${DVIPS} tutorial.dvi -o tutorial.ps; \
119 echo "warning: target tutorial.ps disabled by configuration"; \
122 tutorial: tutorial/index.html tutorial.ps
124 # Target for installing all generated documentation files on the system.
125 # (Foolproof: installs what we got, even if one or more targets failed.)
127 - ${INSTALL} -d ${docdir}/reference/
128 - ${INSTALL_DATA} ${srcdir}/reference/* ${docdir}/reference/
129 - ${INSTALL_DATA} ${srcdir}/latex/reference.ps ${docdir}/
130 - ${INSTALL} -d ${docdir}/tutorial/
131 - ${INSTALL_DATA} ${srcdir}/tutorial/* ${docdir}/tutorial/
132 - ${INSTALL_DATA} ${srcdir}/latex/tutorial.ps ${docdir}/
134 # Removes all installed documentation files from the system:
138 # The next targets should only be called in case of emergency by developers,
139 # since the complete documentation is not normally rebuilt. In any case, they
140 # should only be called from people who know what they are doing and never
141 # from top-level Makefile's targets clean and distclean.
143 rm -rf ${srcdir}/tutorial ${srcdir}/reference ${srcdir}/latex
149 # Special dummy targets:
150 .SUFFIXES: .fig .eps .png
151 .PHONY: all clean distclean reference tutorial
152 .SILENT: all reference tutorial_html tutorial_tex
156 @ if [ ! -d ${srcdir}/latex ]; then mkdir ${srcdir}/latex; fi
157 if [ "${FIG2DEV}" ]; then \
158 ${FIG2DEV} -L ps -m 0.8 $< ${srcdir}/latex/$@; \
160 echo "warning: fig2dev was not found by configure"; \
163 @ if [ ! -d ${srcdir}/tutorial ]; then mkdir ${srcdir}/tutorial; fi
164 if [ "${FIG2DEV}" ]; then \
165 ${FIG2DEV} -L png $< ${srcdir}/tutorial/$@; \
167 echo "warning: fig2dev was not found by configure"; \