]>
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 | #${ | |
69c44812 MB |
10 | use lib './lib'; |
11 | use wxFileInfo; | |
12 | ||
f2071dda VZ |
13 | open(FILELIST, "filelist.txt") or die "Can't open filelist file: $!\n"; |
14 | ||
69c44812 MB |
15 | #! maps file types to array names, for example an entry of the form |
16 | #! FooH => 'wxXYZ' means that all files with type "FooH" will be | |
17 | #! added to an array named @wxXYZ | |
18 | my %type_2_array = ( | |
19 | Common => "wxCommon", | |
20 | Generic => "wxGeneric", | |
21 | GenericH => "wxGenericInclude", | |
22 | HTML => "wxHtml", | |
23 | HtmlH => "wxHtmlInclude", | |
24 | Motif => "wxMotif", | |
25 | MotifH => "wxMotifInclude", | |
26 | ProtoH => "wxProtocolInclude", | |
27 | Unix => "wxUnix", | |
28 | UnixH => "wxUnixInclude", | |
29 | WXH => "wxWxInclude", | |
30 | ); | |
31 | ||
f2071dda VZ |
32 | line: while ( defined($_ = <FILELIST>) ) { |
33 | chomp; | |
34 | ||
35 | #! comment or blank line, skip | |
36 | next line if ( $_ eq "" or /^#/ ); | |
37 | ||
38 | #! if ( $verbose ) { | |
7d230413 | 39 | #! print STDERR "Processing line: '$_'\n"; |
f2071dda VZ |
40 | #! } |
41 | ||
b9cc8004 VZ |
42 | my @fields = split /\t/; |
43 | ||
44 | #! first column is filename, second is type, third is flags | |
45 | my ($filename, $filetype, $fileflags) = @fields; | |
46 | ||
f2071dda VZ |
47 | if ( $#fields > 2 ) { |
48 | warn "Ignoring malformed line $_ in the filelist file.\n"; | |
49 | next line; | |
50 | } elsif ( $#fields == 1 ) { | |
51 | #! add an empty flags string | |
b9cc8004 | 52 | $fileflags = ""; |
f2071dda VZ |
53 | } |
54 | ||
55 | if ( $verbose ) { | |
b9cc8004 | 56 | print STDERR "File $filename: type '$filetype', flags '$fileflags'\n"; |
f2071dda VZ |
57 | } |
58 | ||
69c44812 MB |
59 | #! save all information in @wxALL |
60 | my $fileinfo = new wxFileInfo( $filename, $filetype, $fileflags ); | |
61 | push @wxALL, $fileinfo; | |
62 | ||
b9cc8004 VZ |
63 | #! this is a bit stupid but all templates are written using the old |
64 | #! single letter flags which became so unreadable that I decided to | |
65 | #! replace them with more readable strings, but it was easier to do | |
66 | #! the translation here instead of changing all *.t files | |
67 | $fileflags =~ s/Base/B/; | |
68 | $fileflags =~ s/NotWin32/16/; | |
69 | $fileflags =~ s/Win32Only/32/; | |
70 | $fileflags =~ s/Generic/G/; | |
71 | $fileflags =~ s/OLE/O/; | |
72 | $fileflags =~ s/Socket/S/; | |
73 | $fileflags =~ s/NotMSW/U/; | |
b9cc8004 VZ |
74 | $fileflags =~ s/NotOS2/P/; |
75 | $fileflags =~ s/LowLevel/L/; | |
17a2362b | 76 | $fileflags =~ s/Theme/T/; |
b9cc8004 VZ |
77 | |
78 | if ( $filetype eq "Common" ) { | |
79 | $wxCommon{$filename} = $fileflags; | |
80 | } elsif ( $filetype eq "Generic" ) { | |
81 | $wxGeneric{$filename} = $fileflags; | |
82 | } elsif ( $filetype eq "MSW" ) { | |
83 | $wxMSW{$filename} = $fileflags; | |
2b03b51b GD |
84 | } elsif ( $filetype eq "Mac" ) { |
85 | $wxMAC{$filename} = $fileflags; | |
b9cc8004 VZ |
86 | } elsif ( $filetype eq "Motif" ) { |
87 | $wxMOTIF{$filename} = $fileflags; | |
88 | } elsif ( $filetype eq "GTK" ) { | |
89 | $wxGTK{$filename} = $fileflags; | |
90 | } elsif ( $filetype eq "Univ" ) { | |
91 | $wxUNIV{$filename} = $fileflags; | |
92 | } elsif ( $filetype eq "MGL" ) { | |
93 | $wxMGL{$filename} = $fileflags; | |
1725144d RR |
94 | } elsif ( $filetype eq "Micro" ) { |
95 | $wxMICRO{$filename} = $fileflags; | |
b9cc8004 VZ |
96 | } elsif ( $filetype eq "OS2" ) { |
97 | $wxOS2PM{$filename} = $fileflags; | |
7c7b95f4 JS |
98 | } elsif ( $filetype eq "X11" ) { |
99 | $wxX11{$filename} = $fileflags; | |
b9cc8004 VZ |
100 | } elsif ( $filetype eq "HTML" ) { |
101 | $wxHTML{$filename} = $fileflags; | |
102 | } elsif ( $filetype eq "Unix" ) { | |
103 | $wxUNIX{$filename} = $fileflags; | |
104 | } elsif ( $filetype eq "BaseOnly" ) { | |
105 | $wxBase{$filename} = $fileflags; | |
106 | } elsif ( $filetype eq "WXH" ) { | |
107 | $wxWXINCLUDE{$filename} = $fileflags; | |
108 | } elsif ( $filetype eq "ProtoH" ) { | |
109 | $wxPROTOCOLINCLUDE{$filename} = $fileflags; | |
110 | } elsif ( $filetype eq "HtmlH" ) { | |
111 | $wxHTMLINCLUDE{$filename} = $fileflags; | |
2b03b51b GD |
112 | } elsif ( $filetype eq "MacH" ) { |
113 | $wxMACINCLUDE{$filename} = $fileflags; | |
b9cc8004 VZ |
114 | } elsif ( $filetype eq "MotifH" ) { |
115 | $wxMOTIFINCLUDE{$filename} = $fileflags; | |
f676c7ff MB |
116 | } elsif ( $filetype eq "MSWH" && $fileflags =~ m/O/ ) { |
117 | $wxOLEINCLUDE{$filename} = $fileflags; | |
b9cc8004 VZ |
118 | } elsif ( $filetype eq "MSWH" ) { |
119 | $wxMSWINCLUDE{$filename} = $fileflags; | |
120 | } elsif ( $filetype eq "GTKH" ) { | |
121 | $wxGTKINCLUDE{$filename} = $fileflags; | |
122 | } elsif ( $filetype eq "OS2H" ) { | |
123 | $wxOS2PMINCLUDE{$filename} = $fileflags; | |
2b5f62a0 VZ |
124 | } elsif ( $filetype eq "MGLH" ) { |
125 | $wxMGLINCLUDE{$filename} = $fileflags; | |
7c7b95f4 JS |
126 | } elsif ( $filetype eq "X11H" ) { |
127 | $wxX11INCLUDE{$filename} = $fileflags; | |
b9cc8004 VZ |
128 | } elsif ( $filetype eq "UnivH" ) { |
129 | $wxUNIVINCLUDE{$filename} = $fileflags; | |
130 | } elsif ( $filetype eq "UnixH" ) { | |
131 | $wxUNIXINCLUDE{$filename} = $fileflags; | |
132 | } elsif ( $filetype eq "GenericH" ) { | |
133 | $wxGENERICINCLUDE{$filename} = $fileflags; | |
2b03b51b GD |
134 | } elsif ( $filetype eq "MacR" ) { |
135 | $wxMACRESOURCE{$filename} = $fileflags; | |
f2071dda | 136 | } else { |
b9cc8004 | 137 | warn "Unknown file type $filetype for $filename, ignoring.\n"; |
f2071dda VZ |
138 | next line; |
139 | } | |
140 | } | |
141 | ||
142 | close(FILELIST); | |
143 | #$} | |
7d230413 | 144 | #! vim:sw=4:ts=4:list:et:ft=perl |