]> git.saurik.com Git - wxWidgets.git/blob - distrib/msw/tmake/bcc.t
documented XPM support and updated status of TIFF handler
[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 USE_XPM_IN_MSW=1
102
103 PERIPH_LIBS=
104 PERIPH_TARGET=
105 PERIPH_CLEAN_TARGET=
106
107 !if "$(USE_CTL3D)" == "1"
108 PERIPH_LIBS=$(WXDIR)\lib\bcc16\ctl3dv2.lib $(PERIPH_LIBS)
109 !endif
110
111 !if "$(USE_XPM_IN_MSW)" == "1"
112 PERIPH_LIBS=$(WXDIR)\lib\xpm.lib $(PERIPH_LIBS)
113 PERIPH_TARGET=xpm $(PERIPH_TARGET)
114 PERIPH_CLEAN_TARGET=clean_xpm $(PERIPH_CLEAN_TARGET)
115 !endif
116
117 # TODO: add these libraries
118 # PERIPH_LIBS=$(WXDIR)\lib\zlib.lib $(WXDIR)\lib\winpng.lib $(PERIPH_LIBS)
119 PERIPH_TARGET=zlib png $(PERIPH_TARGET)
120 PERIPH_CLEAN_TARGET=clean_zlib clean_png $(PERIPH_CLEAN_TARGET)
121
122 CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
123
124 LIBTARGET= $(WXLIBDIR)\wx.lib
125 DUMMY=dummy
126
127 GENDIR=..\generic
128 COMMDIR=..\common
129 OLEDIR=.\ole
130 MSWDIR=.
131
132 DOCDIR = $(WXDIR)\docs
133
134 GENERICOBJS= #$ ExpandList("WXGENERICOBJS");
135
136 COMMONOBJS = \
137 $(MSWDIR)\y_tab.obj \
138 #$ ExpandList("WXCOMMONOBJS");
139
140 MSWOBJS = #$ ExpandList("WXMSWOBJS");
141
142 OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS)
143
144 default: wx
145
146 wx: $(CFG) $(DUMMY).obj $(OBJECTS) $(PERIPH_TARGET) $(LIBTARGET)
147
148 $(LIBTARGET): $(DUMMY).obj $(OBJECTS) $(PERIPH_LIBS)
149 erase $(LIBTARGET)
150 tlib $(LIBTARGET) /P2048 @&&!
151 +$(COMMONOBJS:.obj =.obj +)\
152 +$(GENERICOBJS:.obj =.obj +)\
153 +$(MSWOBJS:.obj =.obj +)\
154 +$(PERIPH_LIBS:.lib =.lib +)
155 !
156
157 dummy.obj: dummy.$(SRCSUFF) $(LOCALHEADERS) $(BASEHEADERS) $(WXDIR)\include\wx\wx.h
158 dummydll.obj: dummydll.$(SRCSUFF) $(LOCALHEADERS) $(BASEHEADERS) $(WXDIR)\include\wx\wx.h
159
160 $(MSWDIR)\y_tab.obj: $(COMMDIR)\y_tab.c $(COMMDIR)\lex_yy.c
161
162 # cl @<<
163 # $(CPPFLAGS2) /c $*.c -DUSE_DEFINE -DYY_USE_PROTOS /Fo$@
164 # <<
165
166 $(COMMDIR)\y_tab.c: $(COMMDIR)\dosyacc.c
167 copy $(COMMDIR)\dosyacc.c $(COMMDIR)\y_tab.c
168
169 $(COMMDIR)\lex_yy.c: $(COMMDIR)\doslex.c
170 copy $(COMMDIR)\doslex.c $(COMMDIR)\lex_yy.c
171
172 # $(OBJECTS): $(WXDIR)\include\wx\setup.h
173
174 #${
175 $_ = $project{"WXMSWOBJS"};
176 my @objs = split;
177 foreach (@objs) {
178 $text .= $_ . ": ";
179 $suffix = $project{"WXCOBJS"} =~ /\Q$_/ ? "c" : '$(SRCSUFF)';
180 s/obj$/$suffix/;
181 $text .= $_ . "\n\n";
182 }
183 #$}
184
185 ########################################################
186 # Common objects (always compiled)
187
188 #${
189 $_ = $project{"WXCOMMONOBJS"};
190 my @objs = split;
191 foreach (@objs) {
192 $text .= $_ . ": ";
193 $suffix = $project{"WXCOBJS"} =~ /\Q$_/ ? "c" : '$(SRCSUFF)';
194 s/MSWDIR/COMMDIR/;
195 s/obj$/$suffix/;
196 $text .= $_ . "\n\n";
197 }
198 #$}
199
200 ########################################################
201 # Generic objects (not always compiled, depending on
202 # whether platforms have native implementations)
203
204 #${
205 $_ = $project{"WXGENERICOBJS"};
206 my @objs = split;
207 foreach (@objs) {
208 $text .= $_ . ": ";
209 s/MSWDIR/GENDIR/;
210 s/obj$/\$(SRCSUFF)/;
211 $text .= $_ . "\n\n";
212 }
213 #$}
214
215 all_utils:
216 cd $(WXDIR)\utils
217 make -f makefile.bcc
218 cd $(WXDIR)\src\msw
219
220 all_samples:
221 cd $(WXDIR)\samples
222 make -f makefile.bcc
223 cd $(WXDIR)\src\msw
224
225 all_execs:
226 cd $(WXDIR)\utils
227 make -f makefile.bcc all_execs
228 cd $(WXDIR)\src\msw
229
230 # CONTRIB
231 xpm: $(CFG)
232 cd $(WXDIR)\src\xpm
233 make -f makefile.bcc -DCFG=$(CFG) -DFINAL=$(FINAL) -DWXWIN=$(WXDIR) -DDEBUG=$(DEBUG)
234 cd $(WXDIR)\src\msw
235
236 clean_xpm: $(CFG)
237 cd $(WXDIR)\src\xpm
238 make -f makefile.bcc clean
239 cd $(WXDIR)\src\msw
240
241 png: $(CFG)
242 cd $(WXDIR)\src\png
243 make -f makefile.bcc
244 cd $(WXDIR)\src\msw
245
246 clean_png:
247 cd $(WXDIR)\src\png
248 make -f makefile.bcc clean
249 cd $(WXDIR)\src\msw
250
251 zlib: $(CFG)
252 cd $(WXDIR)\src\zlib
253 make -f makefile.bcc
254 cd $(WXDIR)\src\msw
255
256 clean_zlib:
257 cd $(WXDIR)\src\zlib
258 make -f makefile.bcc clean
259 cd $(WXDIR)\src\msw
260
261 $(CFG): makefile.bcc
262 copy &&!
263 -H=$(WXDIR)\src\msw\borland.pch
264 -2
265 -P
266 -d
267 -w-hid
268 -w-par
269 -w-pia
270 -w-aus
271 -w-rch
272 -ml
273 -Od
274 -WE
275 -Fs-
276 -Vf
277 -Ff=4
278 -I$(WXINC);$(BCCDIR)\include;$(WXDIR)/src/generic;$(WXDIR)/src/png;$(WXDIR)/src/zlib;$(WXDIR)/src/xpm
279 -I$(WXDIR)\include\wx\msw\gnuwin32
280 -L$(BCCDIR)\lib
281 -D__WXWIN__
282 -D__WXMSW__
283 -D__WINDOWS__
284 -D__WIN16__
285 ! $(CFG)
286 !if "$(BOR_VER)" == "3.1"
287 echo -Ff=4 >>$(CFG)
288 !elif "$(BOR_VER)" == "4"
289 echo -Ff=512 >>$(CFG)
290 echo -dc >>$(CFG)
291 !else
292 echo -Ff=512 >>$(CFG)
293 echo -dc >>$(CFG)
294 !endif
295
296 # -O was: -Oxt
297
298 clean: $(PERIPH_CLEAN_TARGET)
299 erase $(LIBTARGET)
300 erase *.obj
301 erase *.pch
302 erase *.csm
303 erase *.cfg
304 erase ..\common\y_tab.c
305 erase ..\common\lex_yy.c
306
307 cleanall: clean
308
309
310 MFTYPE=bcc
311 # Can't use this or we'll have to distribute all tmake files with wxWindows
312 #makefile.$(MFTYPE) : $(WXWIN)\distrib\msw\tmake\filelist.txt $(WXWIN)\distrib\msw\tmake\$(MFTYPE).t
313
314 self:
315 cd $(WXWIN)\distrib\msw\tmake
316 tmake -t $(MFTYPE) wxwin.pro -o makefile.$(MFTYPE)
317 copy makefile.$(MFTYPE) $(WXWIN)\src\msw