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