3 # This script will print the dependency of a Texinfo file to stdout.
4 # texidep.pl <src-path> <input.texi> <output.ext>
11 my ($src_path, $root, $target) = @ARGV;
14 my ($file, $deps) = @_;
17 open(my $fh, "<", "$file") or die "Cannot open file '$file': $!";
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, {});