[PATCH xserver 1/9] doc: use common makefile for developers documentation

Gaetan Nadon memsize at videotron.ca
Thu Apr 28 18:16:08 PDT 2011


The user/specs docs now have external references support.
Developers doc are not installed so they do not participate.
However, using a similar makefile shared amongst developers
document reduces maintenance and is forward looking.

Man pages being out of here, reorg developers docs under the same roof.
Drop the obsolete sgml subdir.

Reviewed-by Jeremy Huddleston <jeremyhu at apple.com>
Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 configure.ac                                      |    2 -
 devbook.am                                        |   62 +++++++++++++++++++++
 hw/xfree86/doc/.gitignore                         |    4 +
 hw/xfree86/doc/Makefile.am                        |   18 +++++-
 hw/xfree86/doc/{devel => }/README.DRIcomp         |    2 -
 hw/xfree86/doc/{devel => }/Registry               |    0
 hw/xfree86/doc/{sgml/DESIGN.xml => ddxDesign.xml} |    4 +-
 hw/xfree86/doc/devel/Makefile.am                  |    7 --
 hw/xfree86/doc/{devel => }/exa-driver.txt         |    0
 hw/xfree86/doc/sgml/.gitignore                    |    6 --
 hw/xfree86/doc/sgml/Makefile.am                   |   27 ---------
 11 files changed, 84 insertions(+), 48 deletions(-)
 create mode 100644 devbook.am
 create mode 100644 hw/xfree86/doc/.gitignore
 rename hw/xfree86/doc/{devel => }/README.DRIcomp (99%)
 rename hw/xfree86/doc/{devel => }/Registry (100%)
 rename hw/xfree86/doc/{sgml/DESIGN.xml => ddxDesign.xml} (99%)
 delete mode 100644 hw/xfree86/doc/devel/Makefile.am
 rename hw/xfree86/doc/{devel => }/exa-driver.txt (100%)
 delete mode 100644 hw/xfree86/doc/sgml/.gitignore
 delete mode 100644 hw/xfree86/doc/sgml/Makefile.am

diff --git a/configure.ac b/configure.ac
index 6eb780c..e56e849 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2167,8 +2167,6 @@ hw/xfree86/ddc/Makefile
 hw/xfree86/dixmods/Makefile
 hw/xfree86/dixmods/extmod/Makefile
 hw/xfree86/doc/Makefile
-hw/xfree86/doc/devel/Makefile
-hw/xfree86/doc/sgml/Makefile
 hw/xfree86/dri/Makefile
 hw/xfree86/dri2/Makefile
 hw/xfree86/exa/Makefile
diff --git a/devbook.am b/devbook.am
new file mode 100644
index 0000000..dbc9d8a
--- /dev/null
+++ b/devbook.am
@@ -0,0 +1,62 @@
+#
+# Generate output formats for a single DocBook/XML with/without chapters
+#
+# Variables set by the calling Makefile:
+# noinst_DATA: developers docs are not installed
+# docbook:  the main DocBook/XML file, no chapters, appendix or image files
+# chapters: all files pulled in by an XInclude statement and images.
+#
+
+#
+# This makefile is intended for Developers Documentation and is not installed.
+# Do not use for Users docs or Specs which need to be installed and require olink support
+# Refer to http://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html#id2584393
+# for an explanation on documents classification.
+#
+
+# Developers documnetation is not installed
+noinst_DATA =
+
+# DocBook/XML file with chapters, appendix and images it includes
+dist_noinst_DATA = $(docbook) $(chapters)
+
+#
+# Generate DocBook/XML output formats with or without stylesheets
+#
+
+# Stylesheets are available if the package xorg-sgml-doctools is installed
+if HAVE_STYLESHEETS
+
+# The location where all cross reference databases are installed
+XMLTO_FLAGS =						\
+	--searchpath "$(XORG_SGML_PATH)/X11"		\
+	--searchpath "$(abs_top_builddir)/doc/xml"	\
+	--stringparam current.docid="$(<:.xml=)"
+
+XMLTO_XHTML_FLAGS = \
+	-m $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl \
+	--stringparam html.stylesheet=$(STYLESHEET_SRCDIR)/xorg.css
+
+XMLTO_FO_FLAGS = \
+	-m $(STYLESHEET_SRCDIR)/xorg-fo.xsl
+endif HAVE_STYLESHEETS
+
+noinst_DATA += $(docbook:.xml=.html)
+%.html: %.xml  $(chapters)
+	$(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_XHTML_FLAGS) xhtml-nochunks $<
+
+if HAVE_FOP
+noinst_DATA += $(docbook:.xml=.pdf) $(docbook:.xml=.ps)
+%.pdf: %.xml $(chapters)
+	$(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_FO_FLAGS) --with-fop pdf $<
+%.ps: %.xml $(chapters)
+	$(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_FO_FLAGS) --with-fop ps $<
+endif HAVE_FOP
+
+if HAVE_XMLTO_TEXT
+noinst_DATA += $(docbook:.xml=.txt)
+%.txt: %.xml $(chapters)
+	$(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_XHTML_FLAGS) txt $<
+endif HAVE_XMLTO_TEXT
+
+CLEANFILES = $(noinst_DATA)
diff --git a/hw/xfree86/doc/.gitignore b/hw/xfree86/doc/.gitignore
new file mode 100644
index 0000000..63eee59
--- /dev/null
+++ b/hw/xfree86/doc/.gitignore
@@ -0,0 +1,4 @@
+ddxDesign.html
+ddxDesign.pdf
+ddxDesign.ps
+ddxDesign.txt
diff --git a/hw/xfree86/doc/Makefile.am b/hw/xfree86/doc/Makefile.am
index ac316e0..1c3620a 100644
--- a/hw/xfree86/doc/Makefile.am
+++ b/hw/xfree86/doc/Makefile.am
@@ -1,4 +1,18 @@
-SUBDIRS = devel sgml
 
-EXTRA_DIST = \
+if ENABLE_DEVEL_DOCS
+if HAVE_XMLTO
+
+# Main DocBook/XML files (DOCTYPE book)
+docbook = ddxDesign.xml
+
+# Generate DocBook/XML output formats with or without stylesheets
+include $(top_srcdir)/devbook.am
+
+endif HAVE_XMLTO
+endif ENABLE_DEVEL_DOCS
+
+EXTRA_DIST =		\
+	Registry	\
+	exa-driver.txt	\
+	README.DRIcomp	\
 	README.modes
diff --git a/hw/xfree86/doc/devel/README.DRIcomp b/hw/xfree86/doc/README.DRIcomp
similarity index 99%
rename from hw/xfree86/doc/devel/README.DRIcomp
rename to hw/xfree86/doc/README.DRIcomp
index 89f40a7..2d3ebf1 100644
--- a/hw/xfree86/doc/devel/README.DRIcomp
+++ b/hw/xfree86/doc/README.DRIcomp
@@ -552,5 +552,3 @@ ated direct rendering.  Please read the DRI User Guide for information about
 trouble shooting and how to use the DRI-enabled X server for 3D applications.
 
      Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.19 dawes Exp $
-
-
diff --git a/hw/xfree86/doc/devel/Registry b/hw/xfree86/doc/Registry
similarity index 100%
rename from hw/xfree86/doc/devel/Registry
rename to hw/xfree86/doc/Registry
diff --git a/hw/xfree86/doc/sgml/DESIGN.xml b/hw/xfree86/doc/ddxDesign.xml
similarity index 99%
rename from hw/xfree86/doc/sgml/DESIGN.xml
rename to hw/xfree86/doc/ddxDesign.xml
index 08f8bc8..0290960 100644
--- a/hw/xfree86/doc/sgml/DESIGN.xml
+++ b/hw/xfree86/doc/ddxDesign.xml
@@ -16,7 +16,7 @@
  <!ENTITY k.serverflags "<emphasis>ServerFlags</emphasis>">
 ] >
 
-<article>
+<article id="ddxDesign">
   <articleinfo>
 
     <title>XFree86 DDX Design (Xorg server version &xserver.version;)</title>
@@ -4905,7 +4905,7 @@ as follows:
 		XV_HUE
 		XV_SATURATION
 		XV_BRIGHTNESS
-  		XV_CONTRAST
+		XV_CONTRAST
 		  </constant></literallayout>
 	  but the driver may recognize as many atoms as it wishes.  If
 	  a requested attribute is unknown by the driver it should return
diff --git a/hw/xfree86/doc/devel/Makefile.am b/hw/xfree86/doc/devel/Makefile.am
deleted file mode 100644
index c9eca5e..0000000
--- a/hw/xfree86/doc/devel/Makefile.am
+++ /dev/null
@@ -1,7 +0,0 @@
-# Documentation for developers that is distributed with the source but
-# not installed on the system for end-users
-
-EXTRA_DIST = \
-	Registry \
-	exa-driver.txt \
-	README.DRIcomp
diff --git a/hw/xfree86/doc/devel/exa-driver.txt b/hw/xfree86/doc/exa-driver.txt
similarity index 100%
rename from hw/xfree86/doc/devel/exa-driver.txt
rename to hw/xfree86/doc/exa-driver.txt
diff --git a/hw/xfree86/doc/sgml/.gitignore b/hw/xfree86/doc/sgml/.gitignore
deleted file mode 100644
index b0b2d05..0000000
--- a/hw/xfree86/doc/sgml/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-#		Add & Override for this directory and it's subdirectories
-DESIGN.html
-DESIGN.pdf
-DESIGN.ps
-DESIGN.txt
-xorg.css
diff --git a/hw/xfree86/doc/sgml/Makefile.am b/hw/xfree86/doc/sgml/Makefile.am
deleted file mode 100644
index 10eca86..0000000
--- a/hw/xfree86/doc/sgml/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-#  Copyright 2005 Red Hat, Inc.
-#
-#  Permission to use, copy, modify, distribute, and sell this software
-#  and its documentation for any purpose is hereby granted without
-#  fee, provided that the above copyright notice appear in all copies
-#  and that both that copyright notice and this permission notice
-#  appear in supporting documentation, and that the name of Red Hat
-#  not be used in advertising or publicity pertaining to distribution
-#  of the software without specific, written prior permission.  Red
-#  Hat makes no representations about the suitability of this software
-#  for any purpose.  It is provided "as is" without express or implied
-#  warranty.
-#
-#  RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-#  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
-#  NO EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-#  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
-#  OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-#  NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-#  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-doc_sources = DESIGN.xml
-
-# Developer's documentation is not installed
-if ENABLE_DEVEL_DOCS
-include $(top_srcdir)/doc/xml/xmlrules-noinst.in
-endif
-- 
1.6.0.4



More information about the xorg-devel mailing list