]> git.saurik.com Git - wxWidgets.git/blob - distrib/msw/tmake/wat.t
2782c9ae5d65988576285eec527df6e498536c8c
[wxWidgets.git] / distrib / msw / tmake / wat.t
1 #!#############################################################################
2 #! File: wat.t
3 #! Purpose: tmake template file from which makefile.wat is generated by running
4 #! tmake -t wat wxwin.pro -o makefile.wat
5 #! Author: Vadim Zeitlin
6 #! Created: 14.07.99
7 #! Version: $Id$
8 #!#############################################################################
9 #${
10 #! include the code which parses filelist.txt file and initializes
11 #! %wxCommon, %wxGeneric and %wxMSW hashes.
12 IncludeTemplate("filelist.t");
13
14 #! now transform these hashes into $project tags
15 foreach $file (sort keys %wxGeneric) {
16 my $tag = "";
17 if ( $wxGeneric{$file} =~ /\b(PS|G|16|U)\b/ ) {
18 $tag = "WXNONESSENTIALOBJS";
19 }
20 else {
21 $tag = "WXGENERICOBJS";
22 }
23
24 $file =~ s/cp?p?$/obj/;
25 $project{$tag} .= $file . " "
26 }
27
28 foreach $file (sort keys %wxHTML) {
29 next if $wxHTML{$file} =~ /\b16\b/;
30
31 $file =~ s/cp?p?$/obj/;
32 $project{"WXHTMLOBJS"} .= $file . " "
33 }
34
35 foreach $file (sort keys %wxCommon) {
36 next if $wxCommon{$file} =~ /\b(16|U)\b/;
37
38 $isCFile = $file =~ /\.c$/;
39 $file =~ s/cp?p?$/obj/;
40 $project{"WXCOMMONOBJS"} .= $file . " ";
41 $project{"WXCOBJS"} .= $file . " " if $isCFile;
42 }
43
44 foreach $file (sort keys %wxMSW) {
45 #! these files don't compile
46 next if $file =~ /^pnghand\./;
47
48 next if $wxMSW{$file} =~ /\b16\b/;
49
50 my $isOleObj = $wxMSW{$file} =~ /\bO\b/;
51 my $isCFile = $file =~ /\.c$/;
52 $file =~ s/cp?p?$/obj/;
53 $project{"WXMSWOBJS"} .= $file . " ";
54 $project{"WXCOBJS"} .= $file . " " if $isCFile;
55 $project{"WXOLEOBJS"} .= $file . " " if $isOleObj
56 }
57 #$}
58 #! an attempt to embed '#' directly in the string somehow didn't work...
59 #$ $text = chr(35) . '!/binb/wmake.exe';
60
61 # This file was automatically generated by tmake
62 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE WAT.T!
63
64 #
65 # File: makefile.wat
66 # Author: Julian Smart
67 # Created: 1998
68 #
69 # Makefile : Builds wxWindows library for Watcom C++, WIN32
70 !include ..\makewat.env
71
72 LIBTARGET = $(WXDIR)\lib\$(LIBNAME).lib
73
74 EXTRATARGETS = png zlib jpeg tiff regex
75 EXTRATARGETSCLEAN = clean_png clean_zlib clean_jpeg clean_tiff clean_regex
76 GENDIR=$(WXDIR)\src\generic
77 COMMDIR=$(WXDIR)\src\common
78 JPEGDIR=$(WXDIR)\src\jpeg
79 TIFFDIR=$(WXDIR)\src\tiff
80 MSWDIR=$(WXDIR)\src\msw
81 OLEDIR=$(MSWDIR)\ole
82 HTMLDIR=$(WXDIR)\src\html
83
84 DOCDIR = $(WXDIR)\docs
85
86 GENERICOBJS= #$ ExpandGlue("WXGENERICOBJS", "\$(OUTPUTDIR)\\", " &\n\t\$(OUTPUTDIR)\\")
87
88 # These are generic things that don't need to be compiled on MSW,
89 # but sometimes it's useful to do so for testing purposes.
90 NONESSENTIALOBJS= #$ ExpandGlue("WXNONESSENTIALOBJS", "\$(OUTPUTDIR)\\", " &\n\t\$(OUTPUTDIR)\\")
91
92 COMMONOBJS = &
93 #$ ExpandGlue("WXCOMMONOBJS", "\$(OUTPUTDIR)\\", " &\n\t\$(OUTPUTDIR)\\")
94
95 MSWOBJS = #$ ExpandGlue("WXMSWOBJS", "\$(OUTPUTDIR)\\", " &\n\t\$(OUTPUTDIR)\\")
96
97 HTMLOBJS = #$ ExpandGlue("WXHTMLOBJS", "\$(OUTPUTDIR)\\", " &\n\t\$(OUTPUTDIR)\\")
98
99 # Add $(NONESSENTIALOBJS) if wanting generic dialogs, PostScript etc.
100 OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS) $(HTMLOBJS)
101
102 SETUP_H=$(ARCHINCDIR)\wx\setup.h
103
104 all: $(SETUP_H) $(OUTPUTDIR) $(OBJECTS) $(LIBTARGET) $(EXTRATARGETS) .SYMBOLIC
105
106 $(ARCHINCDIR)\wx:
107 mkdir $(ARCHINCDIR)
108 mkdir $(ARCHINCDIR)\wx
109
110 $(OUTPUTDIR):
111 @if not exist $^@ mkdir $^@
112
113 $(SETUP_H): $(WXDIR)\include\wx\msw\setup.h $(ARCHINCDIR)\wx
114 copy $(WXDIR)\include\wx\msw\setup.h $@
115
116 LBCFILE=wx$(TOOLKIT).lbc
117 $(LIBTARGET) : $(OBJECTS)
118 %create $(LBCFILE)
119 @for %i in ( $(OBJECTS) ) do @%append $(LBCFILE) +%i
120 wlib /b /c /n $(LIBPAGESIZE) $^@ @$(LBCFILE)
121
122
123 clean: .SYMBOLIC $(EXTRATARGETSCLEAN)
124 -erase *.obj
125 -erase $(LIBTARGET)
126 -erase *.pch
127 -erase *.err
128 -erase *.lbc
129
130 cleanall: clean
131
132 #${
133 $_ = $project{"WXMSWOBJS"};
134 my @objs = split;
135 foreach (@objs) {
136 $text .= "\$(OUTPUTDIR)\\" . $_ . ': $(';
137 s/\.obj$//;
138 if ( $project{"WXOLEOBJS"} =~ /\b\Q$_\E\b/ ) {
139 $text .= 'OLEDIR)\\';
140 } else {
141 $text .= 'MSWDIR)\\';
142 }
143 my $suffix, $cc;
144 if ( $project{"WXCOBJS"} =~ /\b\Q$_\E\b/ ) {
145 $suffix = "c";
146 $cc="CC";
147 $flags="CFLAGS";
148 }
149 else {
150 $suffix = "cpp";
151 $cc="CXX";
152 $flags="CXXFLAGS";
153 }
154 $text .= $_ . ".$suffix\n" .
155 " *\$($cc) \$($flags) \$<" . "\n\n";
156 }
157 #$}
158
159 ########################################################
160 # Common objects (always compiled)
161
162 #${
163 $_ = $project{"WXCOMMONOBJS"};
164 my @objs = split;
165 foreach (@objs) {
166 $text .= "\$(OUTPUTDIR)\\" . $_;
167 s/\.obj$//;
168 $text .= ': $(COMMDIR)\\';
169 my $suffix, $cc;
170 if ( $project{"WXCOBJS"} =~ /\b\Q$_\E\b/ ) {
171 $suffix = "c";
172 $cc="CC";
173 $flags="CFLAGS";
174 }
175 else {
176 $suffix = "cpp";
177 $cc="CXX";
178 $flags="CXXFLAGS";
179 }
180 $text .= $_ . ".$suffix\n" .
181 " *\$($cc) \$($flags) \$<" . "\n\n";
182 }
183 #$}
184
185 ########################################################
186 # Generic objects (not always compiled, depending on
187 # whether platforms have native implementations)
188
189 #${
190 $_ = $project{"WXGENERICOBJS"};
191 my @objs = split;
192 foreach (@objs) {
193 $text .= "\$(OUTPUTDIR)\\" . $_;
194 s/\.obj$//;
195 $text .= ': $(GENDIR)\\';
196 $text .= $_ . ".cpp\n" .
197 ' *$(CXX) $(CXXFLAGS) $<' . "\n\n";
198 }
199 #$}
200
201
202 ########################################################
203 # HTML objects (always compiled)
204
205 #${
206 $_ = $project{"WXHTMLOBJS"};
207 my @objs = split;
208 foreach (@objs) {
209 $text .= "\$(OUTPUTDIR)\\" . $_;
210 s/\.obj$//;
211 $text .= ': $(HTMLDIR)\\';
212 $text .= $_ . ".cpp\n" .
213 ' *$(CXX) $(CXXFLAGS) $<' . "\n\n";
214 }
215 #$}
216
217 png: .SYMBOLIC
218 cd $(WXDIR)\src\png
219 wmake -f makefile.wat all
220 cd $(WXDIR)\src\msw
221
222 clean_png: .SYMBOLIC
223 cd $(WXDIR)\src\png
224 wmake -f makefile.wat clean
225 cd $(WXDIR)\src\msw
226
227 zlib: .SYMBOLIC
228 cd $(WXDIR)\src\zlib
229 wmake -f makefile.wat all
230 cd $(WXDIR)\src\msw
231
232 clean_zlib: .SYMBOLIC
233 cd $(WXDIR)\src\zlib
234 wmake -f makefile.wat clean
235 cd $(WXDIR)\src\msw
236
237 jpeg: .SYMBOLIC
238 cd $(WXDIR)\src\jpeg
239 wmake -f makefile.wat all
240 cd $(WXDIR)\src\msw
241
242 clean_jpeg: .SYMBOLIC
243 cd $(WXDIR)\src\jpeg
244 wmake -f makefile.wat clean
245 cd $(WXDIR)\src\msw
246
247 tiff: .SYMBOLIC
248 cd $(WXDIR)\src\tiff
249 wmake -f makefile.wat all
250 cd $(WXDIR)\src\msw
251
252 clean_tiff: .SYMBOLIC
253 cd $(WXDIR)\src\tiff
254 wmake -f makefile.wat clean
255 cd $(WXDIR)\src\msw
256
257 regex: .SYMBOLIC
258 cd $(WXDIR)\src\regex
259 wmake -f makefile.wat all
260 cd $(WXDIR)\src\msw
261
262 clean_regex: .SYMBOLIC
263 cd $(WXDIR)\src\regex
264 wmake -f makefile.wat clean
265 cd $(WXDIR)\src\msw
266
267 MFTYPE=wat
268 self : .SYMBOLIC $(WXDIR)\distrib\msw\tmake\filelist.txt $(WXDIR)\distrib\msw\tmake\$(MFTYPE).t
269 cd $(WXDIR)\distrib\msw\tmake
270 tmake -t $(MFTYPE) wxwin.pro -o makefile.$(MFTYPE)
271 copy makefile.$(MFTYPE) $(WXDIR)\src\msw