1 #!#############################################################################
3 #! Purpose: tmake template file containig Perl code to parse the filelist.txt
4 #! file - this is used by all other templates.
5 #! Author: Vadim Zeitlin
8 #!#############################################################################
10 open(FILELIST, "filelist.txt") or die "Can't open filelist file: $!\n";
14 line: while ( defined($_ = <FILELIST>) ) {
17 #! comment or blank line, skip
18 next line if ( $_ eq "" or /^#/ );
21 #! print STDERR "Processing line: '$_'\n";
24 my @fields = split "\t";
26 warn "Ignoring malformed line $_ in the filelist file.\n";
28 } elsif ( $#fields == 1 ) {
29 #! add an empty flags string
34 print STDERR "File $fields[0]: type '$fields[1]', flags '$fields[2]'\n";
37 #! first column is filename, second is type, third is flags
38 if ( $fields[1] eq "C" ) {
39 $wxCommon{$fields[0]} = $fields[2];
40 } elsif ( $fields[1] eq "G" ) {
41 $wxGeneric{$fields[0]} = $fields[2];
42 } elsif ( $fields[1] eq "M" ) {
43 $wxMSW{$fields[0]} = $fields[2];
45 warn "Unknown file type $fields[1] for $fields[0], ignoring.\n";
52 #! vim:sw=4:ts=4:list:et