]> git.saurik.com Git - wxWidgets.git/blob - build/bakefiles/common.bkl
more bakefile-based makefiles
[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
138 <set var="WXLIB_MONO">
139 <if cond="MONOLITHIC=='1'">$(mk.evalExpr(wxwin.mkLibName('mono')))</if>
140 </set>
141
142
143 <!-- =============================================================== -->
144 <!-- Where to store built libraries and objects: -->
145 <!-- =============================================================== -->
146
147
148 <if cond="FORMAT!='autoconf'">
149 <set var="WXDLLFLAG">
150 <if cond="SHARED=='1'">dll</if>
151 </set>
152 <set var="CFG_NAME_PART">
153 $(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)
154 </set>
155 <set var="OBJS" make_var="1">$(COMPILER)_$(CFG_NAME_PART)</set>
156 <set var="BUILDDIR">$(OBJS)</set>
157 </if>
158
159 <set var="LIBDIRNAME" make_var="1">
160 <if cond="FORMAT=='autoconf'">$(top_builddir)lib</if>
161 <if cond="FORMAT!='autoconf'">
162 $(nativePaths(TOP_SRCDIR))lib$(DIRSEP)$(COMPILER)_$(CFG_NAME_PART)
163 </if>
164 </set>
165
166
167 <!-- =============================================================== -->
168 <!-- Templates for libs: -->
169 <!-- =============================================================== -->
170
171 <set var="DEBUGINFO">
172 <if cond="BUILD=='debug' and DEBUG_INFO=='default'">on</if>
173 <if cond="DEBUG_INFO=='1'">on</if>
174 <if cond="BUILD=='release' and DEBUG_INFO=='default'">off</if>
175 <if cond="DEBUG_INFO=='0'">off</if>
176 </set>
177 <set var="DEBUGRUNTIME">
178 <if cond="DEBUG_RUNTIME_LIBS=='default'">$(DEBUGINFO)</if>
179 <if cond="DEBUG_RUNTIME_LIBS=='0'">off</if>
180 <if cond="DEBUG_RUNTIME_LIBS=='1'">on</if>
181 </set>
182 <set var="OPTIMIZEFLAG">
183 <if cond="BUILD=='debug'">off</if>
184 <if cond="BUILD=='release'">speed</if>
185 </set>
186
187 <set var="DEBUG_DEFINE">
188 <if cond="FORMAT!='autoconf' and BUILD=='debug' and DEBUG_FLAG=='default'">__WXDEBUG__</if>
189 <if cond="FORMAT!='autoconf' and DEBUG_FLAG=='1'">__WXDEBUG__</if>
190 </set>
191 <set var="UNICODE_DEFINE">
192 <if cond="FORMAT!='autoconf' and UNICODE=='1'">wxUSE_UNICODE=1</if>
193 </set>
194
195 <template id="common_settings">
196 <debug-info>$(DEBUGINFO)</debug-info>
197 <debug-runtime-libs>$(DEBUGRUNTIME)</debug-runtime-libs>
198 <optimize>$(OPTIMIZEFLAG)</optimize>
199 <threading>multi</threading>
200 <runtime-libs>$(RUNTIME_LIBS)</runtime-libs>
201 <if cond="FORMAT!='autoconf'">
202 <cppflags>$(EXTRACFLAGS)</cppflags>
203 </if>
204 </template>
205
206 <template id="anylib">
207 <dirname>$(LIBDIRNAME)</dirname>
208 <install-to>$(LIBDIR)</install-to>
209 </template>
210
211 <template id="3rdparty_lib" template="common_settings,anylib">
212 <libname>$(id)$(WXDEBUGFLAG)$(HOST_SUFFIX)</libname>
213 </template>
214
215
216 <!-- =============================================================== -->
217 <!-- 3rd party libs: -->
218 <!-- =============================================================== -->
219
220 <!-- 3rd party libraries: -->
221 <include file="regex.bkl"/>
222 <include file="zlib.bkl"/>
223 <include file="png.bkl"/>
224 <include file="jpeg.bkl"/>
225 <include file="tiff.bkl"/>
226 <include file="odbc.bkl"/>
227 <include file="expat.bkl"/>
228
229
230 <!-- =============================================================== -->
231 <!-- Templates for wxWindows libs: -->
232 <!-- =============================================================== -->
233
234 <template id="wx" template="common_settings">
235 <set var="wxid">$(wxwin.mk_wxid(id))</set>
236 <define>__WX$(TOOLKIT)__</define>
237 <define>$(WXUNIV_DEFINE)</define>
238 <define>$(DEBUG_DEFINE)</define>
239 <define>$(UNICODE_DEFINE)</define>
240 <include>$(TOP_SRCDIR)include</include>
241 <lib-path>$(LIBDIRNAME)</lib-path>
242 <include cond="FORMAT!='autoconf'">$(LIBDIRNAME)</include>
243 <include>$(INC_TIFF)</include>
244 <include>$(INC_JPEG)</include>
245 <include>$(INC_PNG)</include>
246 <include>$(INC_ZLIB)</include>
247 <include>$(INC_ODBC)</include>
248 <include>$(INC_REGEX)</include>
249 <include>$(INC_EXPAT)</include>
250 </template>
251
252 <!-- for both GUI and wxBase libs/samples: -->
253 <template id="wx_append_base_nomono">
254 <!-- link against builtin 3rd party libs, if needed: -->
255 <sys-lib>$(LIB_TIFF)</sys-lib>
256 <sys-lib>$(LIB_JPEG)</sys-lib>
257 <sys-lib>$(LIB_PNG)</sys-lib>
258 <sys-lib>$(LIB_ZLIB)</sys-lib>
259 <sys-lib>$(LIB_ODBC)</sys-lib>
260 <sys-lib>$(LIB_REGEX)</sys-lib>
261 <sys-lib>$(LIB_EXPAT)</sys-lib>
262
263 <ldlibs>$(EXTRALIBS)</ldlibs>
264
265 <!-- system libraries on windows: -->
266 <if cond="FORMAT!='autoconf'">
267 <if cond="COMPILER=='bcc'">
268 <sys-lib>import32</sys-lib>
269 <sys-lib>ole2w32</sys-lib>
270 </if>
271 <if cond="COMPILER!='bcc'">
272 <sys-lib>kernel32</sys-lib>
273 <sys-lib>user32</sys-lib>
274 <sys-lib>gdi32</sys-lib>
275 <sys-lib>comdlg32</sys-lib>
276 <sys-lib>winspool</sys-lib>
277 <sys-lib>winmm</sys-lib>
278 <sys-lib>shell32</sys-lib>
279 <sys-lib>comctl32</sys-lib>
280 <sys-lib>odbc32</sys-lib>
281 <sys-lib>ole32</sys-lib>
282 <sys-lib>oleaut32</sys-lib>
283 <sys-lib>uuid</sys-lib>
284 <sys-lib>rpcrt4</sys-lib>
285 <sys-lib>advapi32</sys-lib>
286 <sys-lib>wsock32</sys-lib>
287 </if>
288 </if>
289 </template>
290
291 <define-tag name="msvc-headers" rules="dll,lib">
292 <if cond="FORMAT=='msvc6prj'">
293 <msvc-project-files>
294 $(addPrefixToList('include\', wxwin.headersOnly(value)))
295 </msvc-project-files>
296 </if>
297 </define-tag>
298
299 <define-tag name="msvc-copy-setup-h" rules="dll,lib">
300 <if cond="FORMAT=='msvc6prj'">
301 <msvc-headers>wx/msw/setup.h</msvc-headers>
302 <set var="__custom_build_files" append="1">
303 include\wx\msw\setup.h
304 </set>
305 <set var="__custom_build_include_wx_msw_setup_h">
306 Creating $(LIBDIRNAME)\wx\setup.h
307 InputPath=..\include\wx\msw\setup.h
308
309 "$(LIBDIRNAME)\wx\setup.h" : $(DOLLAR)(SOURCE) "$(DOLLAR)(INTDIR)" "$(DOLLAR)(OUTDIR)"
310 $(TAB)copy "$(DOLLAR)(InputPath)" $(LIBDIRNAME)\wx\setup.h
311 </set>
312 </if>
313 </define-tag>
314
315
316 <!-- for GUI libs/samples: -->
317 <template id="wx_append_nomono" template="wx_append_base_nomono">
318 <ldlibs>$(EXTRALIBS_GUI)</ldlibs>
319 </template>
320
321
322 <template id="wx_append_base" template_append="wx_append_base_nomono">
323 <!-- Always link against the wxWin library in monolithic build: -->
324 <sys-lib>$(WXLIB_MONO)</sys-lib>
325 </template>
326 <template id="wx_append" template_append="wx_append_nomono">
327 <!-- Always link against the wxWin library in monolithic build: -->
328 <sys-lib>$(WXLIB_MONO)</sys-lib>
329 </template>
330
331
332 <set var="WX_DISABLE_PRECOMP_HEADERS" overwrite="0">0</set>
333
334 <template id="wx_lib_b" template="wx,anylib">
335 <set var="WXLIBNAME">$(wxwin.mkLibName(wxid))</set>
336 <libname>$(WXLIBNAME)</libname>
337
338 <if cond="WX_DISABLE_PRECOMP_HEADERS=='0'">
339 <if cond="FORMAT!='autoconf'">
340 <sources>$(WXTOPDIR)src/msw/dummy.cpp</sources>
341 <precomp-headers-gen>
342 $(WXTOPDIR)src/msw/dummy.cpp
343 </precomp-headers-gen>
344 </if>
345 <precomp-headers-header>wx/wxprec.h</precomp-headers-header>
346 <precomp-headers>on</precomp-headers>
347 <precomp-headers-file>wxprec_$(id)</precomp-headers-file>
348 <precomp-headers-exclude>
349 src/common/unzip.c
350 src/common/extended.c
351 src/msw/gsocket.c
352 src/msw/gsockmsw.c
353 </precomp-headers-exclude>
354 </if>
355
356 <if cond="FORMAT=='msvc6prj' and BUILDING_LIB=='1'">
357 <msvc-file-group>Common Sources:src/common/*</msvc-file-group>
358 <msvc-file-group>MSW Sources:src/msw/*</msvc-file-group>
359 <msvc-file-group>Generic Sources:src/generic/*</msvc-file-group>
360 <msvc-file-group>wxUniv Sources:src/univ/*</msvc-file-group>
361 <msvc-file-group>wxHTML Sources:src/html/*</msvc-file-group>
362 <msvc-file-group>Setup Headers:*/setup.h</msvc-file-group>
363 <msvc-file-group>Common Headers:*wx/[!/]*.h</msvc-file-group>
364 <msvc-file-group>MSW Headers:*wx/msw/*.h</msvc-file-group>
365 <msvc-file-group>Generic Headers:*wx/generic/*.h</msvc-file-group>
366 <msvc-file-group>wxUniv Headers:*wx/univ/*.h</msvc-file-group>
367 <msvc-file-group>wxHTML Headers:*wx/html/*.h</msvc-file-group>
368 </if>
369 </template>
370
371 <template id="wx_dll_b" template="wx_lib_b">
372 <set var="WXDLLNAME">$(wxwin.mkDllName(wxid))</set>
373 <dllname>$(WXDLLNAME)</dllname>
374 <version>$(WX_VERSION)</version>
375 <so_version>$(WXSOVERSION)</so_version>
376 <mac_version>$(WXMACVERSION)</mac_version>
377 </template>
378
379 <template id="wx_lib" template="wx_lib_b"/>
380 <template id="wx_base_lib" template="wx_lib_b"/>
381 <template id="wx_dll" template="wx_dll_b"
382 template_append="wx_append_nomono">
383 <depends>wxtiff</depends>
384 <depends>wxjpeg</depends>
385 <depends>wxpng</depends>
386 <depends>wxexpat</depends>
387 <depends>wxzlib</depends>
388 <depends cond="FORMAT=='autoconf'">wxodbc</depends>
389 <depends>wxregex</depends>
390 </template>
391 <template id="wx_base_dll" template="wx_dll_b"
392 template_append="wx_append_base_nomono">
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 <!-- =============================================================== -->
403 <!-- Support for wxWindows samples and contrib: -->
404 <!-- =============================================================== -->
405
406 <!-- Link against one wxWin library. Value must be literal! -->
407 <define-tag name="wx-lib" rules="exe,dll">
408 <sys-lib>$(wxwin.libToLink(value))</sys-lib>
409 </define-tag>
410
411 </makefile>