Include a pre-rendered pdf version
[dirac-spec-errata.git] / tools / mkdep.pl
blob0ba038ceaa0dd2260a8332fdc672a99021740a91
1 #!/usr/bin/perl
4 use strict;
6 my $file;
7 my $extnext;
8 my @texfiles;
10 foreach my $name (@ARGV) {
11 my @files;
12 my $basename = $name;
13 $basename =~ s/\.tex$//;
14 open FH, "<$basename.log";
15 while (<FH>) {
16 $file = $1 if (m/^! LaTeX Error: File `(.+)' not found.$/);
17 if (m/^I could not locate the file with any of these extensions:$/) {
18 $extnext = 1;
19 next;
22 if ($extnext == 1) {
23 $extnext = 0;
24 $file .= (split /,/)[0];
25 push @files, $file;
26 $file = undef;
29 close FH;
31 open FH, "<$basename.fls";
32 while (<FH>) {
33 if (m/^INPUT \.\/(.+\.tex)$/) {
34 push @files, $1 unless ($1 eq $name);
35 push @texfiles, $1;
39 $"=" ";
41 print "$basename.dvi: @files\n";
44 print ".depends: @texfiles\n";