]> xenbits.xensource.com Git - libvirt.git/commitdiff
docs: fix generation of docs from VPATH build
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 20 Jan 2016 12:22:19 +0000 (12:22 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 20 Jan 2016 12:22:19 +0000 (12:22 +0000)
When generating docs in a VPATH build we get a failure to
create a file due to the 'internals' subdir not existing:

  Generating internals/locking.html.tmp
  /bin/sh: line 3: internals/locking.html.tmp: No such file or directory
  rm: cannot remove ‘internals/locking.html.tmp’: No such file or directory
  Makefile:2229: recipe for target 'internals/locking.html.tmp' failed
  make: *** [internals/locking.html.tmp] Error 1

For some reason, make has decided to run the target

  %.html.tmp: %.html.in site.xsl page.xsl sitemap.html.in $(acl_generated)

instead of the target

  internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in

Removing '$(acl_generated)' from the first target, inexplicably
causes make to now run the correct target for the internals/
files.

Rather than figure this out, lets just combine the two targets
into one.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
docs/Makefile.am

index fb53a45cbd19dfb08743dd3071245b28a7aa53a7..231aa4eeba7443a7b662354dee90114b1f7a03ff 100644 (file)
@@ -220,21 +220,20 @@ $(srcdir)/hvsupport.html.in: $(srcdir)/hvsupport.pl $(api_DATA) \
 %.png: %.fig
        convert -rotate 90 $< $@
 
-internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in
+%.html.tmp: %.html.in site.xsl subsite.xsl page.xsl sitemap.html.in $(acl_generated)
        @if [ -x $(XSLTPROC) ] ; then \
          echo "Generating $@"; \
-         $(MKDIR_P) internals; \
          name=`echo $@ | sed -e 's/.tmp//'`; \
+         dir=`dirname $@` ; \
+         if test "$$dir" = "."; \
+         then \
+           style=site.xsl; \
+         else \
+           $(MKDIR_P) $$dir; \
+           style=subsite.xsl; \
+         fi; \
          $(XSLTPROC) --stringparam pagename $$name --nonet \
-           $(top_srcdir)/docs/subsite.xsl $< > $@ \
-           || { rm $@ && exit 1; }; fi
-
-%.html.tmp: %.html.in site.xsl page.xsl sitemap.html.in $(acl_generated)
-       @if [ -x $(XSLTPROC) ] ; then \
-         echo "Generating $@"; \
-         name=`echo $@ | sed -e 's/.tmp//'`; \
-         $(XSLTPROC) --stringparam pagename $$name --nonet \
-           $(top_srcdir)/docs/site.xsl $< > $@ \
+           $(top_srcdir)/docs/$$style $< > $@ \
            || { rm $@ && exit 1; }; fi
 
 %.html: %.html.tmp