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