Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Saturday, December 7, 2019

File: [Platon] / doc / diplomova-praca-rajo / generate-depend (download)

Revision 1.1, Thu Jul 24 17:50:07 2003 UTC (16 years, 4 months ago) by rajo

Diploma Thesis of Lubomir Host.
Title: Metoda Monte Carlo vo fyzike nizkoteplotnej plazmy. (Slovak language)

#!/usr/bin/perl

print "##\n";
print "## image-depend - generate dependencies for images.\n";
print "##                Images are created by 'gnuplot'\n";
print "##                from *.gpi input files\n";
print "##\n";
print "## Developed by Lubomir Host 'rajo' <rajo AT platon.sk>\n";
print "## Copyright (c) 2003 Platon SDG\n";
print "## Licensed under terms of GNU General Public License.\n";
print "## All rights reserved.\n";
print "##\n\n";
print "## \$Platon\$\n";

@ARGV = ('/dev/stdin') unless @ARGV;

$prefix     = "images";
$input_patt = '^.*\.gpi$';
$pattern    = '^.*\.dat$';
$rule       = "\@echo '---- \$\@: \$?'\n    touch \$@";

$used_files = "";

#printf STDERR "Processing files: ";
for $input ( @ARGV ) {
#    printf STDERR "$input ";
    if ($input =~ /$input_patt/) {
        open $INPUT, "<$input"  or die "can't open file '$input': $!";
        $line = 1;

        print "\n$input: ";
        while (<$INPUT>) {

            chop;
            next if (m/^#/);    # ignore comments
            
            foreach my $file (split "\"", $_) {
                #print "Testing '$file'\n";
                if ($file =~ /$pattern/ && -f "$prefix/$file" ) {
                    #print "\\\n    # line $line\n";
                    print "\\\n    $prefix/$file ";
                    $used_files .= "# USED: $prefix/$file\n"
                }
            }
            $line++;
        }
        print "\n    $rule\n";
        close ($INPUT);
    }
}

print "#########################\n";
print "# Used files:\n";
print $used_files;
print "\n# End of dependencies\n";
print "# vim: ft=make\n";

# Next lines are needed




# vim: ft=perl

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top