]> git.saurik.com Git - wxWidgets.git/blame_incremental - distrib/msw/tmake/filelist.t
Get rid of this file
[wxWidgets.git] / distrib / msw / tmake / filelist.t
... / ...
CommitLineData
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#! prepackaged tmake.exe does not have lib.pm
11#! use lib './lib';
12 BEGIN { unshift @INC, './lib' }
13 use wxFileInfo;
14
15 open(FILELIST, "filelist.txt") or die "Can't open filelist file: $!\n";
16
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
34 line: while ( defined($_ = <FILELIST>) ) {
35 chomp;
36
37 #! comment or blank line, skip
38 next line if ( $_ eq "" or /^#/ );
39
40 #! if ( $verbose ) {
41 #! print STDERR "Processing line: '$_'\n";
42 #! }
43
44 my @fields = split /\t/;
45
46 #! first column is filename, second is type, third is flags
47 my ($filename, $filetype, $fileflags) = @fields;
48
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
54 $fileflags = "";
55 }
56
57 if ( $verbose ) {
58 print STDERR "File $filename: type '$filetype', flags '$fileflags'\n";
59 }
60
61 #! save all information in @wxALL
62 my $fileinfo = new wxFileInfo( $filename, $filetype, $fileflags );
63 push @wxALL, $fileinfo;
64
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/;
76 $fileflags =~ s/NotOS2/P/;
77 $fileflags =~ s/LowLevel/L/;
78 $fileflags =~ s/Theme/T/;
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;
86 } elsif ( $filetype eq "Mac" ) {
87 $wxMAC{$filename} = $fileflags;
88 } elsif ( $filetype eq "Cocoa" ) {
89 $wxCOCOA{$filename} = $fileflags;
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;
98 } elsif ( $filetype eq "Micro" ) {
99 $wxMICRO{$filename} = $fileflags;
100 } elsif ( $filetype eq "OS2" ) {
101 $wxOS2PM{$filename} = $fileflags;
102 } elsif ( $filetype eq "X11" ) {
103 $wxX11{$filename} = $fileflags;
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;
116 } elsif ( $filetype eq "MacH" ) {
117 $wxMACINCLUDE{$filename} = $fileflags;
118 } elsif ( $filetype eq "CocoaH" ) {
119 $wxCOCOAINCLUDE{$filename} = $fileflags;
120 } elsif ( $filetype eq "MotifH" ) {
121 $wxMOTIFINCLUDE{$filename} = $fileflags;
122 } elsif ( $filetype eq "MSWH" && $fileflags =~ m/O/ ) {
123 $wxOLEINCLUDE{$filename} = $fileflags;
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;
130 } elsif ( $filetype eq "MGLH" ) {
131 $wxMGLINCLUDE{$filename} = $fileflags;
132 } elsif ( $filetype eq "X11H" ) {
133 $wxX11INCLUDE{$filename} = $fileflags;
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;
140 } elsif ( $filetype eq "MacR" ) {
141 $wxMACRESOURCE{$filename} = $fileflags;
142 } elsif ( $filetype eq "CocoaR" ) {
143 $wxCOCOARESOURCE{$filename} = $fileflags;
144 } else {
145 warn "Unknown file type $filetype for $filename, ignoring.\n";
146 next line;
147 }
148 }
149
150 close(FILELIST);
151#$}
152#! vim:sw=4:ts=4:list:et:ft=perl