]> git.saurik.com Git - wxWidgets.git/blob - build/bakefiles/common.bkl
1edb1ad4f327c9d949cd2cf14029b3bd2c80022c
[wxWidgets.git] / build / bakefiles / common.bkl
1 <?xml version="1.0" ?>
2 <!-- $Id$ -->
3
4 <makefile>
5
6 <!-- bakefile modules we need: -->
7 <using module="datafiles"/>
8
9 <!-- load python module with wxwindows helpers: -->
10 <using module="wxwin"/>
11
12 <include file="config.bkl"/>
13
14
15 <!-- ================================================================== -->
16 <!-- wxWindows version numbers: -->
17 <!-- ================================================================== -->
18
19 <set var="WXVER_MAJOR">$(wxwin.getVersionMajor())</set>
20 <set var="WXVER_MINOR">$(wxwin.getVersionMinor())</set>
21 <set var="WXVER_RELEASE">$(wxwin.getVersionRelease())</set>
22 <set var="WX_VERSION">$(WXVER_MAJOR).$(WXVER_MINOR).$(WXVER_RELEASE)</set>
23
24 <set var="WX_STABLE_BRANCH">$(int(int(WXVER_MINOR) % 2 == 0))</set>
25
26 <set var="WXSOVERSION">
27 <if cond="WX_STABLE_BRANCH=='1'">0.0.0</if>
28 <if cond="WX_STABLE_BRANCH=='0'">$(WXVER_RELEASE).0.0</if>
29 </set>
30 <set var="WXMACVERSION">$(WX_VERSION)</set>
31 <set var="WXWIN32DLLVERSION">
32 <if cond="WX_STABLE_BRANCH=='1'">$(WXVER_MAJOR)$(WXVER_MINOR)</if>
33 <if cond="WX_STABLE_BRANCH=='0'">$(WXVER_MAJOR)$(WXVER_MINOR)$(WXVER_RELEASE)</if>
34 </set>
35
36
37 <!-- ================================================================== -->
38 <!-- Names of libraries and DLLs: -->
39 <!-- ================================================================== -->
40
41 <set var="PORTNAME">
42 <if cond="USE_GUI=='0'">base</if>
43 <if cond="USE_GUI=='1'">$(TOOLKIT_LOWERCASE)$(TOOLKIT_VERSION)</if>
44 </set>
45
46 <set var="WXBASEPORT">
47 <if cond="TOOLKIT=='MAC'">_carbon</if>
48 </set>
49
50 <set var="COMPILERORGCC">
51 <if cond="isdefined('COMPILER')">$(COMPILER)</if>
52 <if cond="not isdefined('COMPILER')">gcc</if>
53 </set>
54 <set var="WXCOMPILER">
55 <if cond="PLATFORM_WIN32=='1'">_$(COMPILERORGCC)</if>
56 </set>
57
58 <set var="VENDORTAG">
59 <if cond="PLATFORM_WIN32=='1' and OFFICIAL_BUILD=='1'"></if>
60 <if cond="PLATFORM_WIN32=='1' and OFFICIAL_BUILD=='0'">_$(VENDOR)</if>
61 </set>
62
63 <set var="WXDEBUGFLAG">
64 <if cond="BUILD=='debug' and DEBUG_FLAG=='default'">d</if>
65 <if cond="DEBUG_FLAG=='1'">d</if>
66 </set>
67 <set var="WXUNICODEFLAG">
68 <if cond="UNICODE=='1'">u</if>
69 </set>
70 <set var="WXNAMESUFFIX">
71 $(WXUNICODEFLAG)$(WXDEBUGFLAG)
72 </set>
73
74 <set var="WXUNIVNAME">
75 <if cond="WXUNIV=='1'">univ</if>
76 </set>
77 <set var="WXUNIV_DEFINE">
78 <if cond="WXUNIV=='1'">__WXUNIVERSAL__</if>
79 </set>
80
81 <if cond="FORMAT=='autoconf'">
82 <set var="WXNAMEPREFIX">wx_base$(WXBASEPORT)</set>
83 <set var="WXNAMEPREFIXGUI">wx_$(PORTNAME)$(WXUNIVNAME)</set>
84 <set var="WXVERSIONTAG">-$(WXVER_MAJOR).$(WXVER_MINOR)</set>
85 </if>
86 <if cond="FORMAT!='autoconf'">
87 <set var="WXNAMEPREFIX">
88 wxbase$(WXBASEPORT)$(WXVER_MAJOR)$(WXVER_MINOR)
89 </set>
90 <set var="WXNAMEPREFIXGUI">
91 wx$(PORTNAME)$(WXUNIVNAME)$(WXVER_MAJOR)$(WXVER_MINOR)</set>
92 <set var="WXVERSIONTAG"></set>
93 </if>
94 <set var="WXDLLNAMEPREFIX">
95 <if cond="PLATFORM_WIN32=='1'">
96 wxbase$(WXBASEPORT)$(WXWIN32DLLVERSION)
97 </if>
98 <if cond="PLATFORM_WIN32=='0'">$(WXNAMEPREFIX)</if>
99 </set>
100 <set var="WXDLLNAMEPREFIXGUI">
101 <if cond="PLATFORM_WIN32=='1'">
102 wx$(PORTNAME)$(WXUNIVNAME)$(WXWIN32DLLVERSION)
103 </if>
104 <if cond="PLATFORM_WIN32=='0'">$(WXNAMEPREFIXGUI)</if>
105 </set>
106 <set var="WXDLLVERSIONTAG">
107 <if cond="PLATFORM_WIN32=='1'"></if>
108 <if cond="PLATFORM_WIN32=='0'">$(WXVERSIONTAG)</if>
109 </set>
110
111
112 <!-- =============================================================== -->
113 <!-- Names of component libraries: -->
114 <!-- =============================================================== -->
115
116 <set var="WXLIB_BASE">
117 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('base')))</if>
118 </set>
119 <set var="WXLIB_NET">
120 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('net')))</if>
121 </set>
122 <set var="WXLIB_CORE">
123 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('core')))</if>
124 </set>
125 <set var="WXLIB_ADV">
126 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('adv')))</if>
127 </set>
128 <set var="WXLIB_HTML">
129 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('html')))</if>
130 </set>
131 <set var="WXLIB_XML">
132 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('xml')))</if>
133 </set>
134 <set var="WXLIB_ODBC">
135 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('odbc')))</if>
136 </set>
137 <set var="WXLIB_DBGRID">
138 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('dbgrid')))</if>
139 </set>
140
141 <set var="WXLIB_MONO">
142 <if cond="MONOLITHIC=='1'">$(mk.evalExpr(wxwin.mkLibName('mono')))</if>
143 </set>
144
145
146 <!-- =============================================================== -->
147 <!-- Where to store built libraries and objects: -->
148 <!-- =============================================================== -->
149
150
151 <if cond="FORMAT!='autoconf'">
152 <set var="WXDLLFLAG">
153 <if cond="SHARED=='1'">dll</if>
154 </set>
155 <set var="CFG_NAME_PART">
156 $(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)
157 </set>
158 <set var="OBJS" make_var="1">$(COMPILER)_$(CFG_NAME_PART)</set>
159 <set var="BUILDDIR">$(OBJS)</set>
160 </if>
161
162 <set var="LIBDIRNAME" make_var="1">
163 <if cond="FORMAT=='autoconf'">$(top_builddir)lib</if>
164 <if cond="FORMAT!='autoconf'">
165 $(nativePaths(TOP_SRCDIR))lib$(DIRSEP)$(COMPILER)_$(CFG_NAME_PART)
166 </if>
167 </set>
168
169
170 <!-- =============================================================== -->
171 <!-- Templates for libs: -->
172 <!-- =============================================================== -->
173
174 <set var="DEBUGINFO">
175 <if cond="BUILD=='debug' and DEBUG_INFO=='default'">on</if>
176 <if cond="DEBUG_INFO=='1'">on</if>
177 <if cond="BUILD=='release' and DEBUG_INFO=='default'">off</if>
178 <if cond="DEBUG_INFO=='0'">off</if>
179 </set>
180 <set var="DEBUGRUNTIME">
181 <if cond="DEBUG_RUNTIME_LIBS=='default'">$(DEBUGINFO)</if>
182 <if cond="DEBUG_RUNTIME_LIBS=='0'">off</if>
183 <if cond="DEBUG_RUNTIME_LIBS=='1'">on</if>
184 </set>
185 <set var="OPTIMIZEFLAG">
186 <if cond="BUILD=='debug'">off</if>
187 <if cond="BUILD=='release'">speed</if>
188 </set>
189
190 <set var="DEBUG_DEFINE">
191 <if cond="FORMAT!='autoconf' and BUILD=='debug' and DEBUG_FLAG=='default'">__WXDEBUG__</if>
192 <if cond="FORMAT!='autoconf' and DEBUG_FLAG=='1'">__WXDEBUG__</if>
193 </set>
194 <set var="UNICODE_DEFINE">
195 <if cond="FORMAT!='autoconf' and UNICODE=='1'">wxUSE_UNICODE=1</if>
196 </set>
197
198 <set var="UNICOWS_LIB">
199 <if cond="MSLU=='1'">unicows</if>
200 </set>
201
202 <template id="common_settings">
203 <debug-info>$(DEBUGINFO)</debug-info>
204 <debug-runtime-libs>$(DEBUGRUNTIME)</debug-runtime-libs>
205 <optimize>$(OPTIMIZEFLAG)</optimize>
206 <threading>multi</threading>
207 <runtime-libs>$(RUNTIME_LIBS)</runtime-libs>
208 <if cond="FORMAT!='autoconf'">
209 <cppflags>$(EXTRACFLAGS)</cppflags>
210 </if>
211 </template>
212
213 <template id="anylib">
214 <dirname>$(LIBDIRNAME)</dirname>
215 <install-to>$(LIBDIR)</install-to>
216 </template>
217
218 <template id="3rdparty_lib" template="common_settings,anylib">
219 <libname>$(id)$(WXDEBUGFLAG)$(HOST_SUFFIX)</libname>
220 <!--
221 we want to install 3rd party libs system-wide only with static
222 version of wxWindows; otherwise they are embedded in shared libs:
223 -->
224 <install-if>SHARED=='0'</install-if>
225 </template>
226
227
228 <!-- =============================================================== -->
229 <!-- 3rd party libs: -->
230 <!-- =============================================================== -->
231
232 <!-- 3rd party libraries: -->
233 <include file="regex.bkl"/>
234 <include file="zlib.bkl"/>
235 <include file="png.bkl"/>
236 <include file="jpeg.bkl"/>
237 <include file="tiff.bkl"/>
238 <include file="odbc.bkl"/>
239 <include file="expat.bkl"/>
240
241
242 <!-- =============================================================== -->
243 <!-- Templates for wxWindows libs: -->
244 <!-- =============================================================== -->
245
246 <template id="wx" template="common_settings">
247 <set var="wxid">$(wxwin.mk_wxid(id))</set>
248 <define>__WX$(TOOLKIT)__</define>
249 <define>$(WXUNIV_DEFINE)</define>
250 <define>$(DEBUG_DEFINE)</define>
251 <define>$(UNICODE_DEFINE)</define>
252 <include>$(TOP_SRCDIR)include</include>
253 <lib-path>$(LIBDIRNAME)</lib-path>
254 <include cond="FORMAT!='autoconf'">$(LIBDIRNAME)</include>
255 <include>$(INC_TIFF)</include>
256 <include>$(INC_JPEG)</include>
257 <include>$(INC_PNG)</include>
258 <include>$(INC_ZLIB)</include>
259 <include>$(INC_ODBC)</include>
260 <include>$(INC_REGEX)</include>
261 <include>$(INC_EXPAT)</include>
262 </template>
263
264 <!-- for both GUI and wxBase libs/samples: -->
265 <template id="wx_append_base_nomono">
266 <!-- link against builtin 3rd party libs, if needed: -->
267 <sys-lib>$(LIB_TIFF)</sys-lib>
268 <sys-lib>$(LIB_JPEG)</sys-lib>
269 <sys-lib>$(LIB_PNG)</sys-lib>
270 <sys-lib>$(LIB_ZLIB)</sys-lib>
271 <sys-lib>$(LIB_ODBC)</sys-lib>
272 <sys-lib>$(LIB_REGEX)</sys-lib>
273 <sys-lib>$(LIB_EXPAT)</sys-lib>
274
275 <ldlibs>$(EXTRALIBS)</ldlibs>
276
277 <!-- system libraries on windows: -->
278 <if cond="FORMAT!='autoconf'">
279 <sys-lib>$(UNICOWS_LIB)</sys-lib>
280 <if cond="COMPILER=='bcc'">
281 <sys-lib>import32</sys-lib>
282 <sys-lib>ole2w32</sys-lib>
283 </if>
284 <if cond="COMPILER!='bcc'">
285 <sys-lib>kernel32</sys-lib>
286 <sys-lib>user32</sys-lib>
287 <sys-lib>gdi32</sys-lib>
288 <sys-lib>comdlg32</sys-lib>
289 <sys-lib>winspool</sys-lib>
290 <sys-lib>winmm</sys-lib>
291 <sys-lib>shell32</sys-lib>
292 <sys-lib>comctl32</sys-lib>
293 <sys-lib>odbc32</sys-lib>
294 <sys-lib>ole32</sys-lib>
295 <sys-lib>oleaut32</sys-lib>
296 <sys-lib>uuid</sys-lib>
297 <sys-lib>rpcrt4</sys-lib>
298 <sys-lib>advapi32</sys-lib>
299 <sys-lib>wsock32</sys-lib>
300 </if>
301 </if>
302 </template>
303
304 <define-tag name="msvc-headers" rules="dll,lib">
305 <if cond="FORMAT=='msvc6prj'">
306 <msvc-project-files>
307 $(addPrefixToList('include\', wxwin.headersOnly(value)))
308 </msvc-project-files>
309 </if>
310 </define-tag>
311
312 <define-tag name="msvc-copy-setup-h" rules="dll,lib">
313 <if cond="FORMAT=='msvc6prj'">
314 <msvc-headers>wx/msw/setup.h</msvc-headers>
315 <set var="__custom_build_files" append="1">
316 include\wx\msw\setup.h
317 </set>
318 <set var="__custom_build_include_wx_msw_setup_h">
319 Creating $(LIBDIRNAME)\wx\setup.h
320 InputPath=..\include\wx\msw\setup.h
321
322 "$(LIBDIRNAME)\wx\setup.h" : $(DOLLAR)(SOURCE) "$(DOLLAR)(INTDIR)" "$(DOLLAR)(OUTDIR)"
323 $(TAB)copy "$(DOLLAR)(InputPath)" $(LIBDIRNAME)\wx\setup.h
324 </set>
325 </if>
326 </define-tag>
327
328
329 <!-- for GUI libs/samples: -->
330 <template id="wx_append_nomono" template="wx_append_base_nomono">
331 <ldlibs>$(EXTRALIBS_GUI)</ldlibs>
332 </template>
333
334
335 <template id="wx_append_base" template_append="wx_append_base_nomono">
336 <!-- Always link against the wxWin library in monolithic build: -->
337 <sys-lib>$(WXLIB_MONO)</sys-lib>
338 </template>
339 <template id="wx_append" template_append="wx_append_nomono">
340 <!-- Always link against the wxWin library in monolithic build: -->
341 <sys-lib>$(WXLIB_MONO)</sys-lib>
342 </template>
343
344
345 <set var="WX_DISABLE_PRECOMP_HEADERS" overwrite="0">0</set>
346
347 <template id="wx_lib_b" template="wx,anylib">
348 <set var="WXLIBNAME">$(wxwin.mkLibName(wxid))</set>
349 <libname>$(WXLIBNAME)</libname>
350
351 <if cond="WX_DISABLE_PRECOMP_HEADERS=='0'">
352 <if cond="FORMAT!='autoconf'">
353 <sources>$(WXTOPDIR)src/msw/dummy.cpp</sources>
354 <precomp-headers-gen>
355 $(WXTOPDIR)src/msw/dummy.cpp
356 </precomp-headers-gen>
357 </if>
358 <precomp-headers-header>wx/wxprec.h</precomp-headers-header>
359 <precomp-headers>on</precomp-headers>
360 <precomp-headers-file>wxprec_$(id)</precomp-headers-file>
361 <precomp-headers-exclude>
362 src/common/unzip.c
363 src/common/extended.c
364 src/msw/gsocket.c
365 src/msw/gsockmsw.c
366 </precomp-headers-exclude>
367 </if>
368
369 <if cond="FORMAT=='msvc6prj' and BUILDING_LIB=='1'">
370 <msvc-file-group>Common Sources:src/common/*</msvc-file-group>
371 <msvc-file-group>MSW Sources:src/msw/*</msvc-file-group>
372 <msvc-file-group>Generic Sources:src/generic/*</msvc-file-group>
373 <msvc-file-group>wxUniv Sources:src/univ/*</msvc-file-group>
374 <msvc-file-group>wxHTML Sources:src/html/*</msvc-file-group>
375 <msvc-file-group>Setup Headers:*/setup.h</msvc-file-group>
376 <msvc-file-group>MSW Headers:*wx/msw/*.h</msvc-file-group>
377 <msvc-file-group>Generic Headers:*wx/generic/*.h</msvc-file-group>
378 <msvc-file-group>wxUniv Headers:*wx/univ/*.h</msvc-file-group>
379 <msvc-file-group>wxHTML Headers:*wx/html/*.h</msvc-file-group>
380 <msvc-file-group>Common Headers:*wx/*.h</msvc-file-group>
381 </if>
382 </template>
383
384 <template id="wx_dll_b" template="wx_lib_b">
385 <set var="WXDLLNAME">$(wxwin.mkDllName(wxid))</set>
386 <dllname>$(WXDLLNAME)</dllname>
387 <version>$(WX_VERSION)</version>
388 <so_version>$(WXSOVERSION)</so_version>
389 <mac_version>$(WXMACVERSION)</mac_version>
390 </template>
391
392 <template id="wx_3rdparty_dependencies">
393 <depends>wxtiff</depends>
394 <depends>wxjpeg</depends>
395 <depends>wxpng</depends>
396 <depends>wxexpat</depends>
397 <depends>wxzlib</depends>
398 <depends cond="FORMAT=='autoconf'">wxodbc</depends>
399 <depends>wxregex</depends>
400 </template>
401
402 <template id="wx_lib" template="wx_lib_b"/>
403 <template id="wx_base_lib" template="wx_lib_b">
404 <define>wxUSE_GUI=0</define>
405 </template>
406
407 <template id="wx_dll" template="wx_dll_b,wx_3rdparty_dependencies"
408 template_append="wx_append_nomono"/>
409 <template id="wx_base_dll" template="wx_dll_b,wx_3rdparty_dependencies"
410 template_append="wx_append_base_nomono">
411 <define>wxUSE_GUI=0</define>
412 </template>
413
414 <!-- =============================================================== -->
415 <!-- Templates for building wxWindows plugins: -->
416 <!-- =============================================================== -->
417
418 <if cond="WX_STABLE_BRANCH=='1'">
419 <set var="PLUGIN_VERSION">
420 <if cond="PLATFORM_UNIX=='1'">
421 -$(WXVER_MAJOR).$(WXVER_MINOR)
422 </if>
423 <if cond="PLATFORM_UNIX=='0'">
424 $(WXVER_MAJOR)$(WXVER_MINOR)
425 </if>
426 </set>
427 </if>
428 <if cond="WX_STABLE_BRANCH=='0'">
429 <set var="PLUGIN_VERSION">
430 <if cond="PLATFORM_UNIX=='1'">
431 -$(WXVER_MAJOR).$(WXVER_MINOR).$(WXVER_RELEASE)
432 </if>
433 <if cond="PLATFORM_UNIX=='0'">
434 $(WXVER_MAJOR)$(WXVER_MINOR)$(WXVER_RELEASE)
435 </if>
436 </set>
437 </if>
438
439 <define-rule name="wx-base-plugin" extends="module">
440 <template>
441 <dllname>
442 $(id)$(addPrefixIfNotEmpty('_',WXNAMESUFFIX))$(PLUGIN_VERSION)
443 </dllname>
444 <define>WXUSINGDLL</define>
445 <define>wxUSE_GUI=0</define>
446 </template>
447 </define-rule>
448
449 <define-rule name="wx-gui-plugin" extends="module">
450 <template template="wx">
451 <dllname>
452 $(id)_$(PORTNAME)$(WXUNIVNAME)$(WXNAMESUFFIX)$(PLUGIN_VERSION)
453 </dllname>
454 <define>WXUSINGDLL</define>
455 </template>
456 </define-rule>
457
458 <!-- =============================================================== -->
459 <!-- Support for wxWindows samples and contrib: -->
460 <!-- =============================================================== -->
461
462 <!-- Link against one wxWin library. Value must be literal! -->
463 <define-tag name="wx-lib" rules="exe,dll,module">
464 <sys-lib>$(wxwin.libToLink(value))</sys-lib>
465 <if cond="FORMAT=='msvc6prj' and MONOLITHIC=='0'">
466 <depends-on-dsp>$(wxwin.makeDspDependency(value))</depends-on-dsp>
467 </if>
468 </define-tag>
469
470 </makefile>