some more editing of the expert infos - still incomplete
[obnox/wireshark/wip.git] / docbook / Makefile.nmake
1 #
2 # Make the "Wireshark User Guide" and "Wireshark Developer Guide"
3 # in several formats.
4 # See the Readme.txt file for instructions.
5 #
6 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
7 #
8 # $Id$
9 #
10
11 ############### YOU SHOULDN'T HAVE TO EDIT ANYTHING BELOW THIS LINE! ################
12
13 include ..\config.nmake
14 include Makefile.common
15
16 # Automatically generate .pdf files from .fo files
17 .fo.pdf:
18         $(FOP) $< $@
19
20
21 all: svn_version_check wsug.validated wsdg.validated release_notes.validated wsug wsdg release_notes
22
23 clean:
24         rm -rf $(CLEANFILES)
25
26 .SUFFIXES: .fo .pdf
27
28 #
29 # on every build, record the working copy revision string
30 #
31 # FORCE is the portable version of .PHONY
32 FORCE:
33
34 svn_version_check: FORCE
35         @ $(SH) ./check_svn_version.sh
36
37 svn_version.xml: svn_version_check
38
39
40 wsug: wsug_html_chunked user-guide.html user-guide-a4.pdf user-guide-us.pdf user-guide.chm user-guide.zip
41
42 # validate the content
43 wsug.validated: $(WSUG_SOURCE)
44         @ echo --- WSUG - VALIDATING XML ---
45         $(XMLLINT) --valid --noout user-guide.xml
46         touch $@
47
48 # create html single page file
49 user-guide.html: wsug_html/user-guide.html
50
51 wsug_html/user-guide.html: $(WSUG_SOURCE)
52         @ echo --- WSUG - HTML SINGLE PAGE ---
53         if not exist wsug_html\wsug_graphics\toolbar md wsug_html\wsug_graphics\toolbar
54         cp wsug_graphics/*.* wsug_html/wsug_graphics
55         cp wsug_graphics/toolbar/* wsug_html/wsug_graphics/toolbar
56         cp ws.css wsug_html
57         $(XSLTPROC) --stringparam base.dir wsug_html/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path wsug_graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 --stringparam html.stylesheet ws.css --nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl user-guide.xml > $@
58         -chmod -R og+rX wsug_html
59
60 # create html chunked page files
61 wsug_html_chunked: wsug_html_chunked\index.html
62
63 wsug_html_chunked\index.html: $(WSUG_SOURCE)
64         @ echo --- WSUG - HTML CHUNKED ---
65         if not exist wsug_html_chunked\wsug_graphics\toolbar md wsug_html_chunked\wsug_graphics\toolbar
66         cp wsug_graphics/*.* wsug_html_chunked/wsug_graphics
67         cp wsug_graphics/toolbar/* wsug_html_chunked/wsug_graphics/toolbar
68         cp ws.css wsug_html_chunked
69         $(XSLTPROC) --stringparam base.dir wsug_html_chunked/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path wsug_graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 --stringparam html.stylesheet ws.css --nonet http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl user-guide.xml
70         -chmod -R og+rX wsug_html_chunked
71
72 # create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
73 # you will get lot's of errors, but that's ok
74 user-guide-us.fo: $(WSUG_SOURCE) custom_layer_pdf.xsl
75 !ifdef FOP
76         @ echo --- WSUG - PDF US PAPER ---
77         $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl user-guide.xml > $@
78 !endif
79
80 # create pdf file (through XSL-FO), portrait pages on A4 paper
81 # you will get lot's of errors, but that's ok
82 user-guide-a4.fo: $(WSUG_SOURCE) custom_layer_pdf.xsl
83 !ifdef FOP
84         @ echo --- WSUG - PDF A4 PAPER ---
85         $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl user-guide.xml > $@
86 !endif
87
88 # create MS html help file (through html chunked pages)
89 user-guide.chm: $(WSUG_SOURCE)
90 !ifdef HHC_EXE
91         @ echo --- WSUG - MICROSOFT HTML HELP ---
92         if not exist wsug_chm\wsug_graphics\toolbar md wsug_chm\wsug_graphics\toolbar
93         -cp wsug_graphics/*.* wsug_chm/wsug_graphics/
94         -cp wsug_graphics/toolbar/* wsug_chm/wsug_graphics/toolbar/
95         $(XSLTPROC) --stringparam base.dir wsug_chm/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path wsug_graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1  --stringparam html.stylesheet ws.css --nonet http://docbook.sourceforge.net/release/xsl/current/htmlhelp/htmlhelp.xsl user-guide.xml 
96         -$(HHC_EXE) htmlhelp.hhp
97         -mv htmlhelp.chm $@
98         -rm -r htmlhelp.hhp
99         -rm -r toc.hhc
100
101 user-guide.zip: user-guide.chm
102         rm -f user-guide.zip
103         zip user-guide.zip user-guide.chm
104 !else
105 user-guide.zip:
106 !endif
107
108 wsdg: wsdg_html_chunked developer-guide.html developer-guide-a4.pdf developer-guide-us.pdf developer-guide.chm
109
110 # validate the content
111 wsdg.validated: $(WSDG_SOURCE)
112         @ echo --- WSDG - VALIDATING XML ---
113         $(XMLLINT) --valid --noout developer-guide.xml
114         touch $@
115
116 # create html single page file
117 developer-guide.html: wsdg_html/developer-guide.html
118
119 wsdg_html/developer-guide.html: $(WSDG_SOURCE)
120         @ echo --- WSDG - HTML SINGLE PAGE ---
121         if not exist wsdg_html\wsdg_graphics md wsdg_html\wsdg_graphics
122         cp wsdg_graphics/* wsdg_html/wsdg_graphics
123         cp ws.css wsdg_html
124         $(XSLTPROC) --stringparam base.dir wsdg_html/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path wsdg_graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 --stringparam html.stylesheet ws.css --nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl developer-guide.xml > $@
125         -chmod -R og+rX wsdg_html
126
127 # create html chunked page files
128 wsdg_html_chunked: wsdg_html_chunked/index.html
129
130 wsdg_html_chunked/index.html: $(WSDG_SOURCE)
131         @ echo --- WSDG - HTML CHUNKED ---
132         if not exist wsdg_html_chunked\wsdg_graphics md wsdg_html_chunked\wsdg_graphics
133         cp wsdg_graphics/* wsdg_html_chunked/wsdg_graphics
134         cp ws.css wsdg_html_chunked
135         $(XSLTPROC) --stringparam base.dir wsdg_html_chunked/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path wsdg_graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 --stringparam html.stylesheet ws.css --nonet http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl developer-guide.xml
136         -chmod -R og+rX wsdg_html_chunked
137
138 # create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
139 # you will get lot's of errors, but that's ok
140 developer-guide-us.fo: $(WSDG_SOURCE) custom_layer_pdf.xsl
141 !ifdef FOP
142         @ echo --- WSDG - PDF US PAPER ---
143         $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl developer-guide.xml > $@
144 !endif
145
146 # create pdf file (through XSL-FO), portrait pages on A4 paper
147 # you will get lot's of errors, but that's ok
148 developer-guide-a4.fo: $(WSDG_SOURCE) custom_layer_pdf.xsl
149 !ifdef FOP
150         @ echo --- WSDG - PDF A4 PAPER ---
151         $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl developer-guide.xml > $@
152 !endif
153
154 # create MS html help file (through html chunked pages)
155 developer-guide.chm: $(WSDG_SOURCE)
156 !ifdef HHC_EXE
157         @ echo --- WSDG - MICROSOFT HTML HELP ---
158         if not exist wsdg_chm\wsdg_graphics md wsdg_chm\wsdg_graphics
159         cp wsdg_graphics/* wsdg_chm/wsdg_graphics
160         $(XSLTPROC) --stringparam base.dir wsdg_chm/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path wsdg_graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 --stringparam html.stylesheet ws.css --nonet http://docbook.sourceforge.net/release/xsl/current/htmlhelp/htmlhelp.xsl developer-guide.xml
161         -$(HHC_EXE) htmlhelp.hhp
162         -mv htmlhelp.chm $@
163         -rm -r htmlhelp.hhp
164         -rm -r toc.hhc
165 !endif
166
167
168 release_notes: release-notes.html release-notes.txt release-notes-a4.pdf release-notes-us.pdf release-notes.chm
169
170 # validate the content
171 release_notes.validated: $(RELEASE_NOTES_SOURCE)
172         @ echo --- RELEASE NOTES - VALIDATING XML ---
173         $(XMLLINT) --valid --noout release-notes.xml
174         touch $@
175
176 # create html single page file
177 release-notes.html: $(RELEASE_NOTES_SOURCE)
178         @ echo --- RELEASE NOTES - HTML ---
179         $(XSLTPROC) --nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl release-notes.xml > $@
180
181 # create txt single page file (through HTML)
182 release-notes.txt: $(RELEASE_NOTES_SOURCE)
183         @ echo --- RELEASE NOTES - TXT ---
184         $(XSLTPROC) --stringparam generate.toc "article nop" --nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl release-notes.xml | $(HTML2TXT) > $@
185
186 news: release-notes.txt
187         copy release-notes.txt ..\NEWS
188
189 # create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
190 # you will get lot's of errors, but that's ok
191 release-notes-us.fo: $(RELEASE_NOTES_SOURCE) custom_layer_pdf.xsl
192 !ifdef FOP
193         @ echo --- RELEASE NOTES - PDF US PAPER ---
194         $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl release-notes.xml > $@
195 !endif
196
197 # create pdf file (through XSL-FO), portrait pages on A4 paper
198 # you will get lot's of errors, but that's ok
199 release-notes-a4.fo: $(RELEASE_NOTES_SOURCE) custom_layer_pdf.xsl
200 !ifdef FOP
201         @ echo --- RELEASE NOTES - PDF A4 PAPER ---
202         $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl release-notes.xml > $@
203 !endif
204
205 # create MS html help file (through html chunked pages)
206 release-notes.chm: $(RELEASE_NOTES_SOURCE)
207 !ifdef HHC_EXE
208         @ echo --- RELEASE NOTES - MICROSOFT HTML HELP ---
209         $(XSLTPROC) --stringparam base.dir release_notes_chm/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path wsug_graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 --nonet http://docbook.sourceforge.net/release/xsl/current/htmlhelp/htmlhelp.xsl release-notes.xml
210         -$(HHC_EXE) htmlhelp.hhp
211         -mv htmlhelp.chm $@
212         -rm -r htmlhelp.hhp
213         -rm -r toc.hhc
214 !endif
215
216
217 wsluarm: make-wsluarm.pl $(WSLUA_MODULES)
218         $(PERL) make-wsluarm.pl $(WSLUA_MODULES)
219         touch wsluarm
220
221