]> git.saurik.com Git - wxWidgets.git/blob - distrib/msw/tmake/bcc.t
SetBrushOrgExt broke WIN16 compilation
[wxWidgets.git] / distrib / msw / tmake / bcc.t
1 #!#############################################################################
2 #! File: bcc.t
3 #! Purpose: tmake template file from which makefile.bcc is generated by running
4 #! tmake -t bcc wxwin.pro -o makefile.bcc
5 #!
6 #! TODO:
7 #! - resourc2.obj is not correctly generated (see list and target).
8 #! - cpp is incorrectly substituted into filenames containing 'obj'
9 #!
10 #! Author: Vadim Zeitlin
11 #! Created: 14.07.99
12 #! Version: $Id$
13 #!#############################################################################
14
15 #${
16 #! include the code which parses filelist.txt file and initializes
17 #! %wxCommon, %wxGeneric and %wxMSW hashes.
18 IncludeTemplate("filelist.t");
19
20 #! now transform these hashes into $project tags
21 foreach $file (sort keys %wxGeneric) {
22 my $tag = "";
23 next if $wxGeneric{$file} =~ /\b(PS|G|U)\b/;
24
25 $file =~ s/cp?p?$/obj/;
26 $project{"WXGENERICOBJS"} .= "\$(MSWDIR)\\" . $file . " "
27 }
28
29 foreach $file (sort keys %wxCommon) {
30 #! socket files don't compile under Win16 currently
31 next if $wxCommon{$file} =~ /\b(32|S)\b/;
32
33 #! needs extra files (sql*.h) so not compiled by default.
34 next if $file =~ /^odbc\./;
35
36 $isCFile = $file =~ /\.c$/;
37 $file =~ s/cp?p?$/obj/;
38 $obj = "\$(MSWDIR)\\" . $file . " ";
39 $project{"WXCOMMONOBJS"} .= $obj;
40 $project{"WXCOBJS"} .= $obj if $isCFile;
41 }
42
43 #! special hack for Borland in 16 bits needs this file
44 $project{"WXCOMMONOBJS"} .= '${MSWDIR}\resourc2.obj';
45
46 foreach $file (sort keys %wxMSW) {
47 #! don't take files not appropriate for 16-bit Windows
48 next if $wxMSW{$file} =~ /\b(32|O)\b/;
49
50 $isCFile = $file =~ /\.c$/;
51 $file =~ s/cp?p?$/obj/;
52 $obj = "\$(MSWDIR)\\" . $file . " ";
53 $project{"WXMSWOBJS"} .= $obj;
54 $project{"WXCOBJS"} .= $obj if $isCFile;
55 }
56 #$}
57
58 # This file was automatically generated by tmake at #$ Now()
59 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE BCC.T!
60
61 #
62 # File: makefile.bcc
63 # Author: Julian Smart
64 # Created: 1993
65 # Updated:
66 # Copyright:(c) 1993, AIAI, University of Edinburgh
67 #
68 # "%W% %G%"
69 #
70 # Makefile : Builds wxWindows library wx.lib for Windows 3.1
71 # and Borland C++ 3.1
72
73 !if "$(BCCDIR)" == ""
74 !error You must define the BCCDIR variable in autoexec.bat, e.g. BCCDIR=d:\bc4
75 !endif
76
77 !if "$(WXWIN)" == ""
78 !error You must define the WXWIN variable in autoexec.bat, e.g. WXWIN=c:\wx
79 !endif
80
81 !if "$(CFG)" == ""
82 # !error You must start compiling from wx\src, not wx\src\msw.
83 !endif
84
85 !ifndef DEBUG
86 DEBUG=0
87 !endif
88
89 WXDIR = $(WXWIN)
90
91 !include $(WXDIR)\src\makebcc.env
92
93 THISDIR = $(WXDIR)\src\msw
94
95 # Please set these according to the settings in wx_setup.h, so we can include
96 # the appropriate libraries in wx.lib
97 USE_CTL3D=1
98 USE_XPM_IN_MSW=1
99
100 PERIPH_LIBS=
101 PERIPH_TARGET=
102 PERIPH_CLEAN_TARGET=
103
104 !if "$(USE_CTL3D)" == "1"
105 PERIPH_LIBS=$(WXDIR)\lib\bcc16\ctl3dv2.lib $(PERIPH_LIBS)
106 !endif
107
108 !if "$(USE_XPM_IN_MSW)" == "1"
109 PERIPH_LIBS=$(WXDIR)\xpm.lib $(PERIPH_LIBS)
110 PERIPH_TARGET=xpm $(PERIPH_TARGET)
111 PERIPH_CLEAN_TARGET=clean_xpm $(PERIPH_CLEAN_TARGET)
112 !endif
113
114 # TODO: add these libraries
115 # PERIPH_LIBS=$(WXDIR)\lib\zlib.lib $(WXDIR)\lib\winpng.lib $(PERIPH_LIBS)
116 PERIPH_TARGET=zlib png $(PERIPH_TARGET)
117 PERIPH_CLEAN_TARGET=clean_zlib clean_png $(PERIPH_CLEAN_TARGET)
118
119 CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
120
121 LIBTARGET= $(WXLIBDIR)\wx.lib
122 DUMMY=dummy
123
124 GENDIR=..\generic
125 COMMDIR=..\common
126 OLEDIR=.\ole
127 MSWDIR=.
128
129 DOCDIR = $(WXDIR)\docs
130
131 GENERICOBJS= #$ ExpandList("WXGENERICOBJS");
132
133 COMMONOBJS = \
134 $(MSWDIR)\y_tab.obj \
135 #$ ExpandList("WXCOMMONOBJS");
136
137 MSWOBJS = #$ ExpandList("WXMSWOBJS");
138
139 OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS)
140
141 default: wx
142
143 wx: $(CFG) $(DUMMY).obj $(OBJECTS) $(PERIPH_TARGET) $(LIBTARGET)
144
145 $(LIBTARGET): $(DUMMY).obj $(OBJECTS) $(PERIPH_LIBS)
146 erase $(LIBTARGET)
147 tlib $(LIBTARGET) /P2048 @&&!
148 +$(COMMONOBJS:.obj =.obj +)\
149 +$(GENERICOBJS:.obj =.obj +)\
150 +$(MSWOBJS:.obj =.obj +)\
151 +$(PERIPH_LIBS:.lib =.lib +)
152 !
153
154 dummy.obj: dummy.$(SRCSUFF) $(LOCALHEADERS) $(BASEHEADERS) $(WXDIR)\include\wx\wx.h
155 dummydll.obj: dummydll.$(SRCSUFF) $(LOCALHEADERS) $(BASEHEADERS) $(WXDIR)\include\wx\wx.h
156
157 $(MSWDIR)\y_tab.obj: $(COMMDIR)\y_tab.c $(COMMDIR)\lex_yy.c
158
159 # cl @<<
160 # $(CPPFLAGS2) /c $*.c -DUSE_DEFINE -DYY_USE_PROTOS /Fo$@
161 # <<
162
163 $(COMMDIR)\y_tab.c: $(COMMDIR)\dosyacc.c
164 copy $(COMMDIR)\dosyacc.c $(COMMDIR)\y_tab.c
165
166 $(COMMDIR)\lex_yy.c: $(COMMDIR)\doslex.c
167 copy $(COMMDIR)\doslex.c $(COMMDIR)\lex_yy.c
168
169 # $(OBJECTS): $(WXDIR)\include\wx\setup.h
170
171 #${
172 $_ = $project{"WXMSWOBJS"};
173 my @objs = split;
174 foreach (@objs) {
175 $text .= $_ . ": ";
176 $suffix = $project{"WXCOBJS"} =~ /\Q$_/ ? "c" : '$(SRCSUFF)';
177 s/obj$/$suffix/;
178 $text .= $_ . "\n\n";
179 }
180 #$}
181
182 ########################################################
183 # Common objects (always compiled)
184
185 #${
186 $_ = $project{"WXCOMMONOBJS"};
187 my @objs = split;
188 foreach (@objs) {
189 $text .= $_ . ": ";
190 $suffix = $project{"WXCOBJS"} =~ /\Q$_/ ? "c" : '$(SRCSUFF)';
191 s/MSWDIR/COMMDIR/;
192 s/obj$/$suffix/;
193 $text .= $_ . "\n\n";
194 }
195 #$}
196
197 ########################################################
198 # Generic objects (not always compiled, depending on
199 # whether platforms have native implementations)
200
201 #${
202 $_ = $project{"WXGENERICOBJS"};
203 my @objs = split;
204 foreach (@objs) {
205 $text .= $_ . ": ";
206 s/MSWDIR/GENDIR/;
207 s/obj$/\$(SRCSUFF)/;
208 $text .= $_ . "\n\n";
209 }
210 #$}
211
212 all_utils:
213 cd $(WXDIR)\utils
214 make -f makefile.bcc
215 cd $(WXDIR)\src\msw
216
217 all_samples:
218 cd $(WXDIR)\samples
219 make -f makefile.bcc
220 cd $(WXDIR)\src\msw
221
222 all_execs:
223 cd $(WXDIR)\utils
224 make -f makefile.bcc all_execs
225 cd $(WXDIR)\src\msw
226
227 # CONTRIB
228 xpm: $(CFG)
229 cd $(WXDIR)\src\xpm
230 make -f makefile.bcc -DCFG=$(CFG) -DFINAL=$(FINAL) -DWXWIN=$(WXDIR) -DDEBUG=$(DEBUG)
231 cd $(WXDIR)\src\msw
232
233 clean_xpm: $(CFG)
234 cd $(WXDIR)\src\xpm
235 make -f makefile.bcc clean
236 cd $(WXDIR)\src\msw
237
238 png: $(CFG)
239 cd $(WXDIR)\src\png
240 make -f makefile.bcc
241 cd $(WXDIR)\src\msw
242
243 clean_png:
244 cd $(WXDIR)\src\png
245 make -f makefile.bcc clean
246 cd $(WXDIR)\src\msw
247
248 zlib: $(CFG)
249 cd $(WXDIR)\src\zlib
250 make -f makefile.bcc
251 cd $(WXDIR)\src\msw
252
253 clean_zlib:
254 cd $(WXDIR)\src\zlib
255 make -f makefile.bcc clean
256 cd $(WXDIR)\src\msw
257
258 $(CFG): makefile.bcc
259 copy &&!
260 -H=$(WXDIR)\src\msw\borland.pch
261 -2
262 -P
263 -d
264 -w-hid
265 -w-par
266 -w-pia
267 -w-aus
268 -w-rch
269 -ml
270 -Od
271 -WE
272 -Fs-
273 -Vf
274 -Ff=4
275 -I$(WXINC);$(BCCDIR)\include;$(WXDIR)/src/generic;$(WXDIR)/src/png;$(WXDIR)/src/zlib;$(WXDIR)/src/xpm
276 -I$(WXDIR)\include\wx\msw\gnuwin32
277 -L$(BCCDIR)\lib
278 -D__WXWIN__
279 -D__WXMSW__
280 -D__WINDOWS__
281 -D__WIN16__
282 ! $(CFG)
283 !if "$(BOR_VER)" == "3.1"
284 echo -Ff=4 >>$(CFG)
285 !elif "$(BOR_VER)" == "4"
286 echo -Ff=512 >>$(CFG)
287 echo -dc >>$(CFG)
288 !else
289 echo -Ff=512 >>$(CFG)
290 echo -dc >>$(CFG)
291 !endif
292
293 # -O was: -Oxt
294
295 clean: $(PERIPH_CLEAN_TARGET)
296 erase $(LIBTARGET)
297 erase *.obj
298 erase *.pch
299 erase *.csm
300 erase *.cfg
301 erase ..\common\y_tab.c
302 erase ..\common\lex_yy.c
303
304 cleanall: clean
305
306
307 MFTYPE=bcc
308 # Can't use this or we'll have to distribute all tmake files with wxWindows
309 #makefile.$(MFTYPE) : $(WXWIN)\distrib\msw\tmake\filelist.txt $(WXWIN)\distrib\msw\tmake\$(MFTYPE).t
310
311 self:
312 cd $(WXWIN)\distrib\msw\tmake
313 tmake -t $(MFTYPE) wxwin.pro -o makefile.$(MFTYPE)
314 copy makefile.$(MFTYPE) $(WXWIN)\src\msw