]>
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/; | |
7c7b95f4 | 51 | $fileflags =~ s/NotX11/X11/; |
b9cc8004 VZ |
52 | $fileflags =~ s/NotX/X/; |
53 | $fileflags =~ s/NotOS2/P/; | |
54 | $fileflags =~ s/LowLevel/L/; | |
55 | ||
56 | if ( $filetype eq "Common" ) { | |
57 | $wxCommon{$filename} = $fileflags; | |
58 | } elsif ( $filetype eq "Generic" ) { | |
59 | $wxGeneric{$filename} = $fileflags; | |
60 | } elsif ( $filetype eq "MSW" ) { | |
61 | $wxMSW{$filename} = $fileflags; | |
2b03b51b GD |
62 | } elsif ( $filetype eq "Mac" ) { |
63 | $wxMAC{$filename} = $fileflags; | |
b9cc8004 VZ |
64 | } elsif ( $filetype eq "Motif" ) { |
65 | $wxMOTIF{$filename} = $fileflags; | |
66 | } elsif ( $filetype eq "GTK" ) { | |
67 | $wxGTK{$filename} = $fileflags; | |
68 | } elsif ( $filetype eq "Univ" ) { | |
69 | $wxUNIV{$filename} = $fileflags; | |
70 | } elsif ( $filetype eq "MGL" ) { | |
71 | $wxMGL{$filename} = $fileflags; | |
1725144d RR |
72 | } elsif ( $filetype eq "Micro" ) { |
73 | $wxMICRO{$filename} = $fileflags; | |
b9cc8004 VZ |
74 | } elsif ( $filetype eq "OS2" ) { |
75 | $wxOS2PM{$filename} = $fileflags; | |
7c7b95f4 JS |
76 | } elsif ( $filetype eq "X11" ) { |
77 | $wxX11{$filename} = $fileflags; | |
b9cc8004 VZ |
78 | } elsif ( $filetype eq "HTML" ) { |
79 | $wxHTML{$filename} = $fileflags; | |
80 | } elsif ( $filetype eq "Unix" ) { | |
81 | $wxUNIX{$filename} = $fileflags; | |
82 | } elsif ( $filetype eq "BaseOnly" ) { | |
83 | $wxBase{$filename} = $fileflags; | |
84 | } elsif ( $filetype eq "WXH" ) { | |
85 | $wxWXINCLUDE{$filename} = $fileflags; | |
86 | } elsif ( $filetype eq "ProtoH" ) { | |
87 | $wxPROTOCOLINCLUDE{$filename} = $fileflags; | |
88 | } elsif ( $filetype eq "HtmlH" ) { | |
89 | $wxHTMLINCLUDE{$filename} = $fileflags; | |
2b03b51b GD |
90 | } elsif ( $filetype eq "MacH" ) { |
91 | $wxMACINCLUDE{$filename} = $fileflags; | |
b9cc8004 VZ |
92 | } elsif ( $filetype eq "MotifH" ) { |
93 | $wxMOTIFINCLUDE{$filename} = $fileflags; | |
f676c7ff MB |
94 | } elsif ( $filetype eq "MSWH" && $fileflags =~ m/O/ ) { |
95 | $wxOLEINCLUDE{$filename} = $fileflags; | |
b9cc8004 VZ |
96 | } elsif ( $filetype eq "MSWH" ) { |
97 | $wxMSWINCLUDE{$filename} = $fileflags; | |
98 | } elsif ( $filetype eq "GTKH" ) { | |
99 | $wxGTKINCLUDE{$filename} = $fileflags; | |
100 | } elsif ( $filetype eq "OS2H" ) { | |
101 | $wxOS2PMINCLUDE{$filename} = $fileflags; | |
7c7b95f4 JS |
102 | } elsif ( $filetype eq "X11H" ) { |
103 | $wxX11INCLUDE{$filename} = $fileflags; | |
b9cc8004 VZ |
104 | } elsif ( $filetype eq "UnivH" ) { |
105 | $wxUNIVINCLUDE{$filename} = $fileflags; | |
106 | } elsif ( $filetype eq "UnixH" ) { | |
107 | $wxUNIXINCLUDE{$filename} = $fileflags; | |
108 | } elsif ( $filetype eq "GenericH" ) { | |
109 | $wxGENERICINCLUDE{$filename} = $fileflags; | |
2b03b51b GD |
110 | } elsif ( $filetype eq "MacR" ) { |
111 | $wxMACRESOURCE{$filename} = $fileflags; | |
f2071dda | 112 | } else { |
b9cc8004 | 113 | warn "Unknown file type $filetype for $filename, ignoring.\n"; |
f2071dda VZ |
114 | next line; |
115 | } | |
116 | } | |
117 | ||
118 | close(FILELIST); | |
119 | #$} | |
120 | #! vim:sw=4:ts=4:list:et |