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