]> git.saurik.com Git - wxWidgets.git/blame - distrib/msw/tmake/filelist.t
Script tweak
[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#${
632cfe57 10 use lib './lib';
69c44812
MB
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;
01ba8b39
DE
86 } elsif ( $filetype eq "Cocoa" ) {
87 $wxCOCOA{$filename} = $fileflags;
b9cc8004
VZ
88 } elsif ( $filetype eq "Motif" ) {
89 $wxMOTIF{$filename} = $fileflags;
90 } elsif ( $filetype eq "GTK" ) {
91 $wxGTK{$filename} = $fileflags;
92 } elsif ( $filetype eq "Univ" ) {
93 $wxUNIV{$filename} = $fileflags;
94 } elsif ( $filetype eq "MGL" ) {
95 $wxMGL{$filename} = $fileflags;
1725144d
RR
96 } elsif ( $filetype eq "Micro" ) {
97 $wxMICRO{$filename} = $fileflags;
b9cc8004
VZ
98 } elsif ( $filetype eq "OS2" ) {
99 $wxOS2PM{$filename} = $fileflags;
7c7b95f4
JS
100 } elsif ( $filetype eq "X11" ) {
101 $wxX11{$filename} = $fileflags;
b9cc8004
VZ
102 } elsif ( $filetype eq "HTML" ) {
103 $wxHTML{$filename} = $fileflags;
104 } elsif ( $filetype eq "Unix" ) {
105 $wxUNIX{$filename} = $fileflags;
106 } elsif ( $filetype eq "BaseOnly" ) {
107 $wxBase{$filename} = $fileflags;
108 } elsif ( $filetype eq "WXH" ) {
109 $wxWXINCLUDE{$filename} = $fileflags;
110 } elsif ( $filetype eq "ProtoH" ) {
111 $wxPROTOCOLINCLUDE{$filename} = $fileflags;
112 } elsif ( $filetype eq "HtmlH" ) {
113 $wxHTMLINCLUDE{$filename} = $fileflags;
2b03b51b
GD
114 } elsif ( $filetype eq "MacH" ) {
115 $wxMACINCLUDE{$filename} = $fileflags;
01ba8b39
DE
116 } elsif ( $filetype eq "CocoaH" ) {
117 $wxCOCOAINCLUDE{$filename} = $fileflags;
b9cc8004
VZ
118 } elsif ( $filetype eq "MotifH" ) {
119 $wxMOTIFINCLUDE{$filename} = $fileflags;
f676c7ff
MB
120 } elsif ( $filetype eq "MSWH" && $fileflags =~ m/O/ ) {
121 $wxOLEINCLUDE{$filename} = $fileflags;
b9cc8004
VZ
122 } elsif ( $filetype eq "MSWH" ) {
123 $wxMSWINCLUDE{$filename} = $fileflags;
124 } elsif ( $filetype eq "GTKH" ) {
125 $wxGTKINCLUDE{$filename} = $fileflags;
126 } elsif ( $filetype eq "OS2H" ) {
127 $wxOS2PMINCLUDE{$filename} = $fileflags;
2b5f62a0
VZ
128 } elsif ( $filetype eq "MGLH" ) {
129 $wxMGLINCLUDE{$filename} = $fileflags;
7c7b95f4
JS
130 } elsif ( $filetype eq "X11H" ) {
131 $wxX11INCLUDE{$filename} = $fileflags;
b9cc8004
VZ
132 } elsif ( $filetype eq "UnivH" ) {
133 $wxUNIVINCLUDE{$filename} = $fileflags;
134 } elsif ( $filetype eq "UnixH" ) {
135 $wxUNIXINCLUDE{$filename} = $fileflags;
136 } elsif ( $filetype eq "GenericH" ) {
137 $wxGENERICINCLUDE{$filename} = $fileflags;
2b03b51b
GD
138 } elsif ( $filetype eq "MacR" ) {
139 $wxMACRESOURCE{$filename} = $fileflags;
01ba8b39
DE
140 } elsif ( $filetype eq "CocoaR" ) {
141 $wxCOCOARESOURCE{$filename} = $fileflags;
f2071dda 142 } else {
b9cc8004 143 warn "Unknown file type $filetype for $filename, ignoring.\n";
f2071dda
VZ
144 next line;
145 }
146 }
147
148 close(FILELIST);
149#$}
7d230413 150#! vim:sw=4:ts=4:list:et:ft=perl