WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 4/4] docs/html/hcall: Arrange for automatic build

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 4/4] docs/html/hcall: Arrange for automatic build
From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Date: Sun, 13 Nov 2011 19:21:06 +0000
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Delivery-date: Sun, 13 Nov 2011 11:27:48 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1321212066-10648-1-git-send-email-ian.jackson@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1321212066-10648-1-git-send-email-ian.jackson@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
- Use index.html rather than a stamp file.
- Automatically generate dependencies.
- Wire into the docs build system

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 docs/Makefile    |    9 ++++++---
 docs/xen-headers |   14 ++++++++++++++
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/docs/Makefile b/docs/Makefile
index 01e59cb..3815170 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -15,7 +15,8 @@ DOC_MARKDOWN  := $(wildcard misc/*.markdown)
 DOC_PS         := $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX))
 DOC_PDF                := $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX))
 DOC_HTML       := $(patsubst src/%.tex,html/%/index.html,$(DOC_TEX)) \
-                  $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN))
+                  $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN)) \
+                  html/hcall/index.html
 DOC_TXT         := $(patsubst %.txt,txt/%.txt,$(wildcard misc/*.txt)) \
                   $(patsubst %.markdown,txt/%.txt,$(DOC_MARKDOWN))
 
@@ -129,13 +130,15 @@ html/%.html: %.markdown
        $(MARKDOWN) $< > $@.tmp ; \
        $(call move-if-changed,$@.tmp,$@) ; fi
 
-html/hcall/stamp:
+html/hcall/index.html: ./xen-headers
+       rm -rf $(@D)
        @$(INSTALL_DIR) $(@D)
        ./xen-headers -O $(@D) \
                -T 'arch-x86_64 - Xen public headers' \
                -X arch-ia64 -X arch-x86_32 -X xen-x86_32 \
                ../xen include/public include/xen/errno.h
-       touch $@
+
+-include html/hcall/.deps
 
 txt/%.txt: %.txt
        $(INSTALL_DIR) $(@D)
diff --git a/docs/xen-headers b/docs/xen-headers
index 3cc9e40..606b824 100755
--- a/docs/xen-headers
+++ b/docs/xen-headers
@@ -310,6 +310,12 @@ END
 }
 
 foreach $pass (qw(1 2)) {
+    my $depspath = "$outdir/.deps";
+    my $depsout;
+    if ($pass==2) {
+       $depsout = new IO::File "$depspath.new", 'w' or die $!;
+    }
+
     find({ wanted => 
               sub {
                   return unless m/\.h$/;
@@ -326,11 +332,19 @@ foreach $pass (qw(1 2)) {
                   $leaf_opath = $leaf;
                   $leaf_opath =~ s#/#,#g;
                   $leaf_opath .= ".html";
+                  print $depsout "$outdir/index.html: $File::Find::name\n"
+                      or die $!
+                      if $pass==2;
                   process_file($File::Find::name, $outdir.'/'.$leaf_opath);
           },
           no_chdir => 1,
         },
         map { "$basedir/$_" } @indirs);
+
+    if ($pass==2) {
+       close $depsout or die $!;
+       rename "$depspath.new", "$depspath" or die $!;
+    }
 }
 
 output_index();
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel