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