ChainMake

 view release on metacpan or  search on metacpan

example/example-latex.pl  view on Meta::CPAN

);

target 'example.dvi', (
    timestamps   => ['$t_name'],
    requirements => ['$t_base.tex'],
    handler => sub {
        my ($t_name,$t_base,$t_ext)=@_;
        my $rerun=1;
        my ($multiply_defined_labels,$undefined_references,$font_shapes_not_available);
        while ($rerun) {
	        print "> latex -interaction=batchmode $t_base.tex\n";
	        $rerun=0;
	        $multiply_defined_labels=0;
	        my $output=`latex $t_base.tex`;
            $rerun=1 if ($output =~ /LaTeX Warning: Label\(s\) may have changed/);
	        $multiply_defined_labels=1 if ($output =~ /LaTeX Warning: There were multiply-defined labels/);
	        $undefined_references=1 if ($output =~ /LaTeX Warning: There were undefined references/);
	        $font_shapes_not_available=1 if ($output =~ /LaTeX Font Warning: Some font shapes were not available/)
        }
        print STDOUT "Warning: There were undefined references.\n" if ($undefined_references);
        print STDOUT "Warning: Some font shapes were not available.\n" if ($font_shapes_not_available);



( run in 0.586 second using v1.01-cache-2.11-cpan-496ff517765 )