Created xidepend mechanism
This commit is contained in:
		| @@ -1,4 +1,5 @@ | |||||||
| Makefile | Makefile | ||||||
|  | Makefile.dep | ||||||
|  |  | ||||||
| autom4te.cache | autom4te.cache | ||||||
| config.log | config.log | ||||||
|   | |||||||
| @@ -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> | 2013-05-23  Corinna Vinschen  <corinna@vinschen.de> | ||||||
|  |  | ||||||
| 	* cygwinenv.xml (cygwinenv-implemented-options): Explain new | 	* cygwinenv.xml (cygwinenv-implemented-options): Explain new | ||||||
|   | |||||||
| @@ -21,6 +21,7 @@ exeext:=@build_exeext@ | |||||||
| XMLTO:=xmlto --skip-validation --with-dblatex | XMLTO:=xmlto --skip-validation --with-dblatex | ||||||
|  |  | ||||||
| include $(srcdir)/../Makefile.common | include $(srcdir)/../Makefile.common | ||||||
|  | -include $(srcdir)/Makefile.dep | ||||||
|  |  | ||||||
| FAQ_SOURCES:= $(wildcard ${srcdir}/faq*.xml) | FAQ_SOURCES:= $(wildcard ${srcdir}/faq*.xml) | ||||||
|  |  | ||||||
| @@ -29,7 +30,7 @@ FAQ_SOURCES:= $(wildcard ${srcdir}/faq*.xml) | |||||||
| .html.body: | .html.body: | ||||||
| 	$(srcdir)/bodysnatcher.pl $< | 	$(srcdir)/bodysnatcher.pl $< | ||||||
|  |  | ||||||
| all: Makefile \ | all: Makefile Makefile.dep \ | ||||||
| 	cygwin-ug-net/cygwin-ug-net.html \ | 	cygwin-ug-net/cygwin-ug-net.html \ | ||||||
| 	cygwin-ug-net/cygwin-ug-net-nochunks.html.gz \ | 	cygwin-ug-net/cygwin-ug-net-nochunks.html.gz \ | ||||||
| 	cygwin-api/cygwin-api.html \ | 	cygwin-api/cygwin-api.html \ | ||||||
| @@ -38,6 +39,7 @@ all: Makefile \ | |||||||
| 	cygwin-api/cygwin-api.pdf | 	cygwin-api/cygwin-api.pdf | ||||||
|  |  | ||||||
| clean: | clean: | ||||||
|  | 	rm -f Makefile.dep | ||||||
| 	rm -f doctool.exe doctool.o | 	rm -f doctool.exe doctool.o | ||||||
| 	rm -f cygwin-api.xml | 	rm -f cygwin-api.xml | ||||||
| 	rm -f *.html *.html.gz | 	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 | tarball : cygwin-docs.tar.bz2 | ||||||
| cygwin-docs.tar.bz2 : $(TBFILES) $(TBDEPS) | cygwin-docs.tar.bz2 : $(TBFILES) $(TBDEPS) | ||||||
| 	find $(TBFILES) $(TBDIRS) \! -type d | sort | tar -T - -cf -  | bzip2 > cygwin-docs.tar.bz2 | 	find $(TBFILES) $(TBDIRS) \! -type d | sort | tar -T - -cf -  | bzip2 > cygwin-docs.tar.bz2 | ||||||
|  |  | ||||||
|  | Makefile.dep: cygwin-ug-net.xml faq.xml | ||||||
|  | 	$(srcdir)/xidepend $^ > $@ | ||||||
|   | |||||||
							
								
								
									
										34
									
								
								winsup/doc/xidepend
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										34
									
								
								winsup/doc/xidepend
									
									
									
									
									
										Executable file
									
								
							| @@ -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 | ||||||
		Reference in New Issue
	
	Block a user