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