]>
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 | ||
13 | <!-- | |
14 | ||
15 | FIXME: this template has (at least) the following bugs: | |
16 | ||
17 | * it's MSW-only, the port is assumed to be wxMSW unconditionally | |
18 | ||
19 | * multiple wx configurations (CFG variable set when building the | |
20 | library) are not supported | |
21 | ||
22 | --> | |
23 | ||
24 | <!-- makefile tag signifies the beginning of the bakefile --> | |
25 | <makefile> | |
26 | ||
27 | <requires version="0.1.5"/> | |
28 | ||
29 | <!-- OPTIONS --> | |
30 | <!-- --> | |
31 | <!-- These are essentially the configurations you --> | |
32 | <!-- want in bakefile. --> | |
33 | <!-- --> | |
34 | <!-- In MSVC these are the different build --> | |
35 | <!-- configurations you can have (in the build menu), --> | |
36 | <!-- and in autoconf is enabled with enable-xxx=xx. --> | |
3103e8a9 | 37 | <!-- For other compilers a separate configuration --> |
83c7f6a7 VS |
38 | <!-- file is created (such as config.gcc on gcc) --> |
39 | <!-- which has several options a user can modify. --> | |
40 | <!-- --> | |
41 | <!-- Note that the above only happens if an option --> | |
42 | <!-- is not constant, i.e. if it cannot be determined --> | |
43 | <!-- by bakefile itself. --> | |
44 | ||
438eb650 WS |
45 | <!-- this is a temporary variable until there is non general --> |
46 | <!-- function in bakefiles for returning native markup for --> | |
47 | <!-- reading envrionment variables --> | |
48 | <set var="ENV_VAR"> | |
49 | <if cond="FORMAT=='watcom'">%</if> | |
50 | <if cond="FORMAT!='watcom'"></if> | |
51 | </set> | |
6af800ff VZ |
52 | |
53 | ||
83c7f6a7 | 54 | <!-- The directory where wxWidgets is installed: --> |
1ed52f8c VS |
55 | <if cond="not isdefined('WX_DIR')"> |
56 | <set var="WX_DIR_DEFAULT" overwrite="0">$(DOLLAR)($(ENV_VAR)WXWIN)</set> | |
57 | <option name="WX_DIR" category="path"> | |
58 | <default-value>$(WX_DIR_DEFAULT)</default-value> | |
59 | <description> | |
60 | The directory where wxWidgets library is installed | |
61 | </description> | |
62 | </option> | |
63 | </if> | |
83c7f6a7 VS |
64 | |
65 | <!-- This is a standard option that determines --> | |
66 | <!-- whether the user wants to build this library as --> | |
67 | <!-- a dll or as a static library. --> | |
1ed52f8c VS |
68 | <if cond="not isdefined('WX_SHARED')"> |
69 | <set var="WX_SHARED_DEFAULT" overwrite="0">0</set> | |
70 | <option name="WX_SHARED"> | |
71 | <values>0,1</values> | |
72 | <values-description>,DLL</values-description> | |
73 | <default-value>$(WX_SHARED_DEFAULT)</default-value> | |
74 | <description> | |
75 | Use DLL build of wx library to use? | |
76 | </description> | |
77 | </option> | |
78 | </if> | |
83c7f6a7 VS |
79 | |
80 | <!-- Configuration for building the bakefile with --> | |
81 | <!-- unicode strings or not (unicode or ansi). --> | |
1ed52f8c VS |
82 | <if cond="not isdefined('WX_UNICODE')"> |
83 | <set var="WX_UNICODE_DEFAULT" overwrite="0">0</set> | |
84 | <option name="WX_UNICODE"> | |
85 | <values>0,1</values> | |
86 | <values-description>,Unicode</values-description> | |
6af800ff | 87 | <default-value>$(WX_UNICODE_DEFAULT)</default-value> |
1ed52f8c VS |
88 | <description> |
89 | Compile Unicode build of wxWidgets? | |
90 | </description> | |
91 | </option> | |
92 | </if> | |
93 | ||
e943ebd8 | 94 | <if cond="not isdefined('WX_DEBUG')"> |
1ed52f8c | 95 | <set var="WX_DEBUG_DEFAULT" overwrite="0">1</set> |
e943ebd8 VS |
96 | <option name="WX_DEBUG"> |
97 | <values>0,1</values> | |
1ed52f8c VS |
98 | <values-description>Release,Debug</values-description> |
99 | <default-value>$(WX_DEBUG_DEFAULT)</default-value> | |
100 | <description> | |
101 | Use debug build of wxWidgets (define __WXDEBUG__)? | |
102 | </description> | |
103 | </option> | |
104 | </if> | |
105 | ||
106 | <if cond="not isdefined('WX_VERSION')"> | |
01cca03e | 107 | <set var="WX_VERSION_DEFAULT" overwrite="0">27</set> |
1ed52f8c VS |
108 | <option name="WX_VERSION"> |
109 | <default-value>$(WX_VERSION_DEFAULT)</default-value> | |
110 | <description> | |
111 | Version of the wx library to build against. | |
112 | </description> | |
113 | </option> | |
114 | </if> | |
83c7f6a7 VS |
115 | |
116 | <!-- HELPER VARIABLES --> | |
117 | <!-- --> | |
6af800ff VZ |
118 | |
119 | ||
83c7f6a7 VS |
120 | <!-- The unicode define we want. By default bakefile --> |
121 | <!-- makes variables an empty string, so if unicode --> | |
122 | <!-- is not defined $(UNICODE_DEFINE) would expand --> | |
123 | <!-- to nothing (literally). --> | |
124 | <set var="WXUNICODE_DEFINE"> | |
125 | <if cond="WX_UNICODE=='1'">_UNICODE</if> | |
6af800ff VZ |
126 | </set> |
127 | ||
128 | <!-- The debug define we need with win32 compilers --> | |
129 | <!-- (on Linux, the wx-config program is used). --> | |
130 | <set var="WXDEBUG_DEFINE"> | |
131 | <if cond="WX_DEBUG=='1'">__WXDEBUG__</if> | |
83c7f6a7 VS |
132 | </set> |
133 | ||
134 | <!-- These are handy ways of dealing with the --> | |
6af800ff | 135 | <!-- extensions in the library names of the --> |
83c7f6a7 VS |
136 | <!-- wxWindows library. --> |
137 | <set var="WXLIBPOSTFIX"> | |
e943ebd8 VS |
138 | <if cond="WX_DEBUG=='1' and WX_UNICODE=='1'">ud</if> |
139 | <if cond="WX_DEBUG=='1' and WX_UNICODE=='0'">d</if> | |
140 | <if cond="WX_DEBUG=='0' and WX_UNICODE=='1'">u</if> | |
83c7f6a7 | 141 | </set> |
c7ca49e4 | 142 | <set var="WX3RDPARTYLIBPOSTFIX"> |
e943ebd8 | 143 | <if cond="WX_DEBUG=='1'">d</if> |
965122c4 VS |
144 | </set> |
145 | ||
146 | <set var="WXCPU"> | |
147 | <if cond="FORMAT=='msevc4prj'">_$(CPU)</if> | |
83c7f6a7 VS |
148 | </set> |
149 | ||
150 | <set var="WXLIBPATH"> | |
965122c4 VS |
151 | <if cond="WX_SHARED=='0'">$(DIRSEP)lib$(DIRSEP)$(COMPILER)$(WXCPU)_lib</if> |
152 | <if cond="WX_SHARED=='1'">$(DIRSEP)lib$(DIRSEP)$(COMPILER)$(WXCPU)_dll</if> | |
83c7f6a7 VS |
153 | </set> |
154 | ||
6af800ff VZ |
155 | <set var="WXPORT"> |
156 | <if cond="FORMAT=='msevc4prj'">wince</if> | |
157 | <if cond="FORMAT!='msevc4prj'">msw</if> | |
158 | </set> | |
159 | <set var="WXLIBINCLUDE">$(WXLIBPATH)$(DIRSEP)$(WXPORT)$(WXLIBPOSTFIX)</set> | |
160 | ||
161 | ||
83c7f6a7 VS |
162 | <!-- WX TEMPLATE --> |
163 | <!-- --> | |
164 | <!-- --> | |
165 | <!-- While not required, templates make your --> | |
166 | <!-- bakefiles much more readable. Templates, in --> | |
167 | <!-- essence, are abstract classes like c++. --> | |
168 | <!-- --> | |
169 | <!-- Your build targets "inherit" the template, --> | |
170 | <!-- along with the info associated with the template --> | |
171 | ||
172 | <!-- --> | |
173 | <!-- wxWidgets LIBRARY/APP TEMPLATE --> | |
174 | <!-- --> | |
175 | <!-- The "base class" of all our build targets --> | |
176 | <!-- This links with the appropriate native --> | |
3103e8a9 | 177 | <!-- libraries required by the platform, the libraries --> |
83c7f6a7 VS |
178 | <!-- we want for our stuff, and the wxWindows libs. --> |
179 | ||
180 | ||
6af800ff | 181 | |
83c7f6a7 VS |
182 | <!-- this tag is used to include wx libraries: --> |
183 | <define-tag name="wx-lib" rules="exe,dll,module"> | |
184 | <if cond="value=='base'"> | |
185 | <sys-lib>wxbase$(WX_VERSION)$(WXLIBPOSTFIX)</sys-lib> | |
186 | </if> | |
21dc40ed | 187 | <if cond="value in ['net','xml', 'odbc']"> |
83c7f6a7 VS |
188 | <sys-lib>wxbase$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)</sys-lib> |
189 | </if> | |
61a15bac | 190 | <if cond="value not in ['base','net', 'odbc', 'xml']"> |
6af800ff | 191 | <sys-lib>wx$(WXPORT)$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)</sys-lib> |
83c7f6a7 VS |
192 | </if> |
193 | </define-tag> | |
194 | ||
195 | <!-- just a placeholder to mark the place where <wx-lib> will be placed, | |
196 | thanks to the order precedence declaration below it: --> | |
197 | <define-tag name="__wx-libs-point" rules="exe,dll,module"/> | |
198 | <tag-info name="wx-lib" | |
199 | position="before:__wx-libs-point"/> | |
bb51876f VS |
200 | <tag-info name="__wx-syslibs" |
201 | position="after:__wx-libs-point"/> | |
6af800ff | 202 | |
83c7f6a7 | 203 | |
c07e76fa VS |
204 | <!-- template for static wx libraries: --> |
205 | <template id="wx-lib"> | |
83c7f6a7 | 206 | <!-- MISCELLANEOUS --> |
6af800ff | 207 | <if cond="FORMAT=='mingw'"> |
83c7f6a7 VS |
208 | <define>HAVE_W32API_H</define> |
209 | <ldflags>-mthreads</ldflags> | |
210 | </if> | |
211 | ||
212 | <define>$(WXUNICODE_DEFINE)</define> | |
6af800ff | 213 | <define>$(WXDEBUG_DEFINE)</define> |
83c7f6a7 VS |
214 | <define>__WXMSW__</define> |
215 | ||
216 | <include>$(WX_DIR)$(WXLIBINCLUDE)</include> | |
217 | <include>$(WX_DIR)/include</include> | |
c07e76fa | 218 | </template> |
6af800ff VZ |
219 | |
220 | ||
bb51876f VS |
221 | <!-- this ugly tag contains all sys-lib tags used by "wx" template, |
222 | in order to make sure they are not reorder when wx-lib is moved | |
223 | after __wx-libs-point: --> | |
224 | <define-tag name="__wx-syslibs" rules="exe,dll,module"> | |
83c7f6a7 | 225 | <!-- wx 3rd party libs, always use them: --> |
ee196d64 VS |
226 | <sys-lib cond="FORMAT!='msevc4prj'">wxtiff$(WX3RDPARTYLIBPOSTFIX)</sys-lib> |
227 | <sys-lib>wxjpeg$(WX3RDPARTYLIBPOSTFIX)</sys-lib> | |
228 | <sys-lib>wxpng$(WX3RDPARTYLIBPOSTFIX)</sys-lib> | |
229 | <sys-lib>wxzlib$(WX3RDPARTYLIBPOSTFIX)</sys-lib> | |
230 | <!-- For regex we won't use the WX3RDPARTYLIBPOSTIX postfix: | |
83c7f6a7 VS |
231 | unliked tiff, jpeg, png, zlib, expat, when building |
232 | in Unicode mode, the "u" suffix is appended to regex --> | |
ee196d64 | 233 | <sys-lib cond="FORMAT!='msevc4prj'">wxregex$(WXLIBPOSTFIX)</sys-lib> |
c7ca49e4 | 234 | <sys-lib>wxexpat$(WX3RDPARTYLIBPOSTFIX)</sys-lib> |
6af800ff | 235 | |
83c7f6a7 VS |
236 | <!-- link-in system libs that wx depends on: --> |
237 | <!-- If on borland, we don't need to do much --> | |
238 | <if cond="FORMAT=='borland'"> | |
239 | <sys-lib>ole2w32</sys-lib> | |
240 | </if> | |
241 | ||
242 | <!-- Non-borland, on the other hand... --> | |
965122c4 | 243 | <if cond="FORMAT not in ['borland','msevc4prj']"> |
83c7f6a7 VS |
244 | <sys-lib>kernel32</sys-lib> |
245 | <sys-lib>user32</sys-lib> | |
246 | <sys-lib>gdi32</sys-lib> | |
247 | <sys-lib>comdlg32</sys-lib> | |
248 | <sys-lib>winspool</sys-lib> | |
249 | <sys-lib>winmm</sys-lib> | |
250 | <sys-lib>shell32</sys-lib> | |
251 | <sys-lib>comctl32</sys-lib> | |
252 | <sys-lib>ole32</sys-lib> | |
253 | <sys-lib>oleaut32</sys-lib> | |
254 | <sys-lib>uuid</sys-lib> | |
255 | <sys-lib>rpcrt4</sys-lib> | |
256 | <sys-lib>advapi32</sys-lib> | |
257 | <sys-lib>wsock32</sys-lib> | |
258 | <sys-lib>odbc32</sys-lib> | |
259 | </if> | |
260 | ||
261 | <!-- Libs common to both borland and MSVC --> | |
262 | <if cond="FORMAT=='msvc' or FORMAT=='msvc6prj' or FORMAT=='borland'"> | |
263 | <sys-lib>oleacc</sys-lib> | |
264 | </if> | |
bb51876f | 265 | </define-tag> |
6af800ff | 266 | |
bb51876f VS |
267 | <!-- template for wx executables/dlls: --> |
268 | <template id="wx" template="wx-lib"> | |
269 | <lib-path>$(WX_DIR)$(WXLIBPATH)</lib-path> | |
270 | ||
271 | <!-- wx libs must come before 3rd party and sys libs, this is | |
272 | the place where the hack explained above is carried on: --> | |
273 | <__wx-libs-point/> | |
274 | <__wx-syslibs/> | |
83c7f6a7 VS |
275 | </template> |
276 | ||
277 | </makefile> |