very first steps for a "new" developer's guide
[metze/wireshark/wip.git] / docbook / Makefile
1 #
2 # Make the "Ethereal User's Guide" in several formats.
3 # See the Readme.txt file for instructions.
4 #
5 # $Id$
6 #
7
8 # if you need to change this, don't forget to change it in catalog.xml too
9
10 # On suse 9.1, uncomment the following line:
11 #DOCBOOKXSL="/usr/share/xml/docbook/stylesheet/nwalsh/1.64.1"
12
13 DOCBOOKXSL="/usr/share/docbook-xsl"
14
15 # formatting objects processor
16 # (comment this out, if you don't want pdf or don't have fop installed)
17 # for win32 (cygwin) environments
18 FOP="fop-0.20.5/fop.bat"
19 # for unix like environments (if you have problems with fop, try to use an absolute path here)
20 #FOP="/usr/share/fop-0.20.5/fop.sh"
21
22 # html help compiler (Win32 only)
23 # (comment this out, if you don't want chm or don't have hhc installed)
24 #HHC="/cygdrive/c/Program Files/HTML Help Workshop/hhc.exe"
25
26 ############### YOU SHOULDN'T HAVE TO EDIT ANYTHING BELOW THIS LINE! ################
27
28 # the XSL processor
29 XSLTPROC="xsltproc"
30
31 # the XML validator (from the xsltproc package)
32 XMLLINT="xmllint"
33
34 # as eug_chm will stop with an error, make sure it's the last in this dependency list
35 all: eug edg 
36
37 eug: eug_validate eug_pdf_a4 eug_html eug_html_chunked eug_chm 
38
39 clean:
40         rm -f *.html
41         rm -f htmlhelp.*
42         rm -f *.hhc
43         rm -f *.fo
44         rm -f *.pdf
45         rm -f *.chm
46         rm -rf eug_html
47         rm -rf eug_html_chunked
48         rm -rf toc.hhc htmlhelp.hhp eug_chm
49
50
51 images:
52         cp $(DOCBOOKXSL)/images/note.png ./graphics
53         cp $(DOCBOOKXSL)/images/tip.png ./graphics
54         cp $(DOCBOOKXSL)/images/warning.png ./graphics
55
56 # validate the content
57 eug_validate:
58         @ echo --- VALIDATING XML ---
59         $(XMLLINT) --valid --noout user-guide.xml
60
61 # create html single page file
62 eug_html:
63         @ echo --- HTML SINGLE PAGE ---
64         mkdir -p eug_html
65         mkdir -p eug_html/graphics
66         mkdir -p eug_html/graphics/toolbar
67         cp ./graphics/*.* eug_html/graphics
68         cp ./graphics/toolbar/*.* eug_html/graphics/toolbar
69         $(XSLTPROC) --nonet $(DOCBOOKXSL)/html/docbook.xsl user-guide.xml > eug_html/user-guide.html
70         
71 # create html chunked page files
72 eug_html_chunked: images
73         @ echo --- HTML CHUNKED ---
74         mkdir -p eug_html_chunked
75         mkdir -p eug_html_chunked/graphics
76         mkdir -p eug_html_chunked/graphics/toolbar
77         cp ./graphics/*.* eug_html_chunked/graphics
78         cp ./graphics/toolbar/*.* eug_html_chunked/graphics/toolbar
79         $(XSLTPROC) --stringparam base.dir eug_html_chunked/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 --nonet $(DOCBOOKXSL)/html/chunk.xsl user-guide.xml
80
81 # create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
82 # you will get lot's of errors, but that's ok
83 eug_pdf_us: images
84 ifdef FOP
85         @ echo --- PDF US PAPER ---
86         $(XSLTPROC) --nonet custom_layer_pdf.xsl $(DOCBOOKXSL)/fo/docbook.xsl user-guide.xml > user-guide.fo
87         $(FOP) user-guide.fo user-guide.pdf
88 endif
89
90 # create pdf file (through XSL-FO), portrait pages on A4 paper
91 # you will get lot's of errors, but that's ok
92 eug_pdf_a4: images
93 ifdef FOP
94         @ echo --- PDF A4 PAPER ---
95         $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl user-guide.xml > user-guide.fo
96         $(FOP) user-guide.fo user-guide.pdf
97 endif
98
99 # create MS html help file (through html chunked pages)
100 eug_chm: images
101 ifdef HHC
102         @ echo --- MICROSOFT HTML HELP ---
103         mkdir -p eug_chm
104         mkdir -p eug_chm/graphics
105         mkdir -p eug_chm/graphics/toolbar
106         cp ./graphics/*.* eug_chm/graphics
107         cp ./graphics/toolbar/*.* eug_chm/graphics/toolbar
108         $(XSLTPROC) --stringparam base.dir eug_chm/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 --nonet $(DOCBOOKXSL)/htmlhelp/htmlhelp.xsl user-guide.xml
109         -$(HHC) htmlhelp.hhp
110         mv htmlhelp.chm user-guide.chm
111         rm -r htmlhelp.hhp
112         rm -r toc.hhc
113 endif
114
115
116 edg: edg_validate edg_html_chunked 
117 #eug_pdf_a4 eug_html eug_chm 
118
119 # validate the content
120 edg_validate:
121         @ echo --- VALIDATING XML ---
122         $(XMLLINT) --valid --noout developer-guide.xml
123
124 # create html chunked page files
125 edg_html_chunked: images
126         @ echo --- HTML CHUNKED ---
127         mkdir -p edg_html_chunked
128         mkdir -p edg_html_chunked/graphics
129         mkdir -p edg_html_chunked/graphics/toolbar
130         cp ./graphics/*.* edg_html_chunked/graphics
131         cp ./graphics/toolbar/*.* edg_html_chunked/graphics/toolbar
132         $(XSLTPROC) --stringparam base.dir edg_html_chunked/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 --nonet $(DOCBOOKXSL)/html/chunk.xsl developer-guide.xml
133