doc: refactor Makefile and xmlrules.in code for reusability
A different approach which requires less variables setting and internal knowledge of the reused code. Changing from "install" to "not install" is very easy now. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
f33512b70c
commit
7250f078c1
|
@ -22,14 +22,9 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
SUBDIRS = dtrace
|
SUBDIRS = dtrace
|
||||||
|
doc_sources = Xserver-spec.xml
|
||||||
|
|
||||||
XML_FILES = Xserver-spec.xml
|
# Developer's documentation is not installed
|
||||||
|
|
||||||
include $(top_srcdir)/doc/xml/xmlrules.in
|
|
||||||
|
|
||||||
if ENABLE_DEVEL_DOCS
|
if ENABLE_DEVEL_DOCS
|
||||||
noinst_DATA = $(BUILT_DOC_FILES)
|
include $(top_srcdir)/doc/xml/xmlrules-noinst.in
|
||||||
endif
|
endif
|
||||||
CLEANFILES = $(CLEAN_DOC_FILES)
|
|
||||||
|
|
||||||
EXTRA_DIST = $(XML_FILES)
|
|
||||||
|
|
|
@ -21,18 +21,16 @@
|
||||||
# DEALINGS IN THE SOFTWARE.
|
# DEALINGS IN THE SOFTWARE.
|
||||||
#
|
#
|
||||||
|
|
||||||
XML_FILES = Xserver-DTrace.xml
|
doc_sources = Xserver-DTrace.xml
|
||||||
|
|
||||||
include $(top_srcdir)/doc/xml/xmlrules.in
|
|
||||||
|
|
||||||
if ENABLE_DOCS
|
if ENABLE_DOCS
|
||||||
|
|
||||||
|
# This user's documentation is installed only if tracing is available
|
||||||
if XSERVER_DTRACE
|
if XSERVER_DTRACE
|
||||||
doc_DATA = $(BUILT_DOC_FILES)
|
include $(top_srcdir)/doc/xml/xmlrules-inst.in
|
||||||
else
|
else
|
||||||
noinst_DATA = $(BUILT_DOC_FILES)
|
include $(top_srcdir)/doc/xml/xmlrules-noinst.in
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CLEANFILES = $(CLEAN_DOC_FILES)
|
endif
|
||||||
|
|
||||||
EXTRA_DIST = $(XML_FILES)
|
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
|
||||||
|
# The doc_sources variable contains one or more DocBook/XML source file.
|
||||||
|
# The generated documents will be installed in $(docdir),
|
||||||
|
# The DocBook/XML files will always be included in the tarball
|
||||||
|
|
||||||
|
dist_doc_DATA = $(doc_sources)
|
||||||
|
|
||||||
|
if HAVE_XMLTO
|
||||||
|
doc_DATA = $(doc_sources:.xml=.html)
|
||||||
|
|
||||||
|
if HAVE_FOP
|
||||||
|
doc_DATA += $(doc_sources:.xml=.pdf)
|
||||||
|
endif
|
||||||
|
|
||||||
|
if HAVE_XMLTO_TEXT
|
||||||
|
doc_DATA += $(doc_sources:.xml=.txt)
|
||||||
|
endif
|
||||||
|
|
||||||
|
CLEANFILES = $(doc_DATA)
|
||||||
|
include $(top_srcdir)/doc/xml/xmlrules.in
|
||||||
|
|
||||||
|
endif HAVE_XMLTO
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
|
||||||
|
# The doc_sources variable contains one or more DocBook/XML source file.
|
||||||
|
# The generated documents will NOT be installed in $(docdir),
|
||||||
|
# The DocBook/XML files will always be included in the tarball
|
||||||
|
|
||||||
|
dist_noinst_DATA = $(doc_sources)
|
||||||
|
|
||||||
|
if HAVE_XMLTO
|
||||||
|
noinst_DATA = $(doc_sources:.xml=.html)
|
||||||
|
|
||||||
|
if HAVE_FOP
|
||||||
|
noinst_DATA += $(doc_sources:.xml=.pdf)
|
||||||
|
endif
|
||||||
|
|
||||||
|
if HAVE_XMLTO_TEXT
|
||||||
|
noinst_DATA += $(doc_sources:.xml=.txt)
|
||||||
|
endif
|
||||||
|
|
||||||
|
CLEANFILES = $(noinst_DATA)
|
||||||
|
include $(top_srcdir)/doc/xml/xmlrules.in
|
||||||
|
|
||||||
|
endif HAVE_XMLTO
|
|
@ -21,24 +21,15 @@
|
||||||
# DEALINGS IN THE SOFTWARE.
|
# DEALINGS IN THE SOFTWARE.
|
||||||
#
|
#
|
||||||
|
|
||||||
# This file is included by Makefile.am in subdirectories that have
|
# This file provides pattern rules to generate html/pdf/txt from DocBook/XML
|
||||||
# DocBook XML documentation files.
|
# A stylesheet is used if xorg-sgml-doctools is installed
|
||||||
#
|
# This file is included by xmlrules-inst.in for installable user's documentation
|
||||||
# No files are automatically distributed or installed by this subset of rules
|
# It is included by xmlrules-noinst for non installable developer's documentation
|
||||||
# Any files to be distributed or installed would be listed in the including
|
# If the server version or release date changes, autogen && make
|
||||||
# Makefile.am
|
|
||||||
|
|
||||||
TXT_FILES = $(XML_FILES:%.xml=%.txt)
|
|
||||||
HTML_FILES = $(XML_FILES:%.xml=%.html)
|
|
||||||
PDF_FILES = $(XML_FILES:%.xml=%.pdf)
|
|
||||||
|
|
||||||
BUILT_DOC_FILES =
|
|
||||||
|
|
||||||
SUFFIXES = .xml .txt .html .pdf
|
|
||||||
|
|
||||||
XML_ENT_DIR = $(abs_top_builddir)/doc/xml
|
XML_ENT_DIR = $(abs_top_builddir)/doc/xml
|
||||||
|
SUFFIXES = .xml .txt .html .pdf
|
||||||
|
|
||||||
if HAVE_XMLTO
|
|
||||||
XMLTO_FLAGS = --searchpath $(XML_ENT_DIR)
|
XMLTO_FLAGS = --searchpath $(XML_ENT_DIR)
|
||||||
|
|
||||||
if HAVE_STYLESHEETS
|
if HAVE_STYLESHEETS
|
||||||
|
@ -46,23 +37,11 @@ XMLTO_FLAGS += -m $(XSL_STYLESHEET) \
|
||||||
--stringparam html.stylesheet=$(STYLESHEET_SRCDIR)/xorg.css
|
--stringparam html.stylesheet=$(STYLESHEET_SRCDIR)/xorg.css
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if HAVE_XMLTO_TEXT
|
|
||||||
BUILT_DOC_FILES += $(TXT_FILES)
|
|
||||||
%.txt: %.xml $(XML_ENT_DIR)/xserver.ent
|
%.txt: %.xml $(XML_ENT_DIR)/xserver.ent
|
||||||
$(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) txt $<
|
$(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) txt $<
|
||||||
endif
|
|
||||||
|
|
||||||
BUILT_DOC_FILES += $(HTML_FILES)
|
|
||||||
%.html: %.xml $(XML_ENT_DIR)/xserver.ent
|
%.html: %.xml $(XML_ENT_DIR)/xserver.ent
|
||||||
$(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) xhtml-nochunks $<
|
$(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) xhtml-nochunks $<
|
||||||
|
|
||||||
if HAVE_FOP
|
|
||||||
BUILT_DOC_FILES += $(PDF_FILES)
|
|
||||||
%.pdf: %.xml $(XML_ENT_DIR)/xserver.ent
|
%.pdf: %.xml $(XML_ENT_DIR)/xserver.ent
|
||||||
$(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) --with-fop pdf $<
|
$(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) --with-fop pdf $<
|
||||||
endif
|
|
||||||
|
|
||||||
endif HAVE_XMLTO
|
|
||||||
|
|
||||||
CLEAN_DOC_FILES = $(TXT_FILES) $(HTML_FILES) $(PDF_FILES)
|
|
||||||
|
|
||||||
|
|
|
@ -19,14 +19,12 @@
|
||||||
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||||
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
XML_FILES = dmx.xml scaled.xml
|
doc_sources = dmx.xml scaled.xml
|
||||||
|
|
||||||
include $(top_srcdir)/doc/xml/xmlrules.in
|
|
||||||
|
|
||||||
|
# Developer's documentation is not installed
|
||||||
if ENABLE_DEVEL_DOCS
|
if ENABLE_DEVEL_DOCS
|
||||||
noinst_DATA = $(BUILT_DOC_FILES)
|
include $(top_srcdir)/doc/xml/xmlrules-noinst.in
|
||||||
endif
|
endif
|
||||||
CLEANFILES = $(CLEAN_DOC_FILES)
|
|
||||||
|
|
||||||
if HAVE_DOXYGEN
|
if HAVE_DOXYGEN
|
||||||
|
|
||||||
|
|
|
@ -19,13 +19,9 @@
|
||||||
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||||
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
XML_FILES = DESIGN.xml
|
doc_sources = DESIGN.xml
|
||||||
|
|
||||||
include $(top_srcdir)/doc/xml/xmlrules.in
|
|
||||||
|
|
||||||
|
# Developer's documentation is not installed
|
||||||
if ENABLE_DEVEL_DOCS
|
if ENABLE_DEVEL_DOCS
|
||||||
noinst_DATA = $(BUILT_DOC_FILES)
|
include $(top_srcdir)/doc/xml/xmlrules-noinst.in
|
||||||
endif
|
endif
|
||||||
CLEANFILES = $(CLEAN_DOC_FILES)
|
|
||||||
|
|
||||||
EXTRA_DIST = $(XML_FILES)
|
|
||||||
|
|
Loading…
Reference in New Issue