afs.h: fix out of tree build failures
[openafs.git] / doc / xml / UserGuide / NTMakefile
index ffb39b0..8f7bdd2 100644 (file)
 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+VERSFILE = version
 !INCLUDE ..\..\..\src\config\NTMakefile.$(SYS_NAME)
 !INCLUDE ..\..\..\src\config\NTMakefile.version
 
-!IFNDEF CYGWIN
-CYGWIN     = c:/cygwin
+!IFNDEF CYGWINDIR
+CYGWINDIR     = c:/cygwin
 !ENDIF
 !IFNDEF DOCBOOK_XSL
-DOCBOOK_XSL = $(CYGWIN)/usr/share/docbook-xsl
+!IF (EXIST($(CYGWINDIR)/usr/share/sgml/docbook/xsl-stylesheets))
+DOCBOOK_XSL = $(CYGWINDIR)/usr/share/sgml/docbook/xsl-stylesheets
+!ELSE IF (EXIST($(CYGWINDIR)/usr/share/docbook-xsl))
+DOCBOOK_XSL = $(CYGWINDIR)/usr/share/docbook-xsl
+!ELSE
+!ERROR DOCBOOK_XSL cannot be determined
+!ENDIF
 !ENDIF
 XSLTPROC   = xsltproc.exe
+XMLLINT    = xmllint.exe
 HTML_XSL = $(DOCBOOK_XSL)/html/chunk.xsl
 HTML_PARMS = --param navig.graphics 1 --stringparam navig.graphics.path ../
 CHM_XSL    = $(DOCBOOK_XSL)/htmlhelp/htmlhelp.xsl
+BOOK       = auusg000.xml
 
 XMLSRCS = \
-        auusg000.xml \
+        $(BOOK) \
         auusg003.xml \
         auusg004.xml \
         auusg005.xml \
@@ -50,22 +59,27 @@ XMLSRCS = \
         auusg009.xml \
         auusg010.xml \
         auusg011.xml \
-        auusg012.xml 
+        auusg012.xml \
+        $(VERSFILE).xml
 
 index.html: $(XMLSRCS)
         @echo Building OpenAFS User Guide in HTML format
-        $(XSLTPROC) $(HTML_PARMS) $(HTML_XSL) auusg000.xml 
+        $(XSLTPROC) $(HTML_PARMS) $(HTML_XSL) $(BOOK)
 
 htmlhelp.chm: $(XMLSRCS)
         @echo Building OpenAFS User Guide in HTML Help format
-        $(XSLTPROC) $(CHM_XSL) auusg000.xml
+        $(XSLTPROC) $(CHM_XSL) $(BOOK)
         -hhc.exe htmlhelp.hhp
         $(DEL) *.html
         $(DEL) *.hh?
         $(DEL) *.chw
 
-install: htmlhelp.chm index.html
+check: $(XMLSRCS)
+        $(XMLLINT) --noout --valid $(BOOK)
+
+install: check htmlhelp.chm index.html
 
 clean::
         $(DEL) *.html
-        $(DEL) htmlhelp.chm
\ No newline at end of file
+        $(DEL) htmlhelp.chm
+        $(DEL) $(VERSFILE).xml