[libxml2] Second round of cleanups for LibXML2 docs/examples



commit 878ec9db9df09b22322906bc5fc61537391070e4
Author: Daniel Richard <oss teragram com>
Date:   Fri Sep 7 14:52:17 2012 +0800

    Second round of cleanups for LibXML2 docs/examples
    
    configure.am:
    
    * Explicitly disallow --enable-rebuild-docs when builddir != srcdir, per
       what you said about needing to build docs with an in-source build
    
    doc/Makefile.am:
    
    * Ensure that xmlversion.h is in the source tree before running
       apibuild.py, to avoid generating an incomplete libxml2-api.xml
    
    * Update the .PHONY target (forgot to do this earlier)
    
    doc/devhelp/Makefile.am:
    
    * Wrap the doc-generating rule in an "if REBUILD_DOCS" conditional so it
       doesn't cause trouble for regular users
    
    * Added a handy-dandy "rebuild" target
    
    doc/examples/index.py:
    
    * NOTE: You need to run this script to regenerate the files it creates,
       and then commit the newly-updated files! The generated files currently
       in git master (e.g. doc/examples/Makefile.am) are out of date even
       before this patch!
    
    * index.html really needs to be in EXTRA_DIST
    
    * Wrap the doc-generating rules in an "if REBUILD_DOCS" conditional,
       because they shouldn't be active otherwise

 configure.in            |    3 +++
 doc/Makefile.am         |    3 ++-
 doc/devhelp/Makefile.am |    5 +++++
 doc/examples/index.py   |    5 ++++-
 4 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/configure.in b/configure.in
index 497fc35..3d5f48b 100644
--- a/configure.in
+++ b/configure.in
@@ -207,6 +207,9 @@ AC_ARG_WITH(coverage,
 
 AC_ARG_ENABLE(rebuild-docs,
 [  --enable-rebuild-docs[[=yes/no]]  rebuild some generated docs [[default=no]]])
+if test "$enable_rebuild_docs" = "yes" -a "$srcdir" != "."; then
+  AC_MSG_ERROR([cannot rebuild docs when builddir != srcdir])
+fi
 AM_CONDITIONAL([REBUILD_DOCS], [test "$enable_rebuild_docs" = "yes" -o "$USER" = "veillard"])
 
 dnl
diff --git a/doc/Makefile.am b/doc/Makefile.am
index e4b60a6..08c0b45 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -303,6 +303,7 @@ source_file_deps = \
 	$(wildcard $(top_srcdir)/*.c)
 
 libxml2-api.xml libxml2-refs.xml ../libxml2.syms: apibuild.py symbols.xml syms.xsl checkapisym.xsl $(source_file_deps)
+	test -f $(top_srcdir)/include/libxml/xmlversion.h
 	(cd $(srcdir) && ./apibuild.py)
 	($(XSLTPROC) $(srcdir)/checkapisym.xsl $(srcdir)/libxml2-api.xml)
 	($(XSLTPROC) -o ../libxml2.syms $(srcdir)/syms.xsl $(srcdir)/symbols.xml)
@@ -346,4 +347,4 @@ install-data-local:
 	-$(INSTALL) -m 0644 $(srcdir)/tutorial/images/callouts/*.* \
 		$(DESTDIR)$(HTML_DIR)/tutorial/images/callouts
 
-.PHONY : html xml templates scan
+.PHONY: docs api web wiki rebuild
diff --git a/doc/devhelp/Makefile.am b/doc/devhelp/Makefile.am
index c904311..dad7975 100644
--- a/doc/devhelp/Makefile.am
+++ b/doc/devhelp/Makefile.am
@@ -68,7 +68,12 @@ EXTRA_FORMAT=				\
 
 EXTRA_DIST = devhelp.xsl html.xsl
 
+if REBUILD_DOCS
+rebuild: libxml2.devhelp $(HTML_FILES)
+.PHONY: rebuild
+
 libxml2.devhelp $(HTML_FILES): devhelp.xsl html.xsl $(top_srcdir)/doc/libxml2-api.xml
 	-@(if [ -x $(XSLTPROC) ] ; then \
 	  echo Rebuilding devhelp files ; \
 	  $(XSLTPROC) --nonet -o $(srcdir)/libxml2.devhelp $(srcdir)/devhelp.xsl $(top_srcdir)/doc/libxml2-api.xml ; fi );
+endif
diff --git a/doc/examples/index.py b/doc/examples/index.py
index 7b13d83..25903c3 100755
--- a/doc/examples/index.py
+++ b/doc/examples/index.py
@@ -13,7 +13,7 @@ sys.path.insert(0, "..")
 from apibuild import CParser, escape
 
 examples = []
-extras = ['examples.xsl', 'index.py']
+extras = ['examples.xsl', 'index.html', 'index.py']
 tests = []
 sections = {}
 symbols = {}
@@ -231,7 +231,9 @@ LDADD = $(RDL_LIBS) $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS)
 
 CLEANFILES = *.tmp
 
+if REBUILD_DOCS
 rebuild: examples.xml index.html
+.PHONY: rebuild
 
 examples.xml: index.py $(noinst_PROGRAMS:=.c)
 	cd $(srcdir) && $(PYTHON) index.py
@@ -240,6 +242,7 @@ examples.xml: index.py $(noinst_PROGRAMS:=.c)
 index.html: examples.xml examples.xsl
 	cd $(srcdir) && xsltproc examples.xsl examples.xml && echo "Rebuilt web page"
 	-cd $(srcdir) && xmllint --valid --noout index.html
+endif
 
 install-data-local: 
 	$(MKDIR_P) $(DESTDIR)$(HTML_DIR)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]