]> git.saurik.com Git - wxWidgets.git/blame - distrib/msw/tmake/b32.t
minor bug fixes
[wxWidgets.git] / distrib / msw / tmake / b32.t
CommitLineData
f2071dda
VZ
1#!#############################################################################
2#! File: b32.t
3#! Purpose: tmake template file from which makefile.b32 is generated by running
4#! tmake -t b32 wxwin.pro
5#! Author: Vadim Zeitlin
6#! Created: 14.07.99
7#! Version: $Id$
8#!#############################################################################
9
10#${
11 #! include the code which parses filelist.txt file and initializes
12 #! %wxCommon, %wxGeneric and %wxMSW hashes.
13 IncludeTemplate("filelist.t");
14
15 #! now transform these hashes into $project tags
16 foreach $file (sort keys %wxGeneric) {
17 my $tag = "";
8ed88978 18 next if $wxGeneric{$file} =~ /\b(PS|G|16|U)\b/;
f2071dda
VZ
19
20 $file =~ s/cp?p?$/obj/;
21 $project{"WXGENERICOBJS"} .= "\$(MSWDIR)\\" . $file . " "
22 }
23
24 foreach $file (sort keys %wxCommon) {
9f3553c8 25 $isCFile = $file =~ /\.c$/;
f2071dda 26 $file =~ s/cp?p?$/obj/;
9f3553c8
VZ
27 $obj = "\$(MSWDIR)\\" . $file . " ";
28 $project{"WXCOMMONOBJS"} .= $obj;
29 $project{"WXCOBJS"} .= $obj if $isCFile;
f2071dda
VZ
30 }
31
32 foreach $file (sort keys %wxMSW) {
33 next if $wxMSW{$file} =~ /\b16\b/;
34
d9d61c23 35 if ( $file =~ /^automtn/ ) {
f2071dda
VZ
36 #! comment in old makefile.b32 seems to imply that this file can't
37 #! be compiled with Borland (leads to crash in oleauto sample)
38 next;
39 }
40
83b1f353
VZ
41 $isCFile = $file =~ /\.c$/;
42
6e29a95a 43 my $isOleObj = $wxMSW{$file} =~ /\bO\b/;
f2071dda 44 $file =~ s/cp?p?$/obj/;
6e29a95a
VZ
45 my $obj = "\$(MSWDIR)\\" . $file . " ";
46
47 $project{"WXMSWOBJS"} .= $obj;
48 if ( $isOleObj ) {
49 #! remember that this file is in ole subdir
50 $project{"WXOLEOBJS"} .= $obj;
51 }
83b1f353 52 $project{"WXCOBJS"} .= $obj if $isCFile;
f2071dda
VZ
53 }
54#$}
55
56# This file was automatically generated by tmake at #$ Now()
57# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE B32.T!
58
59#
60# File: makefile.b32
61# Author: Julian Smart
62# Created: 1998
63# Updated:
64# Copyright:
65#
66# "%W% %G%"
67#
68# Makefile : Builds wxWindows library wx.lib for MS Windows,
69# and Borland C++ (32-bit).
70
71!if "$(BCCDIR)" == ""
72!error You must define the BCCDIR variable in autoexec.bat, e.g. BCCDIR=d:\bc4
73!endif
74
75!if "$(WXWIN)" == ""
76!error You must define the WXWIN variable in autoexec.bat, e.g. WXWIN=c:\wx
77!endif
78
79WXDIR = $(WXWIN)
80
81# Set all these to 1 if you want to build a dynamic library
82!if "$(DLL)" == "1"
83WXMAKINGDLL=1
84WXBUILDDLL=1
85!endif
86
87!include $(WXDIR)\src\makeb32.env
88
89# Please set these according to the settings in wx_setup.h, so we can include
90# the appropriate libraries in wx.lib
91USE_CTL3D=0
92USE_XPM_IN_MSW=0
93
94PERIPH_LIBS=
95PERIPH_TARGET=
96PERIPH_CLEAN_TARGET=
97
98!if "$(USE_CTL3D)" == "1"
99#Use WIN32S/WIN95 32 bit version ctl3d32.dll under win95 (Andre Beltman)
100PERIPH_LIBS=$(WXDIR)\lib\ctl3d32.lib $(PERIPH_LIBS)
101PERIPH_TARGET=ctl3d $(PERIPH_TARGET)
102PERIPH_CLEAN_TARGET=clean_ctl3d $(PERIPH_CLEAN_TARGET)
103!endif
104
105!if "$(USE_XPM_IN_MSW)" == "1"
106PERIPH_LIBS=$(WXLIB)\xpm.lib $(PERIPH_LIBS)
107PERIPH_TARGET=xpm $(PERIPH_TARGET)
108PERIPH_CLEAN_TARGET=clean_xpm $(PERIPH_CLEAN_TARGET)
109!endif
110
111#PERIPH_LIBS=$(WXDIR)\lib\zlib.lib $(WXDIR)\lib\winpng.lib $(WXDIR)\lib\jpeg.lib $(PERIPH_LIBS)
112PERIPH_LIBS=
113PERIPH_TARGET=zlib png jpeg $(PERIPH_TARGET)
114PERIPH_CLEAN_TARGET=clean_zlib clean_png clean_jpeg $(PERIPH_CLEAN_TARGET)
115
116!if "$(DLL)" == "0"
117DUMMY=dummy
118!else
119DUMMY=dummydll
120LIBS= cw32 import32 ole2w32
121!endif
122
123LIBTARGET=$(WXLIB)
124
125GENDIR=..\generic
126COMMDIR=..\common
127OLEDIR=.\ole
128MSWDIR=.
129
130DOCDIR = $(WXDIR)\docs
131
132GENERICOBJS= #$ ExpandList("WXGENERICOBJS");
133
134# Not needed:
135# $(MSWDIR)\colrdlgg.obj \
136# $(MSWDIR)\fontdlgg.obj \
137# $(MSWDIR)\helpxlp.obj \
138# $(MSWDIR)\msgdlgg.obj \
139# $(MSWDIR)\printps.obj \
140# $(MSWDIR)\prntdlgg.obj \
141# $(MSWDIR)\listctrl.obj \
142# $(MSWDIR)\notebook.obj \
143# $(MSWDIR)\treectrl.obj
144
145COMMONOBJS = \
146 $(MSWDIR)\y_tab.obj \
147 #$ ExpandList("WXCOMMONOBJS");
148
149MSWOBJS = #$ ExpandList("WXMSWOBJS");
150
151OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS)
152
153default: wx
154
155wx: $(CFG) $(DUMMY).obj $(OBJECTS) $(PERIPH_TARGET) $(LIBTARGET)
156
157all: all_libs all_execs
158
159!if "$(DLL)" == "0"
160
161$(LIBTARGET): $(DUMMY).obj $(OBJECTS)
162 -erase $(LIBTARGET)
e5b767ff 163 tlib $(LIBTARGET) /P1024 @&&!
f2071dda
VZ
164+$(OBJECTS:.obj =.obj +) +$(PERIPH_LIBS:.lib =.lib +)
165!
166
167!else
168
169$(LIBTARGET): $(DUMMY).obj $(OBJECTS)
170 -erase $(LIBTARGET)
171 -erase $(WXLIBDIR)\wx.dll
172 tlink32 $(LINK_FLAGS) /v @&&!
173c0d32.obj $(OBJECTS)
174$(WXLIBDIR)\wx
175nul
176$(PERIPH_LIBS) $(LIBS)
177wxb32
178!
179 implib -c $(LIBTARGET) $(WXLIBDIR)\wx.dll
180
181!endif
182
183dummy.obj: dummy.$(SRCSUFF) $(LOCALHEADERS) $(BASEHEADERS) $(WXDIR)\include\wx\wx.h
184dummydll.obj: dummydll.$(SRCSUFF) $(LOCALHEADERS) $(BASEHEADERS) $(WXDIR)\include\wx\wx.h
185
186$(MSWDIR)\y_tab.obj: $(COMMDIR)\y_tab.c $(COMMDIR)\lex_yy.c
187
188# cl @<<
189# $(CPPFLAGS2) /c $*.c -DUSE_DEFINE -DYY_USE_PROTOS /Fo$@
190# <<
191
192$(COMMDIR)\y_tab.c: $(COMMDIR)\dosyacc.c
193 copy $(COMMDIR)\dosyacc.c $(COMMDIR)\y_tab.c
194
195$(COMMDIR)\lex_yy.c: $(COMMDIR)\doslex.c
196 copy $(COMMDIR)\doslex.c $(COMMDIR)\lex_yy.c
197
198# $(OBJECTS): $(WXDIR)\include\wx\setup.h
199
200#${
201 $_ = $project{"WXMSWOBJS"};
202 my @objs = split;
203 foreach (@objs) {
204 $text .= $_ . ": ";
6e29a95a 205 if ( $project{"WXOLEOBJS"} =~ /\Q$_/ ) { s/MSWDIR/OLEDIR/; }
83b1f353
VZ
206 $suffix = $project{"WXCOBJS"} =~ /\Q$_/ ? "c" : '$(SRCSUFF)';
207 s/obj$/$suffix/;
f2071dda
VZ
208 $text .= $_ . "\n\n";
209 }
210#$}
211
212########################################################
213# Common objects (always compiled)
214
215#${
216 $_ = $project{"WXCOMMONOBJS"};
217 my @objs = split;
218 foreach (@objs) {
219 $text .= $_ . ": ";
9f3553c8 220 $suffix = $project{"WXCOBJS"} =~ /\Q$_/ ? "c" : '$(SRCSUFF)';
f2071dda 221 s/MSWDIR/COMMDIR/;
9f3553c8 222 s/obj$/$suffix/;
f2071dda
VZ
223 $text .= $_ . "\n\n";
224 }
225#$}
226
227########################################################
228# Generic objects (not always compiled, depending on
229# whether platforms have native implementations)
230
231#${
232 $_ = $project{"WXGENERICOBJS"};
233 my @objs = split;
234 foreach (@objs) {
235 $text .= $_ . ": ";
236 s/MSWDIR/GENDIR/;
237 s/obj$/\$(SRCSUFF)/;
238 $text .= $_ . "\n\n";
239 }
240#$}
241
242
243all_utils:
244 cd $(WXDIR)\utils
245 make -f makefile.b32
246 cd $(WXDIR)\src\msw
247
248all_samples:
249 cd $(WXDIR)\samples
250 make -f makefile.b32
251 cd $(WXDIR)\src\msw
252
253all_execs:
254 cd $(WXDIR)\utils
255 make -f makefile.b32 all_execs
256 cd $(WXDIR)\src\msw
257
258wxxpm: $(CFG)
259 cd $(WXDIR)\src\xpm
260 make -f makefile.b32 -DCFG=$(CFG) -DFINAL=$(FINAL) -DWXWIN=$(WXDIR) -DDEBUG=$(DEBUG)
261 cd $(WXDIR)\src\msw
262
263clean_wxxpm: $(CFG)
264 cd $(WXDIR)\src\xpm
265 make -f makefile.b32 clean
266 cd $(WXDIR)\src\msw
267
268png: $(CFG)
269 cd $(WXDIR)\src\png
9be9b974 270 make -f makefile.b32
f2071dda
VZ
271 cd $(WXDIR)\src\msw
272
273clean_png:
274 cd $(WXDIR)\src\png
275 make -f makefile.b32 clean
276 cd $(WXDIR)\src\msw
277
278zlib: $(CFG)
279 cd $(WXDIR)\src\zlib
280 make -f makefile.b32 lib
281 cd $(WXDIR)\src\msw
282
283clean_zlib:
284 cd $(WXDIR)\src\zlib
285 make -f makefile.b32 clean
286 cd $(WXDIR)\src\msw
287
288jpeg: $(CFG)
289 cd $(WXDIR)\src\jpeg
9be9b974 290 make -f makefile.b32
f2071dda
VZ
291 cd $(WXDIR)\src\msw
292
293clean_jpeg:
294 cd $(WXDIR)\src\jpeg
295 make -f makefile.b32 clean
296 cd $(WXDIR)\src\msw
297
298$(CFG): makefile.b32
299 copy &&!
300-H=$(WXDIR)\src\msw\wx32.csm
301-3
302-d
303-R-
304-X
305-w-par
306-w-aus
307-w-hid # virtual function A hides virtual function B
308-WE
309-tWM
310
311-I$(WXINC);$(BCCDIR)\include;$(WXDIR)/src/png;$(WXDIR)/src/jpeg;$(WXDIR)/src/zlib;$(WXDIR)/src/xpm
312-I$(WXDIR)\include\wx\msw\gnuwin32
313
314-L$(BCCDIR)\lib
315-D__WXWIN__
316-D__WXMSW__
317-D__WINDOWS__
318-DWIN32
319$(OPT)
320$(DEBUG_FLAGS)
321$(WIN95FLAG)
322! $(CFG)
323
324#-I$(WXDIR)\src\common\wxxpm\libxpm.34b\lib
325# -Oxt
326
327clean: $(PERIPH_CLEAN_TARGET)
328 -erase $(LIBTARGET)
329 -erase *.obj
330 -erase *.pch
331 -erase *.csm
332 -erase *.cfg
333 -erase ..\common\y_tab.c
334 -erase ..\common\lex_yy.c
335
336cleanall: clean
337
338
9be9b974 339MFTYPE=b32
1b9315eb
JS
340# Can't use this or we'll have to distribute all tmake files with wxWindows
341# makefile.$(MFTYPE) : $(WXWIN)\distrib\msw\tmake\filelist.txt $(WXWIN)\distrib\msw\tmake\$(MFTYPE).t
342
343self:
9be9b974
RD
344 cd $(WXWIN)\distrib\msw\tmake
345 tmake -t $(MFTYPE) wxwin.pro -o makefile.$(MFTYPE)
346 copy makefile.$(MFTYPE) $(WXWIN)\src\msw
347