]>
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 VS |
15 | |
16 | <!-- OPTIONS --> | |
17 | <!-- --> | |
18 | <!-- These are essentially the configurations you --> | |
19 | <!-- want in bakefile. --> | |
20 | <!-- --> | |
21 | <!-- In MSVC these are the different build --> | |
22 | <!-- configurations you can have (in the build menu), --> | |
23 | <!-- and in autoconf is enabled with enable-xxx=xx. --> | |
3103e8a9 | 24 | <!-- For other compilers a separate configuration --> |
83c7f6a7 VS |
25 | <!-- file is created (such as config.gcc on gcc) --> |
26 | <!-- which has several options a user can modify. --> | |
27 | <!-- --> | |
28 | <!-- Note that the above only happens if an option --> | |
29 | <!-- is not constant, i.e. if it cannot be determined --> | |
30 | <!-- by bakefile itself. --> | |
e602dae8 KO |
31 | <!-- Also note that for 'autoconf' format these options --> |
32 | <!-- are only useful when used together with wxpresets.m4 --> | |
33 | <!-- macro file which contains macros for detecting the --> | |
34 | <!-- option values for wx-based projects. See wxpresets.m4 --> | |
35 | <!-- comments for more info. --> | |
83c7f6a7 | 36 | |
ad6f7122 VZ |
37 | |
38 | ||
83c7f6a7 VS |
39 | <!-- HELPER VARIABLES --> |
40 | <!-- --> | |
6af800ff VZ |
41 | |
42 | ||
83c7f6a7 VS |
43 | <!-- The unicode define we want. By default bakefile --> |
44 | <!-- makes variables an empty string, so if unicode --> | |
45 | <!-- is not defined $(UNICODE_DEFINE) would expand --> | |
46 | <!-- to nothing (literally). --> | |
47 | <set var="WXUNICODE_DEFINE"> | |
48 | <if cond="WX_UNICODE=='1'">_UNICODE</if> | |
6af800ff VZ |
49 | </set> |
50 | ||
51 | <!-- The debug define we need with win32 compilers --> | |
52 | <!-- (on Linux, the wx-config program is used). --> | |
53 | <set var="WXDEBUG_DEFINE"> | |
54 | <if cond="WX_DEBUG=='1'">__WXDEBUG__</if> | |
83c7f6a7 VS |
55 | </set> |
56 | ||
57 | <!-- These are handy ways of dealing with the --> | |
6af800ff | 58 | <!-- extensions in the library names of the --> |
83c7f6a7 | 59 | <!-- wxWindows library. --> |
c7ca49e4 | 60 | <set var="WX3RDPARTYLIBPOSTFIX"> |
e943ebd8 | 61 | <if cond="WX_DEBUG=='1'">d</if> |
965122c4 VS |
62 | </set> |
63 | ||
64 | <set var="WXCPU"> | |
65 | <if cond="FORMAT=='msevc4prj'">_$(CPU)</if> | |
83c7f6a7 VS |
66 | </set> |
67 | ||
68 | <set var="WXLIBPATH"> | |
965122c4 VS |
69 | <if cond="WX_SHARED=='0'">$(DIRSEP)lib$(DIRSEP)$(COMPILER)$(WXCPU)_lib</if> |
70 | <if cond="WX_SHARED=='1'">$(DIRSEP)lib$(DIRSEP)$(COMPILER)$(WXCPU)_dll</if> | |
83c7f6a7 VS |
71 | </set> |
72 | ||
e602dae8 KO |
73 | <!-- under Unix this is an option (detected at configure-time); |
74 | under Windows this is not an user option! --> | |
75 | <set var="WX_PORT"> | |
6af800ff VZ |
76 | <if cond="FORMAT=='msevc4prj'">wince</if> |
77 | <if cond="FORMAT!='msevc4prj'">msw</if> | |
78 | </set> | |
e602dae8 KO |
79 | |
80 | <set var="WXLIBINCLUDE">$(WXLIBPATH)$(DIRSEP)$(WX_PORT)$(WXLIBPOSTFIX)</set> | |
6af800ff VZ |
81 | |
82 | ||
ad6f7122 VZ |
83 | <!-- All the possible mixes for the wx library names --> |
84 | <set var="WXLIB_BASE_NAME"> | |
e0b7c2b7 | 85 | <if cond="WX_MONOLITHIC=='0'">wxbase$(WX_VERSION)$(WXLIBPOSTFIX)</if> |
ad6f7122 VZ |
86 | |
87 | <!-- | |
88 | the trick used to support monolithic builds is here: when the | |
89 | <wx-lib>base</wx-lib> tag is found, and user selected | |
90 | WX_MONOLITHIC=1, then the base library is translated to the | |
91 | monolithic library | |
92 | --> | |
e0b7c2b7 | 93 | <if cond="WX_MONOLITHIC=='1'">wx$(WX_PORT)$(WX_VERSION)$(WXLIBPOSTFIX)</if> |
ad6f7122 VZ |
94 | </set> |
95 | ||
e602dae8 | 96 | |
ad6f7122 | 97 | <!-- Libraries whose name is prefixed with 'wxbase' --> |
e602dae8 KO |
98 | <define-global-tag name="define-wxbase-lib-name"> |
99 | <set var="WXLIB_$(value.upper())_NAME"> | |
e0b7c2b7 FM |
100 | <if cond="WX_MONOLITHIC=='0'"> |
101 | wxbase$(WX_VERSION)$(WXLIBPOSTFIX)_$(value) | |
e602dae8 | 102 | </if> |
ad6f7122 | 103 | </set> |
e602dae8 | 104 | </define-global-tag> |
ad6f7122 | 105 | |
e602dae8 KO |
106 | <define-wxbase-lib-name>net</define-wxbase-lib-name> |
107 | <define-wxbase-lib-name>xml</define-wxbase-lib-name> | |
ad6f7122 VZ |
108 | |
109 | ||
e602dae8 KO |
110 | <!-- Libraries whose name is prefixed with 'wx' only --> |
111 | <define-global-tag name="define-wxlib-name"> | |
112 | <set var="WXLIB_$(value.upper())_NAME"> | |
e0b7c2b7 FM |
113 | <if cond="WX_MONOLITHIC=='0'"> |
114 | wx$(WX_PORT)$(WX_VERSION)$(WXLIBPOSTFIX)_$(value) | |
e602dae8 KO |
115 | </if> |
116 | </set> | |
117 | </define-global-tag> | |
118 | ||
119 | <define-wxlib-name>core</define-wxlib-name> | |
120 | <define-wxlib-name>media</define-wxlib-name> | |
121 | <define-wxlib-name>xrc</define-wxlib-name> | |
122 | <define-wxlib-name>html</define-wxlib-name> | |
123 | <define-wxlib-name>adv</define-wxlib-name> | |
124 | <define-wxlib-name>qa</define-wxlib-name> | |
e602dae8 | 125 | <define-wxlib-name>aui</define-wxlib-name> |
54429bb3 | 126 | <define-wxlib-name>stc</define-wxlib-name> |
e602dae8 KO |
127 | <define-wxlib-name>richtext</define-wxlib-name> |
128 | ||
b8524670 | 129 | <!-- NOTE: The GL lib is not part of the monolithic build; treat it as a contrib! --> |
ad6f7122 VZ |
130 | |
131 | ||
132 | ||
83c7f6a7 VS |
133 | <!-- WX TEMPLATE --> |
134 | <!-- --> | |
135 | <!-- --> | |
136 | <!-- While not required, templates make your --> | |
137 | <!-- bakefiles much more readable. Templates, in --> | |
138 | <!-- essence, are abstract classes like c++. --> | |
139 | <!-- --> | |
140 | <!-- Your build targets "inherit" the template, --> | |
141 | <!-- along with the info associated with the template --> | |
142 | ||
143 | <!-- --> | |
144 | <!-- wxWidgets LIBRARY/APP TEMPLATE --> | |
145 | <!-- --> | |
146 | <!-- The "base class" of all our build targets --> | |
147 | <!-- This links with the appropriate native --> | |
3103e8a9 | 148 | <!-- libraries required by the platform, the libraries --> |
83c7f6a7 VS |
149 | <!-- we want for our stuff, and the wxWindows libs. --> |
150 | ||
83c7f6a7 VS |
151 | <!-- this tag is used to include wx libraries: --> |
152 | <define-tag name="wx-lib" rules="exe,dll,module"> | |
ad6f7122 VZ |
153 | <if cond="value=='base'"><sys-lib>$(WXLIB_BASE_NAME)</sys-lib></if> |
154 | <if cond="value=='core'"><sys-lib>$(WXLIB_CORE_NAME)</sys-lib></if> | |
155 | ||
156 | <if cond="value=='net'"><sys-lib>$(WXLIB_NET_NAME)</sys-lib></if> | |
157 | <if cond="value=='xml'"><sys-lib>$(WXLIB_XML_NAME)</sys-lib></if> | |
ad6f7122 | 158 | |
f814ff33 | 159 | <if cond="value=='media'"><sys-lib>$(WXLIB_MEDIA_NAME)</sys-lib></if> |
ad6f7122 VZ |
160 | <if cond="value=='xrc'"><sys-lib>$(WXLIB_XRC_NAME)</sys-lib></if> |
161 | <if cond="value=='html'"><sys-lib>$(WXLIB_HTML_NAME)</sys-lib></if> | |
162 | <if cond="value=='adv'"><sys-lib>$(WXLIB_ADV_NAME)</sys-lib></if> | |
f814ff33 | 163 | <if cond="value=='qa'"><sys-lib>$(WXLIB_QA_NAME)</sys-lib></if> |
342d6309 | 164 | <if cond="value=='aui'"><sys-lib>$(WXLIB_AUI_NAME)</sys-lib></if> |
591a46d4 | 165 | <if cond="value=='richtext'"><sys-lib>$(WXLIB_RICHTEXT_NAME)</sys-lib></if> |
f814ff33 | 166 | |
b8524670 FM |
167 | <!-- The GL lib isn't part of the monolithic build, treat it as a contrib: --> |
168 | <if cond="value=='gl'"> | |
169 | <sys-lib>wx$(WX_PORT)$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)</sys-lib> | |
170 | </if> | |
171 | ||
cf63f3d3 RD |
172 | <if cond="value=='stc'"> |
173 | <!-- wxSTC requires also the basic scintilla library | |
174 | which is built as a separate 3rd party library --> | |
175 | <sys-lib>$(WXLIB_STC_NAME)</sys-lib> | |
176 | <sys-lib>wxscintilla$(WX3RDPARTYLIBPOSTFIX)</sys-lib> | |
177 | </if> | |
178 | ||
18cea871 | 179 | <if cond="value not in WX_LIB_LIST.split()"> |
ad6f7122 | 180 | <error>Unknown wxWidgets library given in the wx-lib tag</error> |
83c7f6a7 VS |
181 | </if> |
182 | </define-tag> | |
183 | ||
184 | <!-- just a placeholder to mark the place where <wx-lib> will be placed, | |
185 | thanks to the order precedence declaration below it: --> | |
186 | <define-tag name="__wx-libs-point" rules="exe,dll,module"/> | |
187 | <tag-info name="wx-lib" | |
188 | position="before:__wx-libs-point"/> | |
bb51876f VS |
189 | <tag-info name="__wx-syslibs" |
190 | position="after:__wx-libs-point"/> | |
6af800ff | 191 | |
83c7f6a7 | 192 | |
c07e76fa VS |
193 | <!-- template for static wx libraries: --> |
194 | <template id="wx-lib"> | |
83c7f6a7 | 195 | <!-- MISCELLANEOUS --> |
6af800ff | 196 | <if cond="FORMAT=='mingw'"> |
83c7f6a7 VS |
197 | <define>HAVE_W32API_H</define> |
198 | <ldflags>-mthreads</ldflags> | |
199 | </if> | |
200 | ||
e602dae8 KO |
201 | <define>$(substituteFromDict(WX_SHARED,{'1':'WXUSINGDLL','0':''}))</define> |
202 | ||
83c7f6a7 | 203 | <define>$(WXUNICODE_DEFINE)</define> |
6af800ff | 204 | <define>$(WXDEBUG_DEFINE)</define> |
83c7f6a7 VS |
205 | <define>__WXMSW__</define> |
206 | ||
001c0021 FM |
207 | <if cond="FORMAT!='xcode2'"> |
208 | <include>$(WX_DIR)$(WXLIBINCLUDE)</include> | |
209 | <include>$(WX_DIR)/include</include> | |
210 | </if> | |
c07e76fa | 211 | </template> |
6af800ff VZ |
212 | |
213 | ||
bb51876f VS |
214 | <!-- this ugly tag contains all sys-lib tags used by "wx" template, |
215 | in order to make sure they are not reorder when wx-lib is moved | |
216 | after __wx-libs-point: --> | |
217 | <define-tag name="__wx-syslibs" rules="exe,dll,module"> | |
83c7f6a7 | 218 | <!-- wx 3rd party libs, always use them: --> |
a20169a4 WS |
219 | <sys-lib cond="FORMAT!='msevc4prj'">wxtiff$(WX3RDPARTYLIBPOSTFIX)</sys-lib> |
220 | <sys-lib>wxjpeg$(WX3RDPARTYLIBPOSTFIX)</sys-lib> | |
221 | <sys-lib>wxpng$(WX3RDPARTYLIBPOSTFIX)</sys-lib> | |
222 | <sys-lib>wxzlib$(WX3RDPARTYLIBPOSTFIX)</sys-lib> | |
223 | <!-- For regex we won't use the WX3RDPARTYLIBPOSTIX postfix: | |
83c7f6a7 VS |
224 | unliked tiff, jpeg, png, zlib, expat, when building |
225 | in Unicode mode, the "u" suffix is appended to regex --> | |
a20169a4 | 226 | <sys-lib cond="FORMAT!='msevc4prj'">wxregex$(WXLIBPOSTFIX)</sys-lib> |
c7ca49e4 | 227 | <sys-lib>wxexpat$(WX3RDPARTYLIBPOSTFIX)</sys-lib> |
6af800ff | 228 | |
83c7f6a7 VS |
229 | <!-- link-in system libs that wx depends on: --> |
230 | <!-- If on borland, we don't need to do much --> | |
231 | <if cond="FORMAT=='borland'"> | |
232 | <sys-lib>ole2w32</sys-lib> | |
233 | </if> | |
234 | ||
235 | <!-- Non-borland, on the other hand... --> | |
965122c4 | 236 | <if cond="FORMAT not in ['borland','msevc4prj']"> |
83c7f6a7 VS |
237 | <sys-lib>kernel32</sys-lib> |
238 | <sys-lib>user32</sys-lib> | |
239 | <sys-lib>gdi32</sys-lib> | |
240 | <sys-lib>comdlg32</sys-lib> | |
241 | <sys-lib>winspool</sys-lib> | |
242 | <sys-lib>winmm</sys-lib> | |
243 | <sys-lib>shell32</sys-lib> | |
244 | <sys-lib>comctl32</sys-lib> | |
245 | <sys-lib>ole32</sys-lib> | |
246 | <sys-lib>oleaut32</sys-lib> | |
247 | <sys-lib>uuid</sys-lib> | |
248 | <sys-lib>rpcrt4</sys-lib> | |
249 | <sys-lib>advapi32</sys-lib> | |
250 | <sys-lib>wsock32</sys-lib> | |
83c7f6a7 VS |
251 | </if> |
252 | ||
253 | <!-- Libs common to both borland and MSVC --> | |
254 | <if cond="FORMAT=='msvc' or FORMAT=='msvc6prj' or FORMAT=='borland'"> | |
255 | <sys-lib>oleacc</sys-lib> | |
256 | </if> | |
bb51876f | 257 | </define-tag> |
6af800ff | 258 | |
bb51876f VS |
259 | <!-- template for wx executables/dlls: --> |
260 | <template id="wx" template="wx-lib"> | |
001c0021 FM |
261 | <if cond="FORMAT!='xcode2'"> |
262 | <lib-path>$(WX_DIR)$(WXLIBPATH)</lib-path> | |
263 | </if> | |
bb51876f VS |
264 | |
265 | <!-- wx libs must come before 3rd party and sys libs, this is | |
266 | the place where the hack explained above is carried on: --> | |
267 | <__wx-libs-point/> | |
268 | <__wx-syslibs/> | |
83c7f6a7 VS |
269 | </template> |
270 | ||
a78a8f7f | 271 | <if cond="FORMAT_SUPPORTS_ACTIONS=='1' and WX_TEST_FOR_SELECTED_WXBUILD=='1'"> |
e602dae8 KO |
272 | |
273 | <!-- | |
274 | VERY IMPORTANT: before starting to build all targets of the generated makefile, | |
275 | we need to check if the selected wxWidgets build exists; we do | |
276 | that simply creating the following target; if it fails the make | |
277 | program will halt printing the following nice error message... | |
278 | (much better than the 'could not find wx/*.h file') | |
279 | --> | |
280 | <action id="test_for_selected_wxbuild"> | |
281 | <dependency-of>all</dependency-of> | |
282 | ||
283 | <!-- the @ is to hide these actions from the user --> | |
284 | <command> | |
285 | @if not exist $(WX_DIR)$(WXLIBINCLUDE)$(DIRSEP)wx$(DIRSEP)setup.h \ | |
286 | echo ---------------------------------------------------------------------------- | |
287 | @if not exist $(WX_DIR)$(WXLIBINCLUDE)$(DIRSEP)wx$(DIRSEP)setup.h \ | |
c4106e3b | 288 | echo The selected wxWidgets build is not available! |
e602dae8 KO |
289 | @if not exist $(WX_DIR)$(WXLIBINCLUDE)$(DIRSEP)wx$(DIRSEP)setup.h \ |
290 | echo Please use the options prefixed with WX_ to select another wxWidgets build. | |
291 | @if not exist $(WX_DIR)$(WXLIBINCLUDE)$(DIRSEP)wx$(DIRSEP)setup.h \ | |
292 | echo ---------------------------------------------------------------------------- | |
293 | @if not exist $(WX_DIR)$(WXLIBINCLUDE)$(DIRSEP)wx$(DIRSEP)setup.h \ | |
294 | exit 1 | |
295 | </command> | |
296 | </action> | |
297 | </if> | |
298 | ||
83c7f6a7 | 299 | </makefile> |