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";
12 line: while ( defined($_ = <FILELIST>) ) {
15 #! comment or blank line, skip
16 next line if ( $_ eq "" or /^#/ );
19 #! print STDERR "Processing line: '$_'\n";
22 my @fields = split "\t";
24 warn "Ignoring malformed line $_ in the filelist file.\n";
26 } elsif ( $#fields == 1 ) {
27 #! add an empty flags string
32 print STDERR "File $fields[0]: type '$fields[1]', flags '$fields[2]'\n";
35 #! first column is filename, second is type, third is flags
36 if ( $fields[1] eq "C" ) {
37 $wxCommon{$fields[0]} = $fields[2];
38 } elsif ( $fields[1] eq "G" ) {
39 $wxGeneric{$fields[0]} = $fields[2];
40 } elsif ( $fields[1] eq "M" ) {
41 $wxMSW{$fields[0]} = $fields[2];
42 } elsif ( $fields[1] eq "R" ) {
43 $wxGTK{$fields[0]} = $fields[2];
44 } elsif ( $fields[1] eq "H" ) {
45 $wxHTML{$fields[0]} = $fields[2];
46 } elsif ( $fields[1] eq "U" ) {
47 $wxUNIX{$fields[0]} = $fields[2];
48 } elsif ( $fields[1] eq "I" ) {
49 $wxINCLUDE{$fields[0]} = $fields[2];
51 warn "Unknown file type $fields[1] for $fields[0], ignoring.\n";
58 #! vim:sw=4:ts=4:list:et