]>
Commit | Line | Data |
---|---|---|
f2071dda VZ |
1 | #!############################################################################# |
2 | #! File: filelist.t | |
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 | |
6 | #! Created: 14.07.99 | |
7 | #! Version: $Id$ | |
8 | #!############################################################################# | |
9 | #${ | |
10 | open(FILELIST, "filelist.txt") or die "Can't open filelist file: $!\n"; | |
11 | ||
f2071dda VZ |
12 | line: while ( defined($_ = <FILELIST>) ) { |
13 | chomp; | |
14 | ||
15 | #! comment or blank line, skip | |
16 | next line if ( $_ eq "" or /^#/ ); | |
17 | ||
18 | #! if ( $verbose ) { | |
19 | #! print STDERR "Processing line: '$_'\n"; | |
20 | #! } | |
21 | ||
b9cc8004 VZ |
22 | my @fields = split /\t/; |
23 | ||
24 | #! first column is filename, second is type, third is flags | |
25 | my ($filename, $filetype, $fileflags) = @fields; | |
26 | ||
f2071dda VZ |
27 | if ( $#fields > 2 ) { |
28 | warn "Ignoring malformed line $_ in the filelist file.\n"; | |
29 | next line; | |
30 | } elsif ( $#fields == 1 ) { | |
31 | #! add an empty flags string | |
b9cc8004 | 32 | $fileflags = ""; |
f2071dda VZ |
33 | } |
34 | ||
35 | if ( $verbose ) { | |
b9cc8004 | 36 | print STDERR "File $filename: type '$filetype', flags '$fileflags'\n"; |
f2071dda VZ |
37 | } |
38 | ||
b9cc8004 VZ |
39 | #! this is a bit stupid but all templates are written using the old |
40 | #! single letter flags which became so unreadable that I decided to | |
41 | #! replace them with more readable strings, but it was easier to do | |
42 | #! the translation here instead of changing all *.t files | |
43 | $fileflags =~ s/Base/B/; | |
44 | $fileflags =~ s/NotWin32/16/; | |
45 | $fileflags =~ s/Win32Only/32/; | |
46 | $fileflags =~ s/Generic/G/; | |
47 | $fileflags =~ s/OLE/O/; | |
48 | $fileflags =~ s/Socket/S/; | |
49 | $fileflags =~ s/NotMSW/U/; | |
50 | $fileflags =~ s/NotGTK/R/; | |
51 | $fileflags =~ s/NotX/X/; | |
52 | $fileflags =~ s/NotOS2/P/; | |
53 | $fileflags =~ s/LowLevel/L/; | |
54 | ||
55 | if ( $filetype eq "Common" ) { | |
56 | $wxCommon{$filename} = $fileflags; | |
57 | } elsif ( $filetype eq "Generic" ) { | |
58 | $wxGeneric{$filename} = $fileflags; | |
59 | } elsif ( $filetype eq "MSW" ) { | |
60 | $wxMSW{$filename} = $fileflags; | |
2b03b51b GD |
61 | } elsif ( $filetype eq "Mac" ) { |
62 | $wxMAC{$filename} = $fileflags; | |
b9cc8004 VZ |
63 | } elsif ( $filetype eq "Motif" ) { |
64 | $wxMOTIF{$filename} = $fileflags; | |
65 | } elsif ( $filetype eq "GTK" ) { | |
66 | $wxGTK{$filename} = $fileflags; | |
67 | } elsif ( $filetype eq "Univ" ) { | |
68 | $wxUNIV{$filename} = $fileflags; | |
69 | } elsif ( $filetype eq "MGL" ) { | |
70 | $wxMGL{$filename} = $fileflags; | |
71 | } elsif ( $filetype eq "OS2" ) { | |
72 | $wxOS2PM{$filename} = $fileflags; | |
73 | } elsif ( $filetype eq "HTML" ) { | |
74 | $wxHTML{$filename} = $fileflags; | |
75 | } elsif ( $filetype eq "Unix" ) { | |
76 | $wxUNIX{$filename} = $fileflags; | |
77 | } elsif ( $filetype eq "BaseOnly" ) { | |
78 | $wxBase{$filename} = $fileflags; | |
79 | } elsif ( $filetype eq "WXH" ) { | |
80 | $wxWXINCLUDE{$filename} = $fileflags; | |
81 | } elsif ( $filetype eq "ProtoH" ) { | |
82 | $wxPROTOCOLINCLUDE{$filename} = $fileflags; | |
83 | } elsif ( $filetype eq "HtmlH" ) { | |
84 | $wxHTMLINCLUDE{$filename} = $fileflags; | |
2b03b51b GD |
85 | } elsif ( $filetype eq "MacH" ) { |
86 | $wxMACINCLUDE{$filename} = $fileflags; | |
b9cc8004 VZ |
87 | } elsif ( $filetype eq "MotifH" ) { |
88 | $wxMOTIFINCLUDE{$filename} = $fileflags; | |
89 | } elsif ( $filetype eq "MSWH" ) { | |
90 | $wxMSWINCLUDE{$filename} = $fileflags; | |
91 | } elsif ( $filetype eq "GTKH" ) { | |
92 | $wxGTKINCLUDE{$filename} = $fileflags; | |
93 | } elsif ( $filetype eq "OS2H" ) { | |
94 | $wxOS2PMINCLUDE{$filename} = $fileflags; | |
95 | } elsif ( $filetype eq "UnivH" ) { | |
96 | $wxUNIVINCLUDE{$filename} = $fileflags; | |
97 | } elsif ( $filetype eq "UnixH" ) { | |
98 | $wxUNIXINCLUDE{$filename} = $fileflags; | |
99 | } elsif ( $filetype eq "GenericH" ) { | |
100 | $wxGENERICINCLUDE{$filename} = $fileflags; | |
2b03b51b GD |
101 | } elsif ( $filetype eq "MacR" ) { |
102 | $wxMACRESOURCE{$filename} = $fileflags; | |
f2071dda | 103 | } else { |
b9cc8004 | 104 | warn "Unknown file type $filetype for $filename, ignoring.\n"; |
f2071dda VZ |
105 | next line; |
106 | } | |
107 | } | |
108 | ||
109 | close(FILELIST); | |
110 | #$} | |
111 | #! vim:sw=4:ts=4:list:et |