import source from 1.3.40
[external/swig.git] / Doc / Manual / Makefile
1 # Makefile for generating the SWIG documentation
2 #
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
9 # validation.
10 #
11 # Additional html validation can be done using the validate target.
12 #
13
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"
16
17 .PHONY: maketoc check generate all clean validate test
18
19 all: maketoc check generate
20
21 maketoc: CCache.html
22         python maketoc.py
23
24 CCache.html: ../../CCache/ccache.yo
25         yodl2html -o CCache.html ../../CCache/ccache.yo
26
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
30 check:
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;
34
35 generate: swightml.book swigpdf.book
36         htmldoc --batch swightml.book || true
37         htmldoc --batch swigpdf.book || true
38         python fixstyle.py SWIGDocumentation.html
39
40 swigpdf.book:
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
45
46 swightml.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
51
52 clean: clean-baks
53         rm -f swightml.book
54         rm -f swigpdf.book
55         rm -f CCache.html
56         rm -f SWIGDocumentation.html
57         rm -f SWIGDocumentation.pdf
58
59 clean-baks:
60         rm -f *.bak
61
62 test:
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;
66
67 # Validating using the WDG offline validator - http://www.htmlhelp.com/tools/validator/offline/
68 validate:
69           all=`sed '/^#/d' chapters`; for a in $$all; do validate --emacs $$a; done;
70