summaryrefslogtreecommitdiff
path: root/Documentation/build-docdep.perl
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-11-07 18:21:51 -0800
committerJunio C Hamano <junkio@cox.net>2005-11-07 18:21:51 -0800
commita5ae8e64cfa09cea57cce832c8371818711d94c2 (patch)
tree92e334771c9bfda4c84c915a050d3981b6d923cd /Documentation/build-docdep.perl
parent79f6ac77d90660971d778f2e300935ab16eb26c2 (diff)
downloadgit-a5ae8e64cfa09cea57cce832c8371818711d94c2.tar.gz
Fix documentation dependency generation.
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>
Diffstat (limited to 'Documentation/build-docdep.perl')
-rwxr-xr-xDocumentation/build-docdep.perl28
1 files changed, 28 insertions, 0 deletions
diff --git a/Documentation/build-docdep.perl b/Documentation/build-docdep.perl
new file mode 100755
index 0000000000..dedef765af
--- /dev/null
+++ b/Documentation/build-docdep.perl
@@ -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";
+}
+