]> git.saurik.com Git - wxWidgets.git/blob - distrib/msw/tmake/bcc.t
Temporary ugly trick to make release for OpenWatcom possible.
[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|U)\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
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:
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 #$ ExpandList("WXCOMMONOBJS");
131
132 MSWOBJS = #$ ExpandList("WXMSWOBJS");
133
134 OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS)
135
136 default: wx
137
138 wx: $(CFG) $(DUMMY).obj $(OBJECTS) $(PERIPH_TARGET) $(LIBTARGET)
139
140 $(LIBTARGET): $(DUMMY).obj $(OBJECTS) $(PERIPH_LIBS)
141 erase $(LIBTARGET)
142 tlib $(LIBTARGET) /P2048 @&&!
143 +$(COMMONOBJS:.obj =.obj +)\
144 +$(GENERICOBJS:.obj =.obj +)\
145 +$(MSWOBJS:.obj =.obj +)\
146 +$(PERIPH_LIBS:.lib =.lib +)
147 !
148
149 dummy.obj: dummy.$(SRCSUFF) $(LOCALHEADERS) $(BASEHEADERS) $(WXDIR)\include\wx\wx.h
150 dummydll.obj: dummydll.$(SRCSUFF) $(LOCALHEADERS) $(BASEHEADERS) $(WXDIR)\include\wx\wx.h
151
152 # $(OBJECTS): $(WXDIR)\include\wx\setup.h
153
154 #${
155 $_ = $project{"WXMSWOBJS"};
156 my @objs = split;
157 foreach (@objs) {
158 $text .= $_ . ": ";
159 $suffix = $project{"WXCOBJS"} =~ /\Q$_/ ? "c" : '$(SRCSUFF)';
160 s/obj$/$suffix/;
161 $text .= $_ . "\n\n";
162 }
163 #$}
164
165 ########################################################
166 # Common objects (always compiled)
167
168 #${
169 $_ = $project{"WXCOMMONOBJS"};
170 my @objs = split;
171 foreach (@objs) {
172 $text .= $_ . ": ";
173 $suffix = $project{"WXCOBJS"} =~ /\Q$_/ ? "c" : '$(SRCSUFF)';
174 s/MSWDIR/COMMDIR/;
175 s/obj$/$suffix/;
176 $text .= $_ . "\n\n";
177 }
178 #$}
179
180 ########################################################
181 # Generic objects (not always compiled, depending on
182 # whether platforms have native implementations)
183
184 #${
185 $_ = $project{"WXGENERICOBJS"};
186 my @objs = split;
187 foreach (@objs) {
188 $text .= $_ . ": ";
189 s/MSWDIR/GENDIR/;
190 s/obj$/\$(SRCSUFF)/;
191 $text .= $_ . "\n\n";
192 }
193 #$}
194
195 all_utils:
196 cd $(WXDIR)\utils
197 make -f makefile.bcc
198 cd $(WXDIR)\src\msw
199
200 all_samples:
201 cd $(WXDIR)\samples
202 make -f makefile.bcc
203 cd $(WXDIR)\src\msw
204
205 all_execs:
206 cd $(WXDIR)\utils
207 make -f makefile.bcc all_execs
208 cd $(WXDIR)\src\msw
209
210 # CONTRIB
211 png: $(CFG)
212 cd $(WXDIR)\src\png
213 make -f makefile.bcc
214 cd $(WXDIR)\src\msw
215
216 clean_png:
217 cd $(WXDIR)\src\png
218 make -f makefile.bcc clean
219 cd $(WXDIR)\src\msw
220
221 zlib: $(CFG)
222 cd $(WXDIR)\src\zlib
223 make -f makefile.bcc
224 cd $(WXDIR)\src\msw
225
226 clean_zlib:
227 cd $(WXDIR)\src\zlib
228 make -f makefile.bcc clean
229 cd $(WXDIR)\src\msw
230
231 $(CFG): makefile.bcc
232 copy &&!
233 -H=$(WXDIR)\src\msw\borland.pch
234 -2
235 -P
236 -d
237 -w-hid
238 -w-par
239 -w-pia
240 -w-aus
241 -w-rch
242 -ml
243 -Od
244 -WE
245 -Fs-
246 -Vf
247 -Ff=4
248 -I$(WXINC);$(BCCDIR)\include;$(WXDIR)/src/generic;$(WXDIR)/src/png;$(WXDIR)/src/zlib
249 -I$(WXDIR)\include\wx\msw\gnuwin32
250 -L$(BCCDIR)\lib
251 -D__WXWIN__
252 -D__WXMSW__
253 -D__WINDOWS__
254 -D__WIN16__
255 ! $(CFG)
256 !if "$(BOR_VER)" == "3.1"
257 echo -Ff=4 >>$(CFG)
258 !elif "$(BOR_VER)" == "4"
259 echo -Ff=512 >>$(CFG)
260 echo -dc >>$(CFG)
261 !else
262 echo -Ff=512 >>$(CFG)
263 echo -dc >>$(CFG)
264 !endif
265
266 # -O was: -Oxt
267
268 clean: $(PERIPH_CLEAN_TARGET)
269 erase $(LIBTARGET)
270 erase *.obj
271 erase *.pch
272 erase *.csm
273 erase *.cfg
274
275 cleanall: clean
276
277
278 MFTYPE=bcc
279 # Can't use this or we'll have to distribute all tmake files with wxWindows
280 #makefile.$(MFTYPE) : $(WXWIN)\distrib\msw\tmake\filelist.txt $(WXWIN)\distrib\msw\tmake\$(MFTYPE).t
281
282 self:
283 cd $(WXWIN)\distrib\msw\tmake
284 tmake -t $(MFTYPE) wxwin.pro -o makefile.$(MFTYPE)
285 copy makefile.$(MFTYPE) $(WXWIN)\src\msw