On Fri, 17 Aug 2012, Daniel Veillard wrote:

>  apibuild.py really doesn't need to be run except when preparing some
> kind of release, and well I do them in in-source builds so the status
> quo sounds fine to me. To some extend apibuild.py and symbols.xml are
> contracts, release contracts, and really should not be updated on casual
> commits to he tree in my opinion.

Okay, that's a fair call. I have one more patch for now, then:

doc/Makefile.am:

* Ensure that xmlversion.h is in srcdir when building libxml2-api.xml
  (this will give an error in out-of-source builds, but it at least
  ensures that we don't generate an incorrect XML file that doesn't know
  about xmlversion.h)

* Updated the .PHONY target, as none of the targets it listed exist
  anymore

doc/devhelp/Makefile.am:

* Enclose the regeneration rule in "if REBUILD_DOCS" to keep things simple
  when configured without --enable-rebuild-docs

* Added a "rebuild" target like the one in doc/Makefile.am, as this is
  convenient

doc/examples/index.py:

* index.html needs to be in EXTRA_DIST, otherwise we get an error in the
  install-data-local rule when we try to install $(srcdir)/*.html

* Enclose the regeneration rules in "if REBUILD_DOCS"


Don't forget to re-run index.py, and check in updates of the files it 
generates. In particular, doc/examples/Makefile.am in git is still buggy. 
(The only reason I didn't send in a patch for it is because it's a 
generated file.)


--Daniel


-- 
Daniel Richard G. || [email protected] || Software Developer
Teragram Linguistic Technologies (a division of SAS)
http://www.teragram.com/
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)
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
https://mail.gnome.org/mailman/listinfo/xml

Reply via email to