summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 79f6ac7)
raw | patch | inline | side by side (parent: 79f6ac7)
author | Junio C Hamano <junkio@cox.net> | |
Tue, 8 Nov 2005 02:21:51 +0000 (18:21 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 8 Nov 2005 02:21:51 +0000 (18:21 -0800) |
Documentation/Makefile spent a lot of time to generate include
dependencies, which was quite noticeable especially during "make clean".
Rewrite it to generate just a single dependency file.
Signed-off-by: Junio C Hamano <junkio@cox.net>
dependencies, which was quite noticeable especially during "make clean".
Rewrite it to generate just a single dependency file.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/.gitignore | patch | blob | history | |
Documentation/Makefile | patch | blob | history | |
Documentation/build-docdep.perl | [new file with mode: 0755] | patch | blob |
index dad52b80d35caed744cd94399054b6126bfa43bf..9fef490871b94b8434791897bea02e5cbe886032 100644 (file)
--- a/Documentation/.gitignore
+++ b/Documentation/.gitignore
*.1
*.7
howto-index.txt
+doc.dep
diff --git a/Documentation/Makefile b/Documentation/Makefile
index bb9533ff03514b0523bd1695508e641cc5574042..f45a06246920cf6bcd5c90bd358461171ed2bd5a 100644 (file)
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
#
# Determine "include::" file references in asciidoc files.
#
-TEXTFILES = $(wildcard *.txt)
-DEPFILES = $(TEXTFILES:%.txt=%.dep)
-
-%.dep : %.txt
- @rm -f $@
- @$(foreach dep, $(shell grep include:: $< | sed -e 's/include::/ /' -e 's/\[\]//'), \
- echo $(<:%.txt=%.html) $(<:%.txt=%.1) : $(dep) >> $@; )
+TEXTFILES = $(wildcard git-*.txt)
+doc.dep : $(TEXTFILES) build-docdep.perl
+ rm -f $@+ $@
+ perl ./build-docdep.perl >$@+
+ mv $@+ $@
--include $(DEPFILES)
+-include doc.dep
git.7: ../README
clean:
- rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html *.dep
+ rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html doc.dep
%.html : %.txt
asciidoc -b xhtml11 -d manpage -f asciidoc.conf $<
diff --git a/Documentation/build-docdep.perl b/Documentation/build-docdep.perl
--- /dev/null
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+
+my %include = ();
+
+for my $text (<git-*.txt>) {
+ open I, '<', $text || die "cannot read: $text";
+ (my $base = $text) =~ s/\.txt$//;
+ while (<I>) {
+ if (/^include::/) {
+ chomp;
+ s/^include::\s*//;
+ s/\[\]//;
+ $include{$base}{$_} = 1;
+ }
+ }
+ close I;
+}
+
+# Do we care about chained includes???
+
+while (my ($base, $included) = each %include) {
+ my ($suffix) = '1';
+ if ($base eq 'git') {
+ $suffix = '7'; # yuck...
+ }
+ print "$base.html $base.$suffix : ", join(" ", keys %$included), "\n";
+}
+