]>
Commit | Line | Data |
---|---|---|
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 | 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 | ||
36 | $isCFile = $file =~ /\.c$/; | |
37 | $file =~ s/cp?p?$/obj/; | |
38 | $obj = "\$(MSWDIR)\\" . $file . " "; | |
39 | $project{"WXCOMMONOBJS"} .= $obj; | |
40 | $project{"WXCOBJS"} .= $obj if $isCFile; | |
41 | } | |
42 | ||
43 | #! special hack for Borland in 16 bits needs this file | |
44 | $project{"WXCOMMONOBJS"} .= '${MSWDIR}\resourc2.obj'; | |
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 | ||
50 | $isCFile = $file =~ /\.c$/; | |
51 | $file =~ s/cp?p?$/obj/; | |
52 | $obj = "\$(MSWDIR)\\" . $file . " "; | |
53 | $project{"WXMSWOBJS"} .= $obj; | |
54 | $project{"WXCOBJS"} .= $obj if $isCFile; | |
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 | |
86 | DEBUG=0 | |
87 | !endif | |
88 | ||
89 | WXDIR = $(WXWIN) | |
90 | ||
91 | !include $(WXDIR)\src\makebcc.env | |
92 | ||
93 | THISDIR = $(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 | |
97 | USE_CTL3D=1 | |
98 | USE_XPM_IN_MSW=0 | |
99 | ||
100 | PERIPH_LIBS= | |
101 | PERIPH_TARGET= | |
102 | PERIPH_CLEAN_TARGET= | |
103 | ||
104 | !if "$(USE_CTL3D)" == "1" | |
105 | PERIPH_LIBS=$(WXDIR)\lib\bcc16\ctl3dv2.lib $(PERIPH_LIBS) | |
106 | !endif | |
107 | ||
108 | !if "$(USE_XPM_IN_MSW)" == "1" | |
109 | PERIPH_LIBS=$(WXDIR)\xpm.lib $(PERIPH_LIBS) | |
110 | PERIPH_TARGET=xpm $(PERIPH_TARGET) | |
111 | PERIPH_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) | |
116 | PERIPH_TARGET=zlib png $(PERIPH_TARGET) | |
117 | PERIPH_CLEAN_TARGET=clean_zlib clean_png $(PERIPH_CLEAN_TARGET) | |
118 | ||
119 | CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG) | |
120 | ||
121 | LIBTARGET= $(WXLIBDIR)\wx.lib | |
122 | DUMMY=dummy | |
123 | ||
124 | GENDIR=..\generic | |
125 | COMMDIR=..\common | |
126 | OLEDIR=.\ole | |
127 | MSWDIR=. | |
128 | ||
129 | DOCDIR = $(WXDIR)\docs | |
130 | ||
131 | GENERICOBJS= #$ ExpandList("WXGENERICOBJS"); | |
132 | ||
133 | COMMONOBJS = \ | |
134 | $(MSWDIR)\y_tab.obj \ | |
135 | #$ ExpandList("WXCOMMONOBJS"); | |
136 | ||
137 | MSWOBJS = #$ ExpandList("WXMSWOBJS"); | |
138 | ||
139 | OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS) | |
140 | ||
141 | default: wx | |
142 | ||
143 | wx: $(CFG) $(DUMMY).obj $(OBJECTS) $(PERIPH_TARGET) $(LIBTARGET) | |
144 | ||
145 | $(LIBTARGET): $(DUMMY).obj $(OBJECTS) $(PERIPH_LIBS) | |
146 | erase $(LIBTARGET) | |
147 | tlib $(LIBTARGET) /P1024 @&&! | |
148 | +$(COMMONOBJS:.obj =.obj +)\ | |
149 | +$(GENERICOBJS:.obj =.obj +)\ | |
150 | +$(MSWOBJS:.obj =.obj +)\ | |
151 | +$(PERIPH_LIBS:.lib =.lib +) | |
152 | ! | |
153 | ||
154 | dummy.obj: dummy.$(SRCSUFF) $(LOCALHEADERS) $(BASEHEADERS) $(WXDIR)\include\wx\wx.h | |
155 | dummydll.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 .= $_ . ": "; | |
176 | $suffix = $project{"WXCOBJS"} =~ /\Q$_/ ? "c" : '$(SRCSUFF)'; | |
177 | s/obj$/$suffix/; | |
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 .= $_ . ": "; | |
190 | $suffix = $project{"WXCOBJS"} =~ /\Q$_/ ? "c" : '$(SRCSUFF)'; | |
191 | s/MSWDIR/COMMDIR/; | |
192 | s/obj$/$suffix/; | |
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/; | |
207 | s/obj$/\$(SRCSUFF)/; | |
208 | $text .= $_ . "\n\n"; | |
209 | } | |
210 | #$} | |
211 | ||
212 | all_utils: | |
213 | cd $(WXDIR)\utils | |
214 | make -f makefile.bcc | |
215 | cd $(WXDIR)\src\msw | |
216 | ||
217 | all_samples: | |
218 | cd $(WXDIR)\samples | |
219 | make -f makefile.bcc | |
220 | cd $(WXDIR)\src\msw | |
221 | ||
222 | all_execs: | |
223 | cd $(WXDIR)\utils | |
224 | make -f makefile.bcc all_execs | |
225 | cd $(WXDIR)\src\msw | |
226 | ||
227 | all_libs: | |
228 | cd $(WXDIR)\src\msw | |
229 | make -f makefile.bcc dib fafa gauge hytext itsy prologio rcparser wx wxgraph\ | |
230 | wxstring wxtree mfutils # wxxpm | |
231 | ||
232 | all_contribs: | |
233 | cd $(WXDIR)\src\msw | |
234 | make -f makefile.bcc fafa wxstring itsy gauge # wxxpm | |
235 | ||
236 | # CONTRIB | |
237 | wxxpm: $(CFG) | |
238 | cd $(WXDIR)\src\xpm | |
239 | make -f makefile.bcc -DCFG=$(CFG) -DFINAL=$(FINAL) -DWXWIN=$(WXDIR) -DDEBUG=$(DEBUG) | |
240 | cd $(WXDIR)\src\msw | |
241 | ||
242 | png: $(CFG) | |
243 | cd $(WXDIR)\src\png | |
244 | make -f makefile.bcc | |
245 | cd $(WXDIR)\src\msw | |
246 | ||
247 | clean_png: | |
248 | cd $(WXDIR)\src\png | |
249 | make -f makefile.bcc clean | |
250 | cd $(WXDIR)\src\msw | |
251 | ||
252 | zlib: $(CFG) | |
253 | cd $(WXDIR)\src\zlib | |
254 | make -f makefile.bcc | |
255 | cd $(WXDIR)\src\msw | |
256 | ||
257 | clean_zlib: | |
258 | cd $(WXDIR)\src\zlib | |
259 | make -f makefile.bcc clean | |
260 | cd $(WXDIR)\src\msw | |
261 | ||
262 | $(CFG): makefile.bcc | |
263 | copy &&! | |
264 | -H=$(WXDIR)\src\msw\borland.pch | |
265 | -2 | |
266 | -P | |
267 | -d | |
268 | -w-hid | |
269 | -w-par | |
270 | -w-pia | |
271 | -w-aus | |
272 | -w-rch | |
273 | -ml | |
274 | -Od | |
275 | -WE | |
276 | -Fs- | |
277 | -Vf | |
278 | -Ff=4 | |
279 | -I$(WXINC);$(BCCDIR)\include;$(WXDIR)/src/generic;$(WXDIR)/src/png;$(WXDIR)/src/zlib;$(WXDIR)/src/xpm | |
280 | -I$(WXDIR)\include\wx\msw\gnuwin32 | |
281 | -L$(BCCDIR)\lib | |
282 | -D__WXWIN__ | |
283 | -D__WXMSW__ | |
284 | -D__WINDOWS__ | |
285 | -D__WIN16__ | |
286 | ! $(CFG) | |
287 | !if "$(BOR_VER)" == "3.1" | |
288 | echo -Ff=4 >>$(CFG) | |
289 | !elif "$(BOR_VER)" == "4" | |
290 | echo -Ff=512 >>$(CFG) | |
291 | echo -dc >>$(CFG) | |
292 | !else | |
293 | echo -Ff=512 >>$(CFG) | |
294 | echo -dc >>$(CFG) | |
295 | !endif | |
296 | ||
297 | # -O was: -Oxt | |
298 | ||
299 | clean: $(PERIPH_CLEAN_TARGET) | |
300 | erase $(LIBTARGET) | |
301 | erase *.obj | |
302 | erase *.pch | |
303 | erase *.csm | |
304 | erase *.cfg | |
305 | erase ..\common\y_tab.c | |
306 | erase ..\common\lex_yy.c | |
307 | ||
308 | cleanall: clean | |
309 | ||
310 | ||
311 | MFTYPE=bcc | |
312 | # Can't use this or we'll have to distribute all tmake files with wxWindows | |
313 | #makefile.$(MFTYPE) : $(WXWIN)\distrib\msw\tmake\filelist.txt $(WXWIN)\distrib\msw\tmake\$(MFTYPE).t | |
314 | ||
315 | self: | |
316 | cd $(WXWIN)\distrib\msw\tmake | |
317 | tmake -t $(MFTYPE) wxwin.pro -o makefile.$(MFTYPE) | |
318 | copy makefile.$(MFTYPE) $(WXWIN)\src\msw |