2013-03-25 12:04:10 +00:00
|
|
|
#!/usr/bin/perl
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
my @sub;
|
|
|
|
push @sub , ".";
|
|
|
|
navigate(".");
|
|
|
|
foreach my $d ( sort @sub )
|
|
|
|
{
|
2014-07-04 13:52:04 +00:00
|
|
|
process($d);
|
2013-03-25 12:04:10 +00:00
|
|
|
}
|
2014-06-18 16:14:01 +00:00
|
|
|
print "EXTRA_DIST=CMakeLists.txt\n\n";
|
2013-03-25 12:04:10 +00:00
|
|
|
print "include \$(DEVEL_RULES)\n";
|
|
|
|
|
|
|
|
sub navigate {
|
|
|
|
my ($dir) = @_;
|
|
|
|
|
|
|
|
opendir(DIR,$dir);
|
|
|
|
foreach my $d ( readdir(DIR) )
|
|
|
|
{
|
|
|
|
next if($d =~ /^\./);
|
|
|
|
|
|
|
|
if(-d "$dir/$d")
|
|
|
|
{
|
|
|
|
push @sub , "$dir/$d";
|
|
|
|
navigate("$dir/$d");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
closedir(DIR);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub process {
|
|
|
|
my ($dir) = @_;
|
|
|
|
my @files;
|
|
|
|
|
|
|
|
opendir(DIR,$dir);
|
|
|
|
foreach my $d ( readdir(DIR) )
|
|
|
|
{
|
|
|
|
next if($d =~ /^\./);
|
|
|
|
|
|
|
|
unless (-d $d) {
|
2014-07-04 13:52:04 +00:00
|
|
|
push @files, $d if($d =~ /\.(txt|list|table|def|grib|sh)$/);
|
2013-03-25 12:04:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
closedir(DIR);
|
|
|
|
|
|
|
|
if(@files)
|
|
|
|
{
|
|
|
|
my $name;
|
|
|
|
|
|
|
|
|
|
|
|
if($dir eq ".")
|
|
|
|
{
|
|
|
|
$name = "";
|
|
|
|
print "#This file is generated by make_makefile_am.pl\n";
|
|
|
|
print "# DON'T EDIT!!!\n";
|
2015-01-24 22:19:32 +00:00
|
|
|
print "definitionsdir = \@ECCODES_DEFINITION_PATH\@\n";
|
2013-03-25 12:04:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$dir =~ s/^\.\///;
|
|
|
|
$name = "$dir";
|
|
|
|
$name =~ s/\W/_/g;
|
2015-01-24 22:19:32 +00:00
|
|
|
print "definitions${name}dir = \@ECCODES_DEFINITION_PATH\@/$dir\n";
|
2013-03-25 12:04:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
print "dist_definitions${name}_DATA = ";
|
|
|
|
|
|
|
|
foreach my $f ( sort @files )
|
|
|
|
{
|
|
|
|
print "\\\n\t$dir/$f";
|
|
|
|
}
|
|
|
|
|
|
|
|
print "\n";
|
|
|
|
print "\n";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|