Makefile
+Makefile.dep
autom4te.cache
config.log
+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
XMLTO:=xmlto --skip-validation --with-dblatex
include $(srcdir)/../Makefile.common
+-include $(srcdir)/Makefile.dep
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 \
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
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 $^ > $@
--- /dev/null
+#!/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