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