]> git.saurik.com Git - wxWidgets.git/blame - distrib/msw/tmake/bcc.t
wxLocale now uses wxEncodingConverter (must be explicitly enabled)
[wxWidgets.git] / distrib / msw / tmake / bcc.t
CommitLineData
f2071dda
VZ
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
8fb3a512
JS
5#!
6#! TODO:
7#! - resourc2.obj is not correctly generated (see list and target).
8#! - cpp is incorrectly substituted into filenames containing 'obj'
9#!
f2071dda
VZ
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
9b73db3c 36 $isCFile = $file =~ /\.c$/;
f2071dda 37 $file =~ s/cp?p?$/obj/;
9b73db3c
VZ
38 $obj = "\$(MSWDIR)\\" . $file . " ";
39 $project{"WXCOMMONOBJS"} .= $obj;
40 $project{"WXCOBJS"} .= $obj if $isCFile;
f2071dda
VZ
41 }
42
43 #! special hack for Borland in 16 bits needs this file
8fb3a512 44 $project{"WXCOMMONOBJS"} .= '${MSWDIR}\resourc2.obj';
f2071dda
VZ
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
83b1f353 50 $isCFile = $file =~ /\.c$/;
f2071dda 51 $file =~ s/cp?p?$/obj/;
83b1f353
VZ
52 $obj = "\$(MSWDIR)\\" . $file . " ";
53 $project{"WXMSWOBJS"} .= $obj;
54 $project{"WXCOBJS"} .= $obj if $isCFile;
f2071dda
VZ
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
86DEBUG=0
87!endif
88
89WXDIR = $(WXWIN)
90
91!include $(WXDIR)\src\makebcc.env
92
93THISDIR = $(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
97USE_CTL3D=1
98USE_XPM_IN_MSW=0
99
100PERIPH_LIBS=
101PERIPH_TARGET=
102PERIPH_CLEAN_TARGET=
103
104!if "$(USE_CTL3D)" == "1"
572eed55 105PERIPH_LIBS=$(WXDIR)\lib\bcc16\ctl3dv2.lib $(PERIPH_LIBS)
f2071dda
VZ
106!endif
107
108!if "$(USE_XPM_IN_MSW)" == "1"
109PERIPH_LIBS=$(WXDIR)\xpm.lib $(PERIPH_LIBS)
110PERIPH_TARGET=xpm $(PERIPH_TARGET)
111PERIPH_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)
116PERIPH_TARGET=zlib png $(PERIPH_TARGET)
117PERIPH_CLEAN_TARGET=clean_zlib clean_png $(PERIPH_CLEAN_TARGET)
118
119CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
120
121LIBTARGET= $(WXLIBDIR)\wx.lib
122DUMMY=dummy
123
124GENDIR=..\generic
125COMMDIR=..\common
126OLEDIR=.\ole
127MSWDIR=.
128
129DOCDIR = $(WXDIR)\docs
130
131GENERICOBJS= #$ ExpandList("WXGENERICOBJS");
132
133COMMONOBJS = \
134 $(MSWDIR)\y_tab.obj \
135 #$ ExpandList("WXCOMMONOBJS");
136
137MSWOBJS = #$ ExpandList("WXMSWOBJS");
138
139OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS)
140
141default: wx
142
143wx: $(CFG) $(DUMMY).obj $(OBJECTS) $(PERIPH_TARGET) $(LIBTARGET)
144
145$(LIBTARGET): $(DUMMY).obj $(OBJECTS) $(PERIPH_LIBS)
146 erase $(LIBTARGET)
147 tlib $(LIBTARGET) /P1024 @&&!
8fb3a512
JS
148+$(COMMONOBJS:.obj =.obj +)\
149+$(GENERICOBJS:.obj =.obj +)\
150+$(MSWOBJS:.obj =.obj +)\
151+$(PERIPH_LIBS:.lib =.lib +)
f2071dda
VZ
152!
153
154dummy.obj: dummy.$(SRCSUFF) $(LOCALHEADERS) $(BASEHEADERS) $(WXDIR)\include\wx\wx.h
155dummydll.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 .= $_ . ": ";
83b1f353 176 $suffix = $project{"WXCOBJS"} =~ /\Q$_/ ? "c" : '$(SRCSUFF)';
572eed55 177 s/obj$/$suffix/;
f2071dda
VZ
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 .= $_ . ": ";
9b73db3c 190 $suffix = $project{"WXCOBJS"} =~ /\Q$_/ ? "c" : '$(SRCSUFF)';
f2071dda 191 s/MSWDIR/COMMDIR/;
572eed55 192 s/obj$/$suffix/;
f2071dda
VZ
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/;
572eed55 207 s/obj$/\$(SRCSUFF)/;
f2071dda
VZ
208 $text .= $_ . "\n\n";
209 }
210#$}
211
212all_utils:
213 cd $(WXDIR)\utils
214 make -f makefile.bcc
215 cd $(WXDIR)\src\msw
216
217all_samples:
218 cd $(WXDIR)\samples
219 make -f makefile.bcc
220 cd $(WXDIR)\src\msw
221
222all_execs:
223 cd $(WXDIR)\utils
224 make -f makefile.bcc all_execs
225 cd $(WXDIR)\src\msw
226
227all_libs:
228 cd $(WXDIR)\src\msw
572eed55 229 make -f makefile.bcc dib fafa gauge hytext itsy prologio rcparser wx wxgraph\
f2071dda
VZ
230 wxstring wxtree mfutils # wxxpm
231
232all_contribs:
233 cd $(WXDIR)\src\msw
572eed55 234 make -f makefile.bcc fafa wxstring itsy gauge # wxxpm
f2071dda
VZ
235
236# CONTRIB
f2071dda
VZ
237wxxpm: $(CFG)
238 cd $(WXDIR)\src\xpm
239 make -f makefile.bcc -DCFG=$(CFG) -DFINAL=$(FINAL) -DWXWIN=$(WXDIR) -DDEBUG=$(DEBUG)
240 cd $(WXDIR)\src\msw
241
242png: $(CFG)
243 cd $(WXDIR)\src\png
9be9b974 244 make -f makefile.bcc
f2071dda
VZ
245 cd $(WXDIR)\src\msw
246
247clean_png:
248 cd $(WXDIR)\src\png
249 make -f makefile.bcc clean
250 cd $(WXDIR)\src\msw
251
252zlib: $(CFG)
253 cd $(WXDIR)\src\zlib
254 make -f makefile.bcc
255 cd $(WXDIR)\src\msw
256
257clean_zlib:
258 cd $(WXDIR)\src\zlib
259 make -f makefile.bcc clean
260 cd $(WXDIR)\src\msw
261
262$(CFG): makefile.bcc
263 copy &&!
264-H=$(WXDIR)\src\msw\borland.pch
265-2
266-P
267-d
268-w-hid
269-w-par
270-w-pia
271-w-aus
272-w-rch
273-ml
274-Od
275-WE
276-Fs-
277-Vf
278-Ff=4
4d85bcd1 279-I$(WXINC);$(BCCDIR)\include;$(WXDIR)/src/generic;$(WXDIR)/src/png;$(WXDIR)/src/zlib;$(WXDIR)/src/xpm
f2071dda
VZ
280-I$(WXDIR)\include\wx\msw\gnuwin32
281-L$(BCCDIR)\lib
282-D__WXWIN__
283-D__WXMSW__
284-D__WINDOWS__
285-D__WIN16__
286! $(CFG)
287!if "$(BOR_VER)" == "3.1"
288 echo -Ff=4 >>$(CFG)
289!elif "$(BOR_VER)" == "4"
290 echo -Ff=512 >>$(CFG)
291 echo -dc >>$(CFG)
292!else
293 echo -Ff=512 >>$(CFG)
294 echo -dc >>$(CFG)
295!endif
296
297# -O was: -Oxt
298
299clean: $(PERIPH_CLEAN_TARGET)
300 erase $(LIBTARGET)
301 erase *.obj
302 erase *.pch
303 erase *.csm
304 erase *.cfg
305 erase ..\common\y_tab.c
306 erase ..\common\lex_yy.c
307
308cleanall: clean
309
310
9be9b974 311MFTYPE=bcc
1b9315eb
JS
312# Can't use this or we'll have to distribute all tmake files with wxWindows
313#makefile.$(MFTYPE) : $(WXWIN)\distrib\msw\tmake\filelist.txt $(WXWIN)\distrib\msw\tmake\$(MFTYPE).t
314
315self:
9be9b974
RD
316 cd $(WXWIN)\distrib\msw\tmake
317 tmake -t $(MFTYPE) wxwin.pro -o makefile.$(MFTYPE)
318 copy makefile.$(MFTYPE) $(WXWIN)\src\msw