]> git.saurik.com Git - wxWidgets.git/blame - distrib/msw/tmake/bcc.t
Some VC++ makefile fixes; minor comment mods to setup0.h
[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
b2cf617c 98USE_XPM_IN_MSW=1
f2071dda
VZ
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)
f6081a04 147 tlib $(LIBTARGET) /P2048 @&&!
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
f2071dda 227# CONTRIB
b2cf617c 228xpm: $(CFG)
f2071dda
VZ
229 cd $(WXDIR)\src\xpm
230 make -f makefile.bcc -DCFG=$(CFG) -DFINAL=$(FINAL) -DWXWIN=$(WXDIR) -DDEBUG=$(DEBUG)
231 cd $(WXDIR)\src\msw
232
b2cf617c
JS
233clean_xpm: $(CFG)
234 cd $(WXDIR)\src\xpm
235 make -f makefile.bcc clean
236 cd $(WXDIR)\src\msw
237
f2071dda
VZ
238png: $(CFG)
239 cd $(WXDIR)\src\png
9be9b974 240 make -f makefile.bcc
f2071dda
VZ
241 cd $(WXDIR)\src\msw
242
243clean_png:
244 cd $(WXDIR)\src\png
245 make -f makefile.bcc clean
246 cd $(WXDIR)\src\msw
247
248zlib: $(CFG)
249 cd $(WXDIR)\src\zlib
250 make -f makefile.bcc
251 cd $(WXDIR)\src\msw
252
253clean_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
4d85bcd1 275-I$(WXINC);$(BCCDIR)\include;$(WXDIR)/src/generic;$(WXDIR)/src/png;$(WXDIR)/src/zlib;$(WXDIR)/src/xpm
f2071dda
VZ
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
295clean: $(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
304cleanall: clean
305
306
9be9b974 307MFTYPE=bcc
1b9315eb
JS
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
311self:
9be9b974
RD
312 cd $(WXWIN)\distrib\msw\tmake
313 tmake -t $(MFTYPE) wxwin.pro -o makefile.$(MFTYPE)
314 copy makefile.$(MFTYPE) $(WXWIN)\src\msw