]> sourceware.org Git - newlib-cygwin.git/commitdiff
Created xidepend mechanism
authorWarren Young <warren@etr-usa.com>
Thu, 23 May 2013 19:02:46 +0000 (19:02 +0000)
committerWarren Young <warren@etr-usa.com>
Thu, 23 May 2013 19:02:46 +0000 (19:02 +0000)
winsup/doc/.cvsignore
winsup/doc/ChangeLog
winsup/doc/Makefile.in
winsup/doc/xidepend [new file with mode: 0755]

index 30b46cf7f2591d57a2c50fbe96aec8a7058a5db3..28884883314394fddda2261b190f3eba94bb57a1 100644 (file)
@@ -1,4 +1,5 @@
 Makefile
+Makefile.dep
 
 autom4te.cache
 config.log
index e930a0d01cc322c61a29c293fdb683d0cca0f0dd..3d0c0503553362d2884ed51ae2b6bad3ea580ca8 100644 (file)
@@ -1,3 +1,11 @@
+2013-05-23  Warren Young  <warren@etr-usa.com>
+
+       * xidepend: New script, generates Makefile.dep from top-level XML
+       * .cvsignore: Ignoring Makefile.dep output
+       * Makefile: Creating Makefile.dep if it doesn't exist, including it
+       if it does, and removing it on 'make clean'
+       * Wishlist: Knocked autodependency generation off the list
+
 2013-05-23  Corinna Vinschen  <corinna@vinschen.de>
 
        * cygwinenv.xml (cygwinenv-implemented-options): Explain new
index de02df45ced276530beda43782cdbbd738066bd5..35b33fa403503ea88b31d1f7ee73e4fdbac96ee0 100644 (file)
@@ -21,6 +21,7 @@ exeext:=@build_exeext@
 XMLTO:=xmlto --skip-validation --with-dblatex
 
 include $(srcdir)/../Makefile.common
+-include $(srcdir)/Makefile.dep
 
 FAQ_SOURCES:= $(wildcard ${srcdir}/faq*.xml)
 
@@ -29,7 +30,7 @@ FAQ_SOURCES:= $(wildcard ${srcdir}/faq*.xml)
 .html.body:
        $(srcdir)/bodysnatcher.pl $<
 
-all: Makefile \
+all: Makefile Makefile.dep \
        cygwin-ug-net/cygwin-ug-net.html \
        cygwin-ug-net/cygwin-ug-net-nochunks.html.gz \
        cygwin-api/cygwin-api.html \
@@ -38,6 +39,7 @@ all: Makefile \
        cygwin-api/cygwin-api.pdf
 
 clean:
+       rm -f Makefile.dep
        rm -f doctool.exe doctool.o
        rm -f cygwin-api.xml
        rm -f *.html *.html.gz
@@ -84,3 +86,6 @@ TBDEPS = cygwin-ug-net/cygwin-ug-net.html cygwin-api/cygwin-api.html
 tarball : cygwin-docs.tar.bz2
 cygwin-docs.tar.bz2 : $(TBFILES) $(TBDEPS)
        find $(TBFILES) $(TBDIRS) \! -type d | sort | tar -T - -cf -  | bzip2 > cygwin-docs.tar.bz2
+
+Makefile.dep: cygwin-ug-net.xml faq.xml
+       $(srcdir)/xidepend $^ > $@
diff --git a/winsup/doc/xidepend b/winsup/doc/xidepend
new file mode 100755 (executable)
index 0000000..0704a7f
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/sh
+if [ "$1" = "-r" ]
+then
+       # We're being called recursively by another xidepend instance, so
+       # suppress outputs that only happen at the top level.
+       shift
+       subproc=1
+else
+       subproc=0
+fi
+
+for f in "$@"
+do
+       if fgrep -q 'xi:include' "$f"
+       then
+               # This file uses XIncludes.  Let's chase its deps recursively.
+               base=`echo $f | sed -e s/\.xml//`
+               if [ $subproc -eq 0 ] ; then echo -n "$base/$base.html:" ; fi
+
+               deps=`grep 'xi:include.*href' "$f" | cut -f2 -d\" | tr '\n' ' '`
+               echo -n " $deps"
+               for d in $deps
+               do
+                       # Call ourselves recursively to continue to collect deps.
+                       # The -r flag tells our subprocess that it is merely
+                       # contributing to a dependency line in progress.
+                       $0 -r $d
+               done
+
+               # If we're at the top recursion level, we have nothing else to
+               # add to this dependency line other than the newline.
+               if [ $subproc -eq 0 ] ; then echo ; fi
+       fi
+done
This page took 0.033905 seconds and 5 git commands to generate.