]>
Commit | Line | Data |
---|---|---|
83c7f6a7 VS |
1 | <?xml version="1.0" ?> |
2 | <!-- $Id$ --> | |
3 | ||
4 | <!-- Original source: http://wiki.wxwidgets.org/wiki.pl?Bakefile --> | |
5 | <!-- Modified by: Francesco Montorsi <frm@users.sourceforge.net> --> | |
6 | <!-- Vaclav Slavik <vslavik@fastmail.fm> to better fit | |
7 | into Bakefile's presets --> | |
8 | <!-- Creation date: 6/9/2004 --> | |
9 | <!-- Last revision: 22/1/2005 off-CVS --> | |
10 | <!-- $Id$ --> | |
11 | ||
12 | ||
83c7f6a7 VS |
13 | <makefile> |
14 | ||
83c7f6a7 | 15 | |
83c7f6a7 | 16 | <!-- --> |
617bcbe2 | 17 | <!-- OPTIONS --> |
83c7f6a7 | 18 | <!-- --> |
617bcbe2 FM |
19 | |
20 | <set var="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL"> | |
21 | <!-- 'NORMAL' here refers to the fact that the formats for which | |
22 | FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL==1 only need | |
23 | additional compiler and/or linker flags (see e.g. WXMACHINE_FLAG) | |
24 | --> | |
25 | <if cond="FORMAT in ['msvc']">1</if> | |
26 | <if cond="FORMAT not in ['msvc']">0</if> | |
27 | </set> | |
28 | <set var="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_VIA_MSVS_PLATFORMS"> | |
29 | <!-- the formats for which FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_VIA_MSVS_PLATFORMS==1 | |
30 | need special handling: see the docs of the MSVS_PLATFORMS variable in Bakefile docs. | |
31 | --> | |
32 | <if cond="FORMAT in ['msvs2005prj','msvs2008prj']">1</if> | |
33 | <if cond="FORMAT not in ['msvs2005prj','msvs2008prj']">0</if> | |
34 | </set> | |
35 | <set var="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES"> | |
36 | <if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL=='1'">1</if> | |
37 | <if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_VIA_MSVS_PLATFORMS=='1'">1</if> | |
38 | <if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL=='0' and FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_VIA_MSVS_PLATFORMS=='0'">0</if> | |
39 | </set> | |
40 | ||
41 | <!-- This is a standard option that determines --> | |
42 | <!-- the architecture for which the lib/exe/dll later --> | |
43 | <!-- declared are meant. --> | |
44 | <if cond="not isdefined('TARGET_CPU') and FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL=='1'"> | |
45 | <set var="TARGET_CPU_DEFAULT" overwrite="0">X86</set> | |
46 | <option name="TARGET_CPU"> | |
47 | <values>X86,AMD64,IA64</values> | |
48 | <values-description>i386-compatible,AMD 64 bit,Itanium 64 bit</values-description> | |
49 | <default-value>$(TARGET_CPU_DEFAULT)</default-value> | |
50 | <description> | |
51 | Architecture of the CPU for which to build the executables and libraries | |
52 | </description> | |
53 | </option> | |
54 | </if> | |
694b7ca4 FM |
55 | <if cond="not isdefined('TARGET_CPU') and FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_VIA_MSVS_PLATFORMS=='1'"> |
56 | <!-- defining TARGET_CPU also for the formats using the MSVS_PLATFORM variable allows to write | |
57 | easier tests in user bakefiles; e.g.: | |
58 | ||
59 | <set var="MY_ARCH_DEPENDENT_VARIABLE"> | |
60 | <if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES=='0'">value1</if> | |
61 | <if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES=='1' and TARGET_CPU=='X86'">value2</if> | |
62 | <if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES=='1' and TARGET_CPU=='AMD64'">value3</if> | |
63 | <if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES=='1' and TARGET_CPU=='IA64'">value4</if> | |
64 | </set> | |
65 | --> | |
66 | <set var="TARGET_CPU"> | |
67 | <if cond="MSVS_PLATFORM=='win32'">X86</if> | |
68 | <if cond="MSVS_PLATFORM=='win64'">AMD64</if> | |
69 | <if cond="MSVS_PLATFORM=='ia64'">IA64</if> | |
70 | <!-- MSVS_PLATFORM currently does not support ia64 but this line is still needed by bakefile | |
71 | to correctly set the TARGET_CPU variable --> | |
72 | </set> | |
73 | </if> | |
83c7f6a7 | 74 | |
ad6f7122 VZ |
75 | |
76 | ||
83c7f6a7 VS |
77 | <!-- HELPER VARIABLES --> |
78 | <!-- --> | |
6af800ff VZ |
79 | |
80 | ||
83c7f6a7 VS |
81 | <!-- The unicode define we want. By default bakefile --> |
82 | <!-- makes variables an empty string, so if unicode --> | |
83 | <!-- is not defined $(UNICODE_DEFINE) would expand --> | |
84 | <!-- to nothing (literally). --> | |
85 | <set var="WXUNICODE_DEFINE"> | |
86 | <if cond="WX_UNICODE=='1'">_UNICODE</if> | |
6af800ff VZ |
87 | </set> |
88 | ||
89 | <!-- The debug define we need with win32 compilers --> | |
90 | <!-- (on Linux, the wx-config program is used). --> | |
91 | <set var="WXDEBUG_DEFINE"> | |
92 | <if cond="WX_DEBUG=='1'">__WXDEBUG__</if> | |
83c7f6a7 VS |
93 | </set> |
94 | ||
95 | <!-- These are handy ways of dealing with the --> | |
6af800ff | 96 | <!-- extensions in the library names of the --> |
83c7f6a7 | 97 | <!-- wxWindows library. --> |
c7ca49e4 | 98 | <set var="WX3RDPARTYLIBPOSTFIX"> |
e943ebd8 | 99 | <if cond="WX_DEBUG=='1'">d</if> |
965122c4 VS |
100 | </set> |
101 | ||
102 | <set var="WXCPU"> | |
103 | <if cond="FORMAT=='msevc4prj'">_$(CPU)</if> | |
694b7ca4 FM |
104 | <if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES=='1' and TARGET_CPU=='AMD64'">_amd64</if> |
105 | <if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES=='1' and TARGET_CPU=='IA64'">_ia64</if> | |
83c7f6a7 | 106 | </set> |
617bcbe2 FM |
107 | |
108 | <set var="WXMACHINE_FLAG"> | |
694b7ca4 FM |
109 | <!-- add the /MACHINE linker flag to formats with "normal" multiple-arch support when building in 64bit mode |
110 | (formats using the MSVS_PLATFORM variable don't need the /MACHINE linker flag!): --> | |
617bcbe2 FM |
111 | <if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL=='1' and TARGET_CPU=='AMD64'">/MACHINE:AMD64</if> |
112 | <if cond="FORMAT_SUPPORTS_MULTIPLE_ARCHITECTURES_NORMAL=='1' and TARGET_CPU=='IA64'">/MACHINE:IA64</if> | |
113 | </set> | |
114 | ||
83c7f6a7 | 115 | <set var="WXLIBPATH"> |
226ac45f VZ |
116 | <if cond="WX_SHARED=='0'">$(DIRSEP)lib$(DIRSEP)$(COMPILER_PREFIX)$(WXCPU)_lib</if> |
117 | <if cond="WX_SHARED=='1'">$(DIRSEP)lib$(DIRSEP)$(COMPILER_PREFIX)$(WXCPU)_dll</if> | |
83c7f6a7 | 118 | </set> |
617bcbe2 | 119 | |
e602dae8 KO |
120 | <!-- under Unix this is an option (detected at configure-time); |
121 | under Windows this is not an user option! --> | |
122 | <set var="WX_PORT"> | |
6af800ff VZ |
123 | <if cond="FORMAT=='msevc4prj'">wince</if> |
124 | <if cond="FORMAT!='msevc4prj'">msw</if> | |
125 | </set> | |
e602dae8 KO |
126 | |
127 | <set var="WXLIBINCLUDE">$(WXLIBPATH)$(DIRSEP)$(WX_PORT)$(WXLIBPOSTFIX)</set> | |
6af800ff VZ |
128 | |
129 | ||
ad6f7122 VZ |
130 | <!-- All the possible mixes for the wx library names --> |
131 | <set var="WXLIB_BASE_NAME"> | |
e0b7c2b7 | 132 | <if cond="WX_MONOLITHIC=='0'">wxbase$(WX_VERSION)$(WXLIBPOSTFIX)</if> |
ad6f7122 VZ |
133 | |
134 | <!-- | |
135 | the trick used to support monolithic builds is here: when the | |
136 | <wx-lib>base</wx-lib> tag is found, and user selected | |
137 | WX_MONOLITHIC=1, then the base library is translated to the | |
138 | monolithic library | |
139 | --> | |
e0b7c2b7 | 140 | <if cond="WX_MONOLITHIC=='1'">wx$(WX_PORT)$(WX_VERSION)$(WXLIBPOSTFIX)</if> |
ad6f7122 VZ |
141 | </set> |
142 | ||
e602dae8 | 143 | |
ad6f7122 | 144 | <!-- Libraries whose name is prefixed with 'wxbase' --> |
e602dae8 KO |
145 | <define-global-tag name="define-wxbase-lib-name"> |
146 | <set var="WXLIB_$(value.upper())_NAME"> | |
e0b7c2b7 FM |
147 | <if cond="WX_MONOLITHIC=='0'"> |
148 | wxbase$(WX_VERSION)$(WXLIBPOSTFIX)_$(value) | |
e602dae8 | 149 | </if> |
ad6f7122 | 150 | </set> |
e602dae8 | 151 | </define-global-tag> |
ad6f7122 | 152 | |
e602dae8 KO |
153 | <define-wxbase-lib-name>net</define-wxbase-lib-name> |
154 | <define-wxbase-lib-name>xml</define-wxbase-lib-name> | |
ad6f7122 VZ |
155 | |
156 | ||
e602dae8 KO |
157 | <!-- Libraries whose name is prefixed with 'wx' only --> |
158 | <define-global-tag name="define-wxlib-name"> | |
159 | <set var="WXLIB_$(value.upper())_NAME"> | |
e0b7c2b7 FM |
160 | <if cond="WX_MONOLITHIC=='0'"> |
161 | wx$(WX_PORT)$(WX_VERSION)$(WXLIBPOSTFIX)_$(value) | |
e602dae8 KO |
162 | </if> |
163 | </set> | |
164 | </define-global-tag> | |
165 | ||
166 | <define-wxlib-name>core</define-wxlib-name> | |
167 | <define-wxlib-name>media</define-wxlib-name> | |
168 | <define-wxlib-name>xrc</define-wxlib-name> | |
169 | <define-wxlib-name>html</define-wxlib-name> | |
170 | <define-wxlib-name>adv</define-wxlib-name> | |
171 | <define-wxlib-name>qa</define-wxlib-name> | |
e602dae8 | 172 | <define-wxlib-name>aui</define-wxlib-name> |
3c3ead1d | 173 | <define-wxlib-name>ribbon</define-wxlib-name> |
1c4293cb | 174 | <define-wxlib-name>propgrid</define-wxlib-name> |
54429bb3 | 175 | <define-wxlib-name>stc</define-wxlib-name> |
e602dae8 | 176 | <define-wxlib-name>richtext</define-wxlib-name> |
0d2a693b | 177 | <define-wxlib-name>webview</define-wxlib-name> |
e602dae8 | 178 | |
b8524670 | 179 | <!-- NOTE: The GL lib is not part of the monolithic build; treat it as a contrib! --> |
ad6f7122 VZ |
180 | |
181 | ||
182 | ||
83c7f6a7 VS |
183 | <!-- WX TEMPLATE --> |
184 | <!-- --> | |
185 | <!-- --> | |
186 | <!-- While not required, templates make your --> | |
187 | <!-- bakefiles much more readable. Templates, in --> | |
188 | <!-- essence, are abstract classes like c++. --> | |
189 | <!-- --> | |
190 | <!-- Your build targets "inherit" the template, --> | |
191 | <!-- along with the info associated with the template --> | |
192 | ||
193 | <!-- --> | |
194 | <!-- wxWidgets LIBRARY/APP TEMPLATE --> | |
195 | <!-- --> | |
196 | <!-- The "base class" of all our build targets --> | |
197 | <!-- This links with the appropriate native --> | |
3103e8a9 | 198 | <!-- libraries required by the platform, the libraries --> |
83c7f6a7 VS |
199 | <!-- we want for our stuff, and the wxWindows libs. --> |
200 | ||
83c7f6a7 VS |
201 | <!-- this tag is used to include wx libraries: --> |
202 | <define-tag name="wx-lib" rules="exe,dll,module"> | |
ad6f7122 VZ |
203 | <if cond="value=='base'"><sys-lib>$(WXLIB_BASE_NAME)</sys-lib></if> |
204 | <if cond="value=='core'"><sys-lib>$(WXLIB_CORE_NAME)</sys-lib></if> | |
205 | ||
206 | <if cond="value=='net'"><sys-lib>$(WXLIB_NET_NAME)</sys-lib></if> | |
207 | <if cond="value=='xml'"><sys-lib>$(WXLIB_XML_NAME)</sys-lib></if> | |
ad6f7122 | 208 | |
f814ff33 | 209 | <if cond="value=='media'"><sys-lib>$(WXLIB_MEDIA_NAME)</sys-lib></if> |
ad6f7122 VZ |
210 | <if cond="value=='xrc'"><sys-lib>$(WXLIB_XRC_NAME)</sys-lib></if> |
211 | <if cond="value=='html'"><sys-lib>$(WXLIB_HTML_NAME)</sys-lib></if> | |
212 | <if cond="value=='adv'"><sys-lib>$(WXLIB_ADV_NAME)</sys-lib></if> | |
f814ff33 | 213 | <if cond="value=='qa'"><sys-lib>$(WXLIB_QA_NAME)</sys-lib></if> |
342d6309 | 214 | <if cond="value=='aui'"><sys-lib>$(WXLIB_AUI_NAME)</sys-lib></if> |
3c3ead1d | 215 | <if cond="value=='ribbon'"><sys-lib>$(WXLIB_RIBBON_NAME)</sys-lib></if> |
1c4293cb | 216 | <if cond="value=='propgrid'"><sys-lib>$(WXLIB_PROPGRID_NAME)</sys-lib></if> |
591a46d4 | 217 | <if cond="value=='richtext'"><sys-lib>$(WXLIB_RICHTEXT_NAME)</sys-lib></if> |
0d2a693b | 218 | <if cond="value=='webview'"><sys-lib>$(WXLIB_WEBVIEW_NAME)</sys-lib></if> |
f814ff33 | 219 | |
b8524670 FM |
220 | <!-- The GL lib isn't part of the monolithic build, treat it as a contrib: --> |
221 | <if cond="value=='gl'"> | |
222 | <sys-lib>wx$(WX_PORT)$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)</sys-lib> | |
223 | </if> | |
224 | ||
cf63f3d3 RD |
225 | <if cond="value=='stc'"> |
226 | <!-- wxSTC requires also the basic scintilla library | |
227 | which is built as a separate 3rd party library --> | |
228 | <sys-lib>$(WXLIB_STC_NAME)</sys-lib> | |
229 | <sys-lib>wxscintilla$(WX3RDPARTYLIBPOSTFIX)</sys-lib> | |
230 | </if> | |
231 | ||
18cea871 | 232 | <if cond="value not in WX_LIB_LIST.split()"> |
ad6f7122 | 233 | <error>Unknown wxWidgets library given in the wx-lib tag</error> |
83c7f6a7 VS |
234 | </if> |
235 | </define-tag> | |
236 | ||
237 | <!-- just a placeholder to mark the place where <wx-lib> will be placed, | |
238 | thanks to the order precedence declaration below it: --> | |
239 | <define-tag name="__wx-libs-point" rules="exe,dll,module"/> | |
240 | <tag-info name="wx-lib" | |
241 | position="before:__wx-libs-point"/> | |
bb51876f VS |
242 | <tag-info name="__wx-syslibs" |
243 | position="after:__wx-libs-point"/> | |
6af800ff | 244 | |
83c7f6a7 | 245 | |
c07e76fa VS |
246 | <!-- template for static wx libraries: --> |
247 | <template id="wx-lib"> | |
83c7f6a7 | 248 | <!-- MISCELLANEOUS --> |
6af800ff | 249 | <if cond="FORMAT=='mingw'"> |
83c7f6a7 VS |
250 | <define>HAVE_W32API_H</define> |
251 | <ldflags>-mthreads</ldflags> | |
252 | </if> | |
253 | ||
e602dae8 KO |
254 | <define>$(substituteFromDict(WX_SHARED,{'1':'WXUSINGDLL','0':''}))</define> |
255 | ||
83c7f6a7 | 256 | <define>$(WXUNICODE_DEFINE)</define> |
6af800ff | 257 | <define>$(WXDEBUG_DEFINE)</define> |
83c7f6a7 VS |
258 | <define>__WXMSW__</define> |
259 | ||
001c0021 FM |
260 | <if cond="FORMAT!='xcode2'"> |
261 | <include>$(WX_DIR)$(WXLIBINCLUDE)</include> | |
262 | <include>$(WX_DIR)/include</include> | |
263 | </if> | |
c07e76fa | 264 | </template> |
6af800ff VZ |
265 | |
266 | ||
bb51876f VS |
267 | <!-- this ugly tag contains all sys-lib tags used by "wx" template, |
268 | in order to make sure they are not reorder when wx-lib is moved | |
269 | after __wx-libs-point: --> | |
270 | <define-tag name="__wx-syslibs" rules="exe,dll,module"> | |
83c7f6a7 | 271 | <!-- wx 3rd party libs, always use them: --> |
a20169a4 WS |
272 | <sys-lib cond="FORMAT!='msevc4prj'">wxtiff$(WX3RDPARTYLIBPOSTFIX)</sys-lib> |
273 | <sys-lib>wxjpeg$(WX3RDPARTYLIBPOSTFIX)</sys-lib> | |
274 | <sys-lib>wxpng$(WX3RDPARTYLIBPOSTFIX)</sys-lib> | |
275 | <sys-lib>wxzlib$(WX3RDPARTYLIBPOSTFIX)</sys-lib> | |
276 | <!-- For regex we won't use the WX3RDPARTYLIBPOSTIX postfix: | |
83c7f6a7 VS |
277 | unliked tiff, jpeg, png, zlib, expat, when building |
278 | in Unicode mode, the "u" suffix is appended to regex --> | |
a20169a4 | 279 | <sys-lib cond="FORMAT!='msevc4prj'">wxregex$(WXLIBPOSTFIX)</sys-lib> |
c7ca49e4 | 280 | <sys-lib>wxexpat$(WX3RDPARTYLIBPOSTFIX)</sys-lib> |
6af800ff | 281 | |
83c7f6a7 VS |
282 | <!-- link-in system libs that wx depends on: --> |
283 | <!-- If on borland, we don't need to do much --> | |
284 | <if cond="FORMAT=='borland'"> | |
285 | <sys-lib>ole2w32</sys-lib> | |
286 | </if> | |
287 | ||
288 | <!-- Non-borland, on the other hand... --> | |
965122c4 | 289 | <if cond="FORMAT not in ['borland','msevc4prj']"> |
83c7f6a7 VS |
290 | <sys-lib>kernel32</sys-lib> |
291 | <sys-lib>user32</sys-lib> | |
292 | <sys-lib>gdi32</sys-lib> | |
293 | <sys-lib>comdlg32</sys-lib> | |
294 | <sys-lib>winspool</sys-lib> | |
295 | <sys-lib>winmm</sys-lib> | |
296 | <sys-lib>shell32</sys-lib> | |
297 | <sys-lib>comctl32</sys-lib> | |
298 | <sys-lib>ole32</sys-lib> | |
299 | <sys-lib>oleaut32</sys-lib> | |
300 | <sys-lib>uuid</sys-lib> | |
301 | <sys-lib>rpcrt4</sys-lib> | |
302 | <sys-lib>advapi32</sys-lib> | |
303 | <sys-lib>wsock32</sys-lib> | |
83c7f6a7 VS |
304 | </if> |
305 | ||
306 | <!-- Libs common to both borland and MSVC --> | |
307 | <if cond="FORMAT=='msvc' or FORMAT=='msvc6prj' or FORMAT=='borland'"> | |
308 | <sys-lib>oleacc</sys-lib> | |
309 | </if> | |
bb51876f | 310 | </define-tag> |
6af800ff | 311 | |
bb51876f VS |
312 | <!-- template for wx executables/dlls: --> |
313 | <template id="wx" template="wx-lib"> | |
001c0021 FM |
314 | <if cond="FORMAT!='xcode2'"> |
315 | <lib-path>$(WX_DIR)$(WXLIBPATH)</lib-path> | |
316 | </if> | |
bb51876f | 317 | |
617bcbe2 FM |
318 | <ldflags>$(WXMACHINE_FLAG)</ldflags> |
319 | ||
bb51876f VS |
320 | <!-- wx libs must come before 3rd party and sys libs, this is |
321 | the place where the hack explained above is carried on: --> | |
322 | <__wx-libs-point/> | |
323 | <__wx-syslibs/> | |
83c7f6a7 VS |
324 | </template> |
325 | ||
a78a8f7f | 326 | <if cond="FORMAT_SUPPORTS_ACTIONS=='1' and WX_TEST_FOR_SELECTED_WXBUILD=='1'"> |
e602dae8 KO |
327 | |
328 | <!-- | |
329 | VERY IMPORTANT: before starting to build all targets of the generated makefile, | |
330 | we need to check if the selected wxWidgets build exists; we do | |
331 | that simply creating the following target; if it fails the make | |
332 | program will halt printing the following nice error message... | |
333 | (much better than the 'could not find wx/*.h file') | |
334 | --> | |
335 | <action id="test_for_selected_wxbuild"> | |
336 | <dependency-of>all</dependency-of> | |
337 | ||
338 | <!-- the @ is to hide these actions from the user --> | |
339 | <command> | |
340 | @if not exist $(WX_DIR)$(WXLIBINCLUDE)$(DIRSEP)wx$(DIRSEP)setup.h \ | |
341 | echo ---------------------------------------------------------------------------- | |
342 | @if not exist $(WX_DIR)$(WXLIBINCLUDE)$(DIRSEP)wx$(DIRSEP)setup.h \ | |
c4106e3b | 343 | echo The selected wxWidgets build is not available! |
e602dae8 KO |
344 | @if not exist $(WX_DIR)$(WXLIBINCLUDE)$(DIRSEP)wx$(DIRSEP)setup.h \ |
345 | echo Please use the options prefixed with WX_ to select another wxWidgets build. | |
346 | @if not exist $(WX_DIR)$(WXLIBINCLUDE)$(DIRSEP)wx$(DIRSEP)setup.h \ | |
347 | echo ---------------------------------------------------------------------------- | |
348 | @if not exist $(WX_DIR)$(WXLIBINCLUDE)$(DIRSEP)wx$(DIRSEP)setup.h \ | |
349 | exit 1 | |
350 | </command> | |
351 | </action> | |
352 | </if> | |
353 | ||
83c7f6a7 | 354 | </makefile> |