1 # Makefile for generating the SWIG documentation
3 # Note that the htmldoc package needs to be installed, but requires patching (using the
4 # margin-left.patch file from this directory) in order to correctly generate the pdf docs.
5 # The .html files are first processed and updated with chapter numbering and anchor names
6 # are added to the HTML headings using the python scripts. The htmldoc program is then
7 # used to generate the PDF document and single page HTML version of the documentation.
8 # HTML TIDY (package also known as tidy) is also required and is used as an aid to HTML
11 # Additional html validation can be done using the validate target.
14 # Note the # and " are escaped
15 HTMLDOC_OPTIONS = "--book --toclevels 4 --no-numbered --toctitle \"Table of Contents\" --title --titleimage swig16.png --linkcolor \#0000ff --linkstyle underline --size Universal --left 0.50in --right 0.50in --top 0.50in --bottom 0.50in --header .t. --footer h.1 --nup 1 --tocheader .t. --tocfooter ..i --portrait --color --no-pscommands --no-xrxcomments --compression=1 --jpeg=0 --fontsize 10.0 --fontspacing 1.2 --headingfont Helvetica --bodyfont Times --headfootsize 10.0 --headfootfont Helvetica --charset iso-8859-1 --links --no-embedfonts --pagemode outline --pagelayout single --firstpage c1 --pageeffect none --pageduration 10 --effectduration 1.0 --no-encryption --permissions all --owner-password \"\" --user-password \"\" --browserwidth 680"
17 .PHONY: maketoc check generate all clean validate test
19 all: maketoc check generate
24 CCache.html: ../../CCache/ccache.yo
25 yodl2html -o CCache.html ../../CCache/ccache.yo
27 # Use htmltidy to warn about some HTML errors. Note that it is not used to clean/tidy the HTML,
28 # it is just used as a primitive HTML checker.
29 # CCache.html is generated by yodl2html and has a few insignificant problems, so we don't put it through tidy
31 tidy -errors --gnu-emacs yes -quiet index.html
32 tidy -errors --gnu-emacs yes -quiet Sections.html
33 all=`sed '/^#/d' chapters | grep -v CCache.html`; for a in $$all; do tidy -errors --gnu-emacs yes -quiet $$a; done;
35 generate: swightml.book swigpdf.book
36 htmldoc --batch swightml.book || true
37 htmldoc --batch swigpdf.book || true
38 python fixstyle.py SWIGDocumentation.html
41 echo "#HTMLDOC 1.8.24" > swigpdf.book
42 echo -t pdf13 -f SWIGDocumentation.pdf $(HTMLDOC_OPTIONS) --stylesheet style.css >> swigpdf.book
43 echo "Sections.html" >> swigpdf.book
44 cat chapters >> swigpdf.book
47 echo "#HTMLDOC 1.8.24" > swightml.book
48 echo -t html -f SWIGDocumentation.html $(HTMLDOC_OPTIONS) >> swightml.book
49 echo "Sections.html" >> swightml.book
50 cat chapters >> swightml.book
56 rm -f SWIGDocumentation.html
57 rm -f SWIGDocumentation.pdf
63 grep "href=\".*\.html\"" index.html
64 grep "href=\".*\.html\"" Sections.html
65 all=`sed '/^#/d' chapters`; for a in $$all; do grep -l "href=\".*\.html\"" $$a; done;
67 # Validating using the WDG offline validator - http://www.htmlhelp.com/tools/validator/offline/
69 all=`sed '/^#/d' chapters`; for a in $$all; do validate --emacs $$a; done;