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