WSUG: Update the statusbar section.
[metze/wireshark/wip.git] / docbook / Makefile.nmake
index f0583c02da25cb9467219dd4e9035e9e56e7cc58..21c018fda4b4d15d97fcb3b7aff1e61f8f9fcb10 100644 (file)
@@ -3,84 +3,76 @@
 # in several formats.
 # See the Readme.txt file for instructions.
 #
-## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
+## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake [target ...]
 #
-# $Id$
-#
-
-# formatting objects processor
-# Additional options to fop.
-# This needs to contain at least the argument '-Xmx256m'
-FOP_OPTS=-Xmx256m
-
-# fop executable
-# Leave these commented out if you don't have fop instlled or you
-# don't want PDF documentation.
-#
-# for win32 (cygwin) environments (as of fop-0.20 the cygwin script does
-# not use $FOP_OPTS)
-FOP=fop-0.20.5\fop.bat
-#
-# for unix like environments (if you have problems with fop, try to use an absolute path here)
-#FOP=fop-0.20.5/fop.sh
-#
-# One SUSE 9.1 and newer uncomment the following line (make sure you have
-# at least fop-0.20.5-71.2)
-#FOP=fop
-
-# html help compiler (Win32 only)
-# Leave these commented out if you don't have HHC installed or you
-# don't want CHM documentation.
-HHC="C:\Program Files\HTML Help Workshop\hhc.exe"
-#HHC="true"
-
-# html to text converter for text version of release notes, e.g. elinks.
-# This could also be "lynx", or "true" if neither elinks nor lynx is installed
-# (cygwin: lynx works, elinks not available, links and true doesn't produce output)
-#HTML2TXT=elinks -dump -dump-width 72
-#HTML2TXT=links -dump -width 72
-HTML2TXT=lynx -dump -width=72 -nolist -stdin
-#HTML2TXT="true"
 
 ############### YOU SHOULDN'T HAVE TO EDIT ANYTHING BELOW THIS LINE! ################
 
+TOOLS_DIR=..\tools
 include ..\config.nmake
+top_srcdir=..
 include Makefile.common
 
-# the XSL processor
-XSLTPROC="xsltproc"
+WSUG_SOURCE          = $(WSUG_SOURCE)          Makefile.nmake
+WSDG_SOURCE          = $(WSDG_SOURCE)          Makefile.nmake
+RELEASE_NOTES_SOURCE = $(RELEASE_NOTES_SOURCE) Makefile.nmake
+
+# Asciidoc converter
+A2X_HTML_OPTS="--stylesheet=ws.css"
+A2X_TEXT_OPTS=
 
-# the XML validator (from the xsltproc package)
-XMLLINT="xmllint"
+!ifdef LYNX
+A2X_TEXT_OPTS=$(A2X_TEXT_OPTS) --lynx
+!endif
 
 # Automatically generate .pdf files from .fo files
-# Suse needs FOP_OPTS, Debian needs JAVA_OPTS
 .fo.pdf:
        $(FOP) $< $@
 
-# FOP_OPTS="$(FOP_OPTS) $(JAVA_OPTS)" $(FOP) $< $@
+.SUFFIXES: .fo .pdf
+
+# -- (Public) targets -------------------------------------------------------
 
+# Make all (default)
+all: all_x
 
-all: svn_version_check wsug.validated wsdg.validated release_notes.validated wsug wsdg release_notes
+# Make only the WSUG
+wsug: wsug.validated wsug_x
 
+# Make only the WSDG
+wsdg: wsdg.validated wsdg_x
+
+# Make only the release notes
+release_notes: release_notes_x
+
+# Clean all
 clean:
-       rm -rf $(CLEANFILES)
+       rm -rf $(CLEANFILES) $(CLEANDIRS)
 
-.SUFFIXES: .fo .pdf
+distclean: clean
 
-#
-# on every build, record the working copy revision string
-#
-# FORCE is the portable version of .PHONY
-FORCE:
+maintainer-clean: distclean
 
-svn_version_check: FORCE
-       @ $(SH) ./check_svn_version.sh
+# -- All -------------------------------------------------------------------------------
 
-svn_version.xml: svn_version_check
+all_x: wsug.validated wsdg.validated wsug_x wsdg_x release_notes_x
 
+# -- User Guide ------------------------------------------------------------------------
 
-wsug: wsug_html_chunked user-guide.html user-guide-a4.pdf user-guide-us.pdf user-guide.chm user-guide.zip
+wsug_x: wsug_html_chunked wsug_html user-guide-a4.pdf user-guide-us.pdf user-guide.chm
+
+user-guide.xml: user-guide.asciidoc $(WSUG_FILES) user-guide-docinfo.xml
+       @ echo --- WSUG - XML ---
+       $(SH) <<
+       PATH=/usr/bin
+       PYTHONHOME=/
+       $(A2X) --verbose \
+               --attribute=docinfo \
+               --asciidoc-opts="--conf-file=asciidoc.conf --conf-file=asciidoctor-asciidoc.conf" \
+               --no-xmllint \
+               --format=docbook \
+               user-guide.asciidoc
+<<
 
 # validate the content
 wsug.validated: $(WSUG_SOURCE)
@@ -89,16 +81,17 @@ wsug.validated: $(WSUG_SOURCE)
        touch $@
 
 # create html single page file
-user-guide.html: wsug_html/user-guide.html
+wsug_html: wsug_html\index.html
 
-wsug_html/user-guide.html: $(WSUG_SOURCE)
+wsug_html\index.html: $(WSUG_SOURCE)
        @ echo --- WSUG - HTML SINGLE PAGE ---
        if not exist wsug_html\wsug_graphics\toolbar md wsug_html\wsug_graphics\toolbar
        cp wsug_graphics/*.* wsug_html/wsug_graphics
+       cp common_graphics/*.* wsug_html/wsug_graphics
        cp wsug_graphics/toolbar/* wsug_html/wsug_graphics/toolbar
        cp ws.css wsug_html
-       $(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 > $@
-       -chmod -R og+rX wsug_html
+       $(XSLTPROC) --stringparam base.dir wsug_html/ $(COMMON_XSLTPROC_ARGS) \
+               $(WSUG_XSLTPROC_ARGS) $(SINGLE_XSLTPROC_ARGS) user-guide.xml > $@
 
 # create html chunked page files
 wsug_html_chunked: wsug_html_chunked\index.html
@@ -107,10 +100,11 @@ wsug_html_chunked\index.html: $(WSUG_SOURCE)
        @ echo --- WSUG - HTML CHUNKED ---
        if not exist wsug_html_chunked\wsug_graphics\toolbar md wsug_html_chunked\wsug_graphics\toolbar
        cp wsug_graphics/*.* wsug_html_chunked/wsug_graphics
+       cp common_graphics/*.* wsug_html_chunked/wsug_graphics
        cp wsug_graphics/toolbar/* wsug_html_chunked/wsug_graphics/toolbar
        cp ws.css wsug_html_chunked
-       $(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
-       -chmod -R og+rX wsug_html_chunked
+       $(XSLTPROC) --stringparam base.dir wsug_html_chunked/ $(COMMON_XSLTPROC_ARGS) \
+               $(WSUG_XSLTPROC_ARGS)  $(CHUNKED_XSLTPROC_ARGS) user-guide.xml
 
 # create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
 # you will get lot's of errors, but that's ok
@@ -130,25 +124,41 @@ user-guide-a4.fo: $(WSUG_SOURCE) custom_layer_pdf.xsl
 
 # create MS html help file (through html chunked pages)
 user-guide.chm: $(WSUG_SOURCE)
-!ifdef HHC
+!ifdef HHC_EXE
        @ echo --- WSUG - MICROSOFT HTML HELP ---
        if not exist wsug_chm\wsug_graphics\toolbar md wsug_chm\wsug_graphics\toolbar
-       -cp wsug_graphics/*.* wsug_chm/wsug_graphics/
-       -cp wsug_graphics/toolbar/* wsug_chm/wsug_graphics/toolbar/
-       $(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 
-       -$(HHC) htmlhelp.hhp
+       -cp wsug_graphics/*.* wsug_chm/wsug_graphics
+       -cp common_graphics/*.* wsug_chm/wsug_graphics
+       -cp wsug_graphics/toolbar/* wsug_chm/wsug_graphics/toolbar
+       $(XSLTPROC) --stringparam base.dir wsug_chm/ $(COMMON_XSLTPROC_ARGS) \
+               $(WSUG_XSLTPROC_ARGS) $(HTMLHELP_XSLTPROC_ARGS) user-guide.xml
+       -$(HHC_EXE) htmlhelp.hhp
        -mv htmlhelp.chm $@
        -rm -r htmlhelp.hhp
        -rm -r toc.hhc
-
-user-guide.zip: user-guide.chm
-       rm -f user-guide.zip
-       zip user-guide.zip user-guide.chm
-!else
-user-guide.zip:
 !endif
 
-wsdg: wsdg_html_chunked developer-guide.html developer-guide-a4.pdf developer-guide-us.pdf developer-guide.chm
+wsluarm: make-wsluarm.pl $(WSLUA_MODULES)
+       if not exist wsluarm_src md wsluarm_src
+       $(PERL) make-wsluarm.pl $(WSLUA_MODULES)
+       touch wsluarm
+
+# -- Developer's Guide ------------------------------------------------------------------------
+
+wsdg_x: wsdg_html_chunked wsdg_html developer-guide-a4.pdf developer-guide-us.pdf developer-guide.chm
+
+developer-guide.xml: developer-guide.asciidoc $(WSDG_FILES) wsluarm developer-guide-docinfo.xml
+       @ echo --- WSDG - XML ---
+       $(SH) <<
+       PATH=/usr/bin
+       PYTHONHOME=/
+       $(A2X) --verbose \
+               --attribute=docinfo \
+               --asciidoc-opts="--conf-file=asciidoc.conf --conf-file=asciidoctor-asciidoc.conf" \
+               --no-xmllint \
+               --format=docbook \
+               developer-guide.asciidoc
+<<
 
 # validate the content
 wsdg.validated: $(WSDG_SOURCE)
@@ -157,26 +167,32 @@ wsdg.validated: $(WSDG_SOURCE)
        touch $@
 
 # create html single page file
-developer-guide.html: wsdg_html/developer-guide.html
+wsdg_html: wsdg_html\index.html
 
-wsdg_html/developer-guide.html: $(WSDG_SOURCE)
+wsdg_html\index.html: $(WSDG_SOURCE)
        @ echo --- WSDG - HTML SINGLE PAGE ---
        if not exist wsdg_html\wsdg_graphics md wsdg_html\wsdg_graphics
-       cp wsdg_graphics/* wsdg_html/wsdg_graphics
+       if not exist wsdg_html\wsdg_graphics\toolbar md wsdg_html\wsdg_graphics\toolbar
+       cp wsdg_graphics/*.* wsdg_html/wsdg_graphics
+       cp common_graphics/*.* wsdg_html/wsdg_graphics
+       cp wsdg_graphics/toolbar/* wsdg_html/wsdg_graphics/toolbar
        cp ws.css wsdg_html
-       $(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 > $@
-       -chmod -R og+rX wsdg_html
+       $(XSLTPROC) --stringparam base.dir wsdg_html/ $(COMMON_XSLTPROC_ARGS) \
+               $(WSDG_XSLTPROC_ARGS) $(SINGLE_XSLTPROC_ARGS) developer-guide.xml > $@
 
 # create html chunked page files
-wsdg_html_chunked: wsdg_html_chunked/index.html
+wsdg_html_chunked: wsdg_html_chunked\index.html
 
-wsdg_html_chunked/index.html: $(WSDG_SOURCE)
+wsdg_html_chunked\index.html: $(WSDG_SOURCE)
        @ echo --- WSDG - HTML CHUNKED ---
        if not exist wsdg_html_chunked\wsdg_graphics md wsdg_html_chunked\wsdg_graphics
-       cp wsdg_graphics/* wsdg_html_chunked/wsdg_graphics
+       if not exist wsdg_html_chunked\wsdg_graphics\toolbar md wsdg_html_chunked\wsdg_graphics\toolbar
+       cp wsdg_graphics/*.* wsdg_html_chunked/wsdg_graphics
+       cp common_graphics/*.* wsdg_html_chunked/wsdg_graphics
+       cp wsdg_graphics/toolbar/* wsdg_html_chunked/wsdg_graphics/toolbar
        cp ws.css wsdg_html_chunked
-       $(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
-       -chmod -R og+rX wsdg_html_chunked
+       $(XSLTPROC) --stringparam base.dir wsdg_html_chunked/ $(COMMON_XSLTPROC_ARGS) \
+               $(WSDG_XSLTPROC_ARGS) $(CHUNKED_XSLTPROC_ARGS) developer-guide.xml
 
 # create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
 # you will get lot's of errors, but that's ok
@@ -196,60 +212,76 @@ developer-guide-a4.fo: $(WSDG_SOURCE) custom_layer_pdf.xsl
 
 # create MS html help file (through html chunked pages)
 developer-guide.chm: $(WSDG_SOURCE)
-!ifdef HHC
+!ifdef HHC_EXE
        @ echo --- WSDG - MICROSOFT HTML HELP ---
        if not exist wsdg_chm\wsdg_graphics md wsdg_chm\wsdg_graphics
-       cp wsdg_graphics/* wsdg_chm/wsdg_graphics
-       $(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
-       -$(HHC) htmlhelp.hhp
+       if not exist wsdg_chm\wsdg_graphics\toolbar md wsdg_chm\wsdg_graphics\toolbar
+       -cp wsdg_graphics/*.* wsdg_chm/wsdg_graphics
+       -cp common_graphics/*.* wsdg_chm/wsdg_graphics
+       -cp wsdg_graphics/toolbar/* wsdg_chm/wsdg_graphics/toolbar
+       $(XSLTPROC) --stringparam base.dir wsdg_chm/ $(COMMON_XSLTPROC_ARGS) \
+               $(WSDG_XSLTPROC_ARGS) $(HTMLHELP_XSLTPROC_ARGS) developer-guide.xml
+       -$(HHC_EXE) htmlhelp.hhp
        -mv htmlhelp.chm $@
        -rm -r htmlhelp.hhp
        -rm -r toc.hhc
 !endif
 
+# -- Release Notes ------------------------------------------------------------------------
 
-release_notes: release-notes.html release-notes.txt release-notes-a4.pdf release-notes-us.pdf release-notes.chm
+release_notes_x: release-notes.html release-notes.txt
 
-# validate the content
-release_notes.validated: $(RELEASE_NOTES_SOURCE)
-       @ echo --- RELEASE NOTES - VALIDATING XML ---
-       $(XMLLINT) --valid --noout release-notes.xml
-       touch $@
+release_notes_pdf: release-notes-a4.pdf release-notes-us.pdf
 
 # create html single page file
 release-notes.html: $(RELEASE_NOTES_SOURCE)
        @ echo --- RELEASE NOTES - HTML ---
-       $(XSLTPROC) --nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl release-notes.xml > $@
+       $(SH) <<
+       PATH=/usr/bin
+       PYTHONHOME=/
+       $(A2X) -v --format=xhtml $(A2X_HTML_OPTS) release-notes.asciidoc
+<<
 
 # create txt single page file (through HTML)
 release-notes.txt: $(RELEASE_NOTES_SOURCE)
        @ echo --- RELEASE NOTES - TXT ---
-       $(XSLTPROC) --stringparam generate.toc "article nop" --nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl release-notes.xml | $(HTML2TXT) > $@
-       
-# create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
-# you will get lot's of errors, but that's ok
-release-notes-us.fo: $(RELEASE_NOTES_SOURCE) custom_layer_pdf.xsl
-!ifdef FOP
-       @ echo --- RELEASE NOTES - PDF US PAPER ---
-       $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl release-notes.xml > $@
-!endif
-
-# create pdf file (through XSL-FO), portrait pages on A4 paper
-# you will get lot's of errors, but that's ok
-release-notes-a4.fo: $(RELEASE_NOTES_SOURCE) custom_layer_pdf.xsl
-!ifdef FOP
+       $(SH) <<
+       PATH=/usr/bin
+       PYTHONHOME=/
+       TZ=UTC
+       $(A2X) -v --format=text $(A2X_TEXT_OPTS) \
+               --xsltproc-opts "--stringparam generate.toc \"article nop\"" \
+               release-notes.asciidoc
+<<
+       mv release-notes.text $@
+
+news: release-notes.txt
+       copy release-notes.txt ..\NEWS
+
+# create pdf file, portrait pages on US letter paper
+release-notes-us.pdf: $(RELEASE_NOTES_SOURCE) custom_layer_pdf.xsl
+       @ echo --- RELEASE NOTES - PDF US LETTER PAPER ---
+       $(SH) <<
+       PATH=/usr/bin
+       PYTHONHOME=/
+       $(A2X) --format=pdf $(A2X_HTML_OPTS) \
+               --xsltproc-opts "--stringparam paper.type letter --nonet" \
+               --xsl-file=custom_layer_pdf.xsl \
+               release-notes.asciidoc
+<<
+       mv release-notes.pdf $@
+
+# create pdf file, portrait pages on A4 paper
+release-notes-a4.pdf: $(RELEASE_NOTES_SOURCE) custom_layer_pdf.xsl
        @ echo --- RELEASE NOTES - PDF A4 PAPER ---
-       $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl release-notes.xml > $@
-!endif
-
-# create MS html help file (through html chunked pages)
-release-notes.chm: $(RELEASE_NOTES_SOURCE)
-!ifdef HHC
-       @ echo --- RELEASE NOTES - MICROSOFT HTML HELP ---
-       $(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
-       -$(HHC) htmlhelp.hhp
-       -mv htmlhelp.chm $@
-       -rm -r htmlhelp.hhp
-       -rm -r toc.hhc
-!endif
-
+       $(SH) <<
+       PATH=/usr/bin
+       PYTHONHOME=/
+       $(A2X) --format=pdf $(A2X_HTML_OPTS) \
+               --xsltproc-opts "--stringparam paper.type A4 --nonet" \
+               --xsl-file=custom_layer_pdf.xsl \
+               release-notes.asciidoc
+<<
+       mv release-notes.pdf $@
+
+_FORCE_:  ## Assumption: no file named _FORCE_ exists in the current directory