add WERR_INVALID_STATE
[wireshark-wip.git] / docbook / Makefile.nmake
blob2bcc015f05f9cbf12937c4777c20654c20bd00ed
2 # Make the "Wireshark User Guide" and "Wireshark Developer Guide"
3 # in several formats.
4 # See the Readme.txt file for instructions.
6 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake [target ...]
8 # $Id$
11 ############### YOU SHOULDN'T HAVE TO EDIT ANYTHING BELOW THIS LINE! ################
13 TOOLS_DIR=..\tools
14 include ..\config.nmake
15 include Makefile.common
17 WSUG_SOURCE          = $(WSUG_SOURCE)          Makefile.nmake
18 WSDG_SOURCE          = $(WSDG_SOURCE)          Makefile.nmake
19 RELEASE_NOTES_SOURCE = $(RELEASE_NOTES_SOURCE) Makefile.nmake
21 # Asciidoc converter
22 A2X_HTML_OPTS="--stylesheet=ws.css"
23 A2X_TEXT_OPTS=
25 !ifdef LYNX
26 A2X_TEXT_OPTS=$(A2X_TEXT_OPTS) --lynx
27 !endif
29 # Automatically generate .pdf files from .fo files
30 .fo.pdf:
31         $(FOP) $< $@
33 .SUFFIXES: .fo .pdf
35 # On every build, record the working copy revision string
36 #   in svn_version.xml (if the svn version has changed).
37 # This is done during nmake "preprocessing" so that it's done *before*
38 #  nmake gets the date/time of the dependency file(s)].
39 !IF [$(SH) ./check_svn_version.sh]
40 !ENDIF
43 # -- (Public) targets -------------------------------------------------------
45 # Make all (default)
46 all: all_x
48 # Make only the WSUG
49 wsug: wsug.validated wsug_x
51 # Make only the WSDG
52 wsdg: wsdg.validated wsdg_x
54 # Make only the release notes
55 release_notes: $(RELEASE_NOTES_SOURCE)
57 # Clean all
58 clean:
59         rm -rf $(CLEANFILES) $(CLEANDIRS)
61 distclean: clean
63 maintainer-clean: distclean
65 # -- All -------------------------------------------------------------------------------
67 all_x: wsug.validated wsdg.validated wsug_x wsdg_x release_notes_x
69 # -- User Guide ------------------------------------------------------------------------
71 wsug_x: wsug_html_chunked wsug_html user-guide-a4.pdf user-guide-us.pdf user-guide.chm
73 # validate the content
74 wsug.validated: $(WSUG_SOURCE) wsluarm
75         @ echo --- WSUG - VALIDATING XML ---
76         $(XMLLINT) --valid --noout user-guide.xml
77         touch $@
79 # create html single page file
80 wsug_html: wsug_html\index.html
82 wsug_html\index.html: $(WSUG_SOURCE) wsluarm
83         @ echo --- WSUG - HTML SINGLE PAGE ---
84         if not exist wsug_html\wsug_graphics\toolbar md wsug_html\wsug_graphics\toolbar
85         cp wsug_graphics/*.* wsug_html/wsug_graphics
86         cp wsug_graphics/toolbar/* wsug_html/wsug_graphics/toolbar
87         cp ws.css wsug_html
88         $(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 > $@
89         -chmod -R og+rX wsug_html
91 # create html chunked page files
92 wsug_html_chunked: wsug_html_chunked\index.html
94 wsug_html_chunked\index.html: $(WSUG_SOURCE) wsluarm
95         @ echo --- WSUG - HTML CHUNKED ---
96         if not exist wsug_html_chunked\wsug_graphics\toolbar md wsug_html_chunked\wsug_graphics\toolbar
97         cp wsug_graphics/*.* wsug_html_chunked/wsug_graphics
98         cp wsug_graphics/toolbar/* wsug_html_chunked/wsug_graphics/toolbar
99         cp ws.css wsug_html_chunked
100         $(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
101         -chmod -R og+rX wsug_html_chunked
103 # create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
104 # you will get lot's of errors, but that's ok
105 user-guide-us.fo: $(WSUG_SOURCE) custom_layer_pdf.xsl wsluarm
106 !ifdef FOP
107         @ echo --- WSUG - PDF US PAPER ---
108         $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl user-guide.xml > $@
109 !endif
111 # create pdf file (through XSL-FO), portrait pages on A4 paper
112 # you will get lot's of errors, but that's ok
113 user-guide-a4.fo: $(WSUG_SOURCE) custom_layer_pdf.xsl wsluarm
114 !ifdef FOP
115         @ echo --- WSUG - PDF A4 PAPER ---
116         $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl user-guide.xml > $@
117 !endif
119 # create MS html help file (through html chunked pages)
120 user-guide.chm: $(WSUG_SOURCE) wsluarm
121 !ifdef HHC_EXE
122         @ echo --- WSUG - MICROSOFT HTML HELP ---
123         if not exist wsug_chm\wsug_graphics\toolbar md wsug_chm\wsug_graphics\toolbar
124         -cp wsug_graphics/*.* wsug_chm/wsug_graphics/
125         -cp wsug_graphics/toolbar/* wsug_chm/wsug_graphics/toolbar/
126         $(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
127         -$(HHC_EXE) htmlhelp.hhp
128         -mv htmlhelp.chm $@
129         -rm -r htmlhelp.hhp
130         -rm -r toc.hhc
131 !endif
133 wsluarm: make-wsluarm.pl $(WSLUA_MODULES)
134         if not exist wsluarm_src md wsluarm_src
135         $(PERL) make-wsluarm.pl $(WSLUA_MODULES)
136         touch wsluarm
138 # -- Developer's Guide ------------------------------------------------------------------------
140 wsdg_x: wsdg_html_chunked wsdg_html developer-guide-a4.pdf developer-guide-us.pdf developer-guide.chm
142 # validate the content
143 wsdg.validated: $(WSDG_SOURCE)
144         @ echo --- WSDG - VALIDATING XML ---
145         $(XMLLINT) --valid --noout developer-guide.xml
146         touch $@
148 # create html single page file
149 wsdg_html: wsdg_html\index.html
151 wsdg_html\index.html: $(WSDG_SOURCE)
152         @ echo --- WSDG - HTML SINGLE PAGE ---
153         if not exist wsdg_html\wsdg_graphics md wsdg_html\wsdg_graphics
154         if not exist wsdg_html\wsdg_graphics\toolbar md wsdg_html\wsdg_graphics\toolbar
155         cp wsdg_graphics/*.* wsdg_html/wsdg_graphics/
156         cp wsdg_graphics/toolbar/* wsdg_html/wsdg_graphics/toolbar/
157         cp ws.css wsdg_html
158         $(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 > $@
159         -chmod -R og+rX wsdg_html
161 # create html chunked page files
162 wsdg_html_chunked: wsdg_html_chunked\index.html
164 wsdg_html_chunked\index.html: $(WSDG_SOURCE)
165         @ echo --- WSDG - HTML CHUNKED ---
166         if not exist wsdg_html_chunked\wsdg_graphics md wsdg_html_chunked\wsdg_graphics
167         if not exist wsdg_html_chunked\wsdg_graphics\toolbar md wsdg_html_chunked\wsdg_graphics\toolbar
168         cp wsdg_graphics/*.* wsdg_html_chunked/wsdg_graphics/
169         cp wsdg_graphics/toolbar/* wsdg_html_chunked/wsdg_graphics/toolbar/
170         cp ws.css wsdg_html_chunked
171         $(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
172         -chmod -R og+rX wsdg_html_chunked
174 # create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
175 # you will get lot's of errors, but that's ok
176 developer-guide-us.fo: $(WSDG_SOURCE) custom_layer_pdf.xsl
177 !ifdef FOP
178         @ echo --- WSDG - PDF US PAPER ---
179         $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl developer-guide.xml > $@
180 !endif
182 # create pdf file (through XSL-FO), portrait pages on A4 paper
183 # you will get lot's of errors, but that's ok
184 developer-guide-a4.fo: $(WSDG_SOURCE) custom_layer_pdf.xsl
185 !ifdef FOP
186         @ echo --- WSDG - PDF A4 PAPER ---
187         $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl developer-guide.xml > $@
188 !endif
190 # create MS html help file (through html chunked pages)
191 developer-guide.chm: $(WSDG_SOURCE)
192 !ifdef HHC_EXE
193         @ echo --- WSDG - MICROSOFT HTML HELP ---
194         if not exist wsdg_chm\wsdg_graphics md wsdg_chm\wsdg_graphics
195         if not exist wsdg_chm\wsdg_graphics\toolbar md wsdg_chm\wsdg_graphics\toolbar
196         cp wsdg_graphics/*.* wsdg_chm/wsdg_graphics/
197         cp wsdg_graphics/toolbar/* wsdg_chm/wsdg_graphics/toolbar/
198         $(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
199         -$(HHC_EXE) htmlhelp.hhp
200         -mv htmlhelp.chm $@
201         -rm -r htmlhelp.hhp
202         -rm -r toc.hhc
203 !endif
205 # -- Release Notes ------------------------------------------------------------------------
207 release_notes_x: release-notes.html release-notes.txt release-notes-a4.pdf release-notes-us.pdf
209 # create html single page file
210 release-notes.html: $(RELEASE_NOTES_SOURCE)
211         @ echo --- RELEASE NOTES - HTML ---
212         $(SH) <<
213         PATH=/usr/bin
214         $(A2X) -v --format=xhtml $(A2X_HTML_OPTS) release-notes.asciidoc
217 # create txt single page file (through HTML)
218 release-notes.txt: $(RELEASE_NOTES_SOURCE)
219         @ echo --- RELEASE NOTES - TXT ---
220         $(SH) <<
221         PATH=/usr/bin
222         $(A2X) -v --format=text $(A2X_TEXT_OPTS) \
223                 --xsltproc-opts "--stringparam generate.toc \"article nop\"" \
224                 release-notes.asciidoc
226         mv release-notes.text $@
228 news: release-notes.txt
229         copy release-notes.txt ..\NEWS
231 # create pdf file, portrait pages on US letter paper
232 release-notes-us.pdf: $(RELEASE_NOTES_SOURCE) custom_layer_pdf.xsl
233         @ echo --- RELEASE NOTES - PDF US LETTER PAPER ---
234         $(SH) <<
235         PATH=/usr/bin
236         $(A2X) --format=pdf $(A2X_HTML_OPTS) \
237                 --xsltproc-opts "--stringparam paper.type letter --nonet" \
238                 --xsl-file=custom_layer_pdf.xsl \
239                 release-notes.asciidoc
241         mv release-notes.pdf $@
243 # create pdf file, portrait pages on A4 paper
244 release-notes-a4.pdf: $(RELEASE_NOTES_SOURCE) custom_layer_pdf.xsl
245         @ echo --- RELEASE NOTES - PDF A4 PAPER ---
246         $(SH) <<
247         PATH=/usr/bin
248         $(A2X) --format=pdf $(A2X_HTML_OPTS) \
249                 --xsltproc-opts "--stringparam paper.type A4 --nonet" \
250                 --xsl-file=custom_layer_pdf.xsl \
251                 release-notes.asciidoc
253         mv release-notes.pdf $@