avformat/mpeg: demux ivtv captions
[ffmpeg.git] / doc / texidep.pl
blob33e6c7c53e370b43880f7ecbf901534fb58e8a11
1 #!/usr/bin/env perl
3 # This script will print the dependency of a Texinfo file to stdout.
4 # texidep.pl <src-path> <input.texi> <output.ext>
6 use warnings;
7 use strict;
9 die unless @ARGV == 3;
11 my ($src_path, $root, $target) = @ARGV;
13 sub print_deps {
14 my ($file, $deps) = @_;
15 $deps->{$file} = 1;
17 open(my $fh, "<", "$file") or die "Cannot open file '$file': $!";
18 while (<$fh>) {
19 if (my ($i) = /^\@(?:verbatim)?include\s+(\S+)/) {
20 die "Circular dependency found in file $root\n" if exists $deps->{"doc/$1"};
21 print "$target: doc/$1\n";
23 # skip looking for config.texi dependencies, since it has
24 # none, and is not located in the source tree
25 if ("$1" ne "config.texi") {
26 print_deps("$src_path/doc/$1", {%$deps});
32 print_deps($root, {});