open-zwave/makedist

41 lines
954 B
Text
Raw Permalink Normal View History

2014-02-14 13:46:51 +00:00
#!/usr/bin/perl
use strict;
use XML::Simple;
use Data::Dumper;
use File::Basename;
use List::Util 1.33 'any';
2014-02-14 13:46:51 +00:00
2015-03-18 16:47:48 +08:00
my $input = ".distfiles";
my $output = "distfiles.mk";
2014-02-14 13:46:51 +00:00
my @excludedir = (".github");
my @excludefile = ();
2015-03-18 16:47:48 +08:00
open( my $fh => $input) || die "Cannot open $input: $!";
open( my $oh, ">", $output) || die "Cannot open $output: $!";
2014-02-14 13:46:51 +00:00
2015-03-18 16:47:48 +08:00
print $oh "# This File is automatically generated by make dist-update\n";
print $oh "# Any Edits on this file will be lost next time dist-update is run\n";
print $oh "\n";
print $oh "DISTFILES =\t";
while(my $line = <$fh>) {
chomp($line);
my $dir = dirname($line);
if (any {/^$dir$/} @excludedir)
{
print "Excluded File $line - (Directory Excluded)\n";
next;
}
if (any {/^$line$/} @excludefile)
{
print "Excluded File $line - (File Excluded)\n";
next;
}
2015-03-18 16:47:48 +08:00
print $oh $line." \\\n\t";
2014-02-14 13:46:51 +00:00
}
2015-03-18 16:47:48 +08:00
print $oh "cpp/src/vers.cpp\n";
close($oh);
close($fh);
2014-02-14 13:46:51 +00:00