]> git.saurik.com Git - wxWidgets.git/blob - distrib/msw/tmake/filelist.t
More details about the internal module name changes
[wxWidgets.git] / distrib / msw / tmake / filelist.t
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 use lib './lib';
11 use wxFileInfo;
12
13 open(FILELIST, "filelist.txt") or die "Can't open filelist file: $!\n";
14
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
32 line: while ( defined($_ = <FILELIST>) ) {
33 chomp;
34
35 #! comment or blank line, skip
36 next line if ( $_ eq "" or /^#/ );
37
38 #! if ( $verbose ) {
39 #! print STDERR "Processing line: '$_'\n";
40 #! }
41
42 my @fields = split /\t/;
43
44 #! first column is filename, second is type, third is flags
45 my ($filename, $filetype, $fileflags) = @fields;
46
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
52 $fileflags = "";
53 }
54
55 if ( $verbose ) {
56 print STDERR "File $filename: type '$filetype', flags '$fileflags'\n";
57 }
58
59 #! save all information in @wxALL
60 my $fileinfo = new wxFileInfo( $filename, $filetype, $fileflags );
61 push @wxALL, $fileinfo;
62
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/;
74 $fileflags =~ s/NotOS2/P/;
75 $fileflags =~ s/LowLevel/L/;
76 $fileflags =~ s/Theme/T/;
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;
84 } elsif ( $filetype eq "Mac" ) {
85 $wxMAC{$filename} = $fileflags;
86 } elsif ( $filetype eq "Cocoa" ) {
87 $wxCOCOA{$filename} = $fileflags;
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;
96 } elsif ( $filetype eq "Micro" ) {
97 $wxMICRO{$filename} = $fileflags;
98 } elsif ( $filetype eq "OS2" ) {
99 $wxOS2PM{$filename} = $fileflags;
100 } elsif ( $filetype eq "X11" ) {
101 $wxX11{$filename} = $fileflags;
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;
114 } elsif ( $filetype eq "MacH" ) {
115 $wxMACINCLUDE{$filename} = $fileflags;
116 } elsif ( $filetype eq "CocoaH" ) {
117 $wxCOCOAINCLUDE{$filename} = $fileflags;
118 } elsif ( $filetype eq "MotifH" ) {
119 $wxMOTIFINCLUDE{$filename} = $fileflags;
120 } elsif ( $filetype eq "MSWH" && $fileflags =~ m/O/ ) {
121 $wxOLEINCLUDE{$filename} = $fileflags;
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;
128 } elsif ( $filetype eq "MGLH" ) {
129 $wxMGLINCLUDE{$filename} = $fileflags;
130 } elsif ( $filetype eq "X11H" ) {
131 $wxX11INCLUDE{$filename} = $fileflags;
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;
138 } elsif ( $filetype eq "MacR" ) {
139 $wxMACRESOURCE{$filename} = $fileflags;
140 } elsif ( $filetype eq "CocoaR" ) {
141 $wxCOCOARESOURCE{$filename} = $fileflags;
142 } else {
143 warn "Unknown file type $filetype for $filename, ignoring.\n";
144 next line;
145 }
146 }
147
148 close(FILELIST);
149 #$}
150 #! vim:sw=4:ts=4:list:et:ft=perl