]> git.saurik.com Git - wxWidgets.git/blob - distrib/msw/tmake/bcc.t
New makefile system in place, obsoletes libtool,
[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 #! 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 = "";
18 next if $wxGeneric{$file} =~ /\b(PS|G|U)\b/;
19
20 $file =~ s/cp?p?$/obj/;
21 $project{"WXGENERICOBJS"} .= "\$(MSWDIR)\\" . $file . " "
22 }
23
24 foreach $file (sort keys %wxCommon) {
25 #! socket files don't compile under Win16 currently
26 next if $wxCommon{$file} =~ /\b(32|S)\b/;
27
28 #! needs extra files (sql*.h) so not compiled by default.
29 next if $file =~ /^odbc\./;
30
31 $isCFile = $file =~ /\.c$/;
32 $file =~ s/cp?p?$/obj/;
33 $obj = "\$(MSWDIR)\\" . $file . " ";
34 $project{"WXCOMMONOBJS"} .= $obj;
35 $project{"WXCOBJS"} .= $obj if $isCFile;
36 }
37
38 #! special hack for Borland in 16 bits needs this file
39 $project{"WXCOMMONOBJS"} .= '${MSWDIR}\resourc2.cpp';
40
41 foreach $file (sort keys %wxMSW) {
42 #! don't take files not appropriate for 16-bit Windows
43 next if $wxMSW{$file} =~ /\b(32|O)\b/;
44
45 $file =~ s/cp?p?$/obj/;
46 $project{"WXMSWOBJS"} .= "\$(MSWDIR)\\" . $file . " "
47 }
48 #$}
49
50 # This file was automatically generated by tmake at #$ Now()
51 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE BCC.T!
52
53 #
54 # File: makefile.bcc
55 # Author: Julian Smart
56 # Created: 1993
57 # Updated:
58 # Copyright:(c) 1993, AIAI, University of Edinburgh
59 #
60 # "%W% %G%"
61 #
62 # Makefile : Builds wxWindows library wx.lib for Windows 3.1
63 # and Borland C++ 3.1
64
65 !if "$(BCCDIR)" == ""
66 !error You must define the BCCDIR variable in autoexec.bat, e.g. BCCDIR=d:\bc4
67 !endif
68
69 !if "$(WXWIN)" == ""
70 !error You must define the WXWIN variable in autoexec.bat, e.g. WXWIN=c:\wx
71 !endif
72
73 !if "$(CFG)" == ""
74 # !error You must start compiling from wx\src, not wx\src\msw.
75 !endif
76
77 !ifndef DEBUG
78 DEBUG=0
79 !endif
80
81 WXDIR = $(WXWIN)
82
83 !include $(WXDIR)\src\makebcc.env
84
85 THISDIR = $(WXDIR)\src\msw
86
87 # Please set these according to the settings in wx_setup.h, so we can include
88 # the appropriate libraries in wx.lib
89 USE_CTL3D=1
90 USE_XPM_IN_MSW=0
91
92 PERIPH_LIBS=
93 PERIPH_TARGET=
94 PERIPH_CLEAN_TARGET=
95
96 !if "$(USE_CTL3D)" == "1"
97 PERIPH_LIBS=$(BCCDIR)\lib\ctl3dv2.lib $(PERIPH_LIBS)
98 !endif
99
100 !if "$(USE_XPM_IN_MSW)" == "1"
101 PERIPH_LIBS=$(WXDIR)\xpm.lib $(PERIPH_LIBS)
102 PERIPH_TARGET=xpm $(PERIPH_TARGET)
103 PERIPH_CLEAN_TARGET=clean_xpm $(PERIPH_CLEAN_TARGET)
104 !endif
105
106 # TODO: add these libraries
107 # PERIPH_LIBS=$(WXDIR)\lib\zlib.lib $(WXDIR)\lib\winpng.lib $(PERIPH_LIBS)
108 PERIPH_TARGET=zlib png $(PERIPH_TARGET)
109 PERIPH_CLEAN_TARGET=clean_zlib clean_png $(PERIPH_CLEAN_TARGET)
110
111 CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
112
113 LIBTARGET= $(WXLIBDIR)\wx.lib
114 DUMMY=dummy
115
116 GENDIR=..\generic
117 COMMDIR=..\common
118 OLEDIR=.\ole
119 MSWDIR=.
120
121 DOCDIR = $(WXDIR)\docs
122
123 GENERICOBJS= #$ ExpandList("WXGENERICOBJS");
124
125 COMMONOBJS = \
126 $(MSWDIR)\y_tab.obj \
127 #$ ExpandList("WXCOMMONOBJS");
128
129 MSWOBJS = #$ ExpandList("WXMSWOBJS");
130
131 OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS)
132
133 default: wx
134
135 wx: $(CFG) $(DUMMY).obj $(OBJECTS) $(PERIPH_TARGET) $(LIBTARGET)
136
137 $(LIBTARGET): $(DUMMY).obj $(OBJECTS) $(PERIPH_LIBS)
138 erase $(LIBTARGET)
139 tlib $(LIBTARGET) /P1024 @&&!
140 +$(OBJECTS:.obj =.obj +) +$(PERIPH_LIBS:.lib =.lib +)
141 !
142
143 dummy.obj: dummy.$(SRCSUFF) $(LOCALHEADERS) $(BASEHEADERS) $(WXDIR)\include\wx\wx.h
144 dummydll.obj: dummydll.$(SRCSUFF) $(LOCALHEADERS) $(BASEHEADERS) $(WXDIR)\include\wx\wx.h
145
146 $(MSWDIR)\y_tab.obj: $(COMMDIR)\y_tab.c $(COMMDIR)\lex_yy.c
147
148 # cl @<<
149 # $(CPPFLAGS2) /c $*.c -DUSE_DEFINE -DYY_USE_PROTOS /Fo$@
150 # <<
151
152 $(COMMDIR)\y_tab.c: $(COMMDIR)\dosyacc.c
153 copy $(COMMDIR)\dosyacc.c $(COMMDIR)\y_tab.c
154
155 $(COMMDIR)\lex_yy.c: $(COMMDIR)\doslex.c
156 copy $(COMMDIR)\doslex.c $(COMMDIR)\lex_yy.c
157
158 # $(OBJECTS): $(WXDIR)\include\wx\setup.h
159
160 #${
161 $_ = $project{"WXMSWOBJS"};
162 my @objs = split;
163 foreach (@objs) {
164 $text .= $_ . ": ";
165 s/obj/\$(SRCSUFF)/;
166 $text .= $_ . "\n\n";
167 }
168 #$}
169
170 ########################################################
171 # Common objects (always compiled)
172
173 #${
174 $_ = $project{"WXCOMMONOBJS"};
175 my @objs = split;
176 foreach (@objs) {
177 $text .= $_ . ": ";
178 $suffix = $project{"WXCOBJS"} =~ /\Q$_/ ? "c" : '$(SRCSUFF)';
179 s/MSWDIR/COMMDIR/;
180 s/obj/$suffix/;
181 $text .= $_ . "\n\n";
182 }
183 #$}
184
185 ########################################################
186 # Generic objects (not always compiled, depending on
187 # whether platforms have native implementations)
188
189 #${
190 $_ = $project{"WXGENERICOBJS"};
191 my @objs = split;
192 foreach (@objs) {
193 $text .= $_ . ": ";
194 s/MSWDIR/GENDIR/;
195 s/obj/\$(SRCSUFF)/;
196 $text .= $_ . "\n\n";
197 }
198 #$}
199
200 all_utils:
201 cd $(WXDIR)\utils
202 make -f makefile.bcc
203 cd $(WXDIR)\src\msw
204
205 all_samples:
206 cd $(WXDIR)\samples
207 make -f makefile.bcc
208 cd $(WXDIR)\src\msw
209
210 all_execs:
211 cd $(WXDIR)\utils
212 make -f makefile.bcc all_execs
213 cd $(WXDIR)\src\msw
214
215 all_libs:
216 cd $(WXDIR)\src\msw
217 make -f makefile.bcc ctl3d dib fafa gauge hytext itsy prologio rcparser wx wxgraph\
218 wxstring wxtree mfutils # wxxpm
219
220 all_contribs:
221 cd $(WXDIR)\src\msw
222 make -f makefile.bcc ctl3d fafa wxstring itsy gauge # wxxpm
223
224 # CONTRIB
225 ctl3d: $(CFG)
226 cd $(WXDIR)\src\msw\ctl3d\borland
227 make -f makefile.bcc -DCFG=$(CFG)
228 cd $(WXDIR)\src\msw
229
230 wxxpm: $(CFG)
231 cd $(WXDIR)\src\xpm
232 make -f makefile.bcc -DCFG=$(CFG) -DFINAL=$(FINAL) -DWXWIN=$(WXDIR) -DDEBUG=$(DEBUG)
233 cd $(WXDIR)\src\msw
234
235 png: $(CFG)
236 cd $(WXDIR)\src\png
237 make -f makefile.bcc
238 cd $(WXDIR)\src\msw
239
240 clean_png:
241 cd $(WXDIR)\src\png
242 make -f makefile.bcc clean
243 cd $(WXDIR)\src\msw
244
245 zlib: $(CFG)
246 cd $(WXDIR)\src\zlib
247 make -f makefile.bcc
248 cd $(WXDIR)\src\msw
249
250 clean_zlib:
251 cd $(WXDIR)\src\zlib
252 make -f makefile.bcc clean
253 cd $(WXDIR)\src\msw
254
255 $(CFG): makefile.bcc
256 copy &&!
257 -H=$(WXDIR)\src\msw\borland.pch
258 -2
259 -P
260 -d
261 -w-hid
262 -w-par
263 -w-pia
264 -w-aus
265 -w-rch
266 -ml
267 -Od
268 -WE
269 -Fs-
270 -Vf
271 -Ff=4
272 -I$(WXINC);$(BCCDIR)\include;$(WXDIR)/src/png;$(WXDIR)/src/zlib;$(WXDIR)/src/xpm
273 -I$(WXDIR)\include\wx\msw\gnuwin32
274 -L$(BCCDIR)\lib
275 -D__WXWIN__
276 -D__WXMSW__
277 -D__WINDOWS__
278 -D__WIN16__
279 ! $(CFG)
280 !if "$(BOR_VER)" == "3.1"
281 echo -Ff=4 >>$(CFG)
282 !elif "$(BOR_VER)" == "4"
283 echo -Ff=512 >>$(CFG)
284 echo -dc >>$(CFG)
285 !else
286 echo -Ff=512 >>$(CFG)
287 echo -dc >>$(CFG)
288 !endif
289
290 # -O was: -Oxt
291
292 clean: $(PERIPH_CLEAN_TARGET)
293 erase $(LIBTARGET)
294 erase *.obj
295 erase *.pch
296 erase *.csm
297 erase *.cfg
298 erase ..\common\y_tab.c
299 erase ..\common\lex_yy.c
300
301 cleanall: clean
302
303
304 MFTYPE=bcc
305 makefile.$(MFTYPE) : $(WXWIN)\distrib\msw\tmake\filelist.txt $(WXWIN)\distrib\msw\tmake\$(MFTYPE).t
306 cd $(WXWIN)\distrib\msw\tmake
307 tmake -t $(MFTYPE) wxwin.pro -o makefile.$(MFTYPE)
308 copy makefile.$(MFTYPE) $(WXWIN)\src\msw