VirtualBox

source: vbox/trunk/src/libs/libxml2-2.12.6/win32/Makefile.msvc@ 104106

Last change on this file since 104106 was 104106, checked in by vboxsync, 10 months ago

libxml2-2.9.14: Applied and adjusted our libxml2 changes to 2.9.14. bugref:10640

File size: 12.6 KB
Line 
1# Makefile for libxml2, specific for Windows, MSVC and NMAKE.
2#
3# Take a look at the beginning and modify the variables to suit your
4# environment. Having done that, you can do a
5#
6# nmake [all] to build the libxml and the accompanying utilities.
7# nmake clean to remove all compiler output files and return to a
8# clean state.
9# nmake rebuild to rebuild everything from scratch. This basically does
10# a 'nmake clean' and then a 'nmake all'.
11# nmake install to install the library and its header files.
12#
13# March 2002, Igor Zlatkovic <[email protected]>
14
15# There should never be a need to modify anything below this line.
16# ----------------------------------------------------------------
17
18AUTOCONF = .\config.msvc
19!include $(AUTOCONF)
20
21# Names of various input and output components.
22XML_NAME = xml2
23XML_BASENAME = lib$(XML_NAME)
24XML_SO = $(XML_BASENAME).dll
25XML_RES = $(XML_BASENAME).res
26XML_IMP = $(XML_BASENAME).lib
27XML_A = $(XML_BASENAME)_a.lib
28XML_A_DLL = $(XML_BASENAME)_a_dll.lib
29
30# Place where we let the compiler put its output.
31BINDIR = bin.msvc
32XML_INTDIR = int.msvc
33XML_INTDIR_A = int.a.msvc
34XML_INTDIR_A_DLL = int.a.dll.msvc
35UTILS_INTDIR = int.utils.msvc
36
37# The preprocessor and its options.
38CPP = cl.exe /EP
39CPPFLAGS = /nologo /I$(XML_SRCDIR)\include /D "NOLIBTOOL"
40!if "$(WITH_THREADS)" != "no"
41CPPFLAGS = $(CPPFLAGS) /D "_REENTRANT"
42!endif
43
44# The compiler and its options.
45CC = cl.exe
46CFLAGS = /nologo /D "_WINDOWS" /D "_MBCS" /D "NOLIBTOOL" /W3 /wd4244 /wd4267 $(CRUNTIME)
47CFLAGS = $(CFLAGS) /I$(XML_SRCDIR) /I$(XML_SRCDIR)\include /I$(INCPREFIX)
48!if "$(WITH_THREADS)" != "no"
49CFLAGS = $(CFLAGS) /D "_REENTRANT"
50!endif
51!if "$(WITH_THREADS)" == "ctls"
52CFLAGS = $(CFLAGS) /D "XML_THREAD_LOCAL=__declspec(thread)"
53!else if "$(WITH_THREADS)" == "posix"
54CFLAGS = $(CFLAGS) /D "HAVE_PTHREAD_H"
55!endif
56CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
57
58# The linker and its options.
59LD = link.exe
60LDFLAGS = /nologo /VERSION:$(LIBXML_MAJOR_VERSION).$(LIBXML_MINOR_VERSION)
61LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR) /LIBPATH:$(LIBPREFIX)
62LIBS =
63!if "$(WITH_FTP)" == "1" || "$(WITH_HTTP)" == "1"
64LIBS = $(LIBS) wsock32.lib ws2_32.lib
65!endif
66!if "$(WITH_ICONV)" == "1"
67LIBS = $(LIBS) iconv.lib
68!endif
69!if "$(WITH_ICU)" == "1"
70!if "$(STATIC)" == "1"
71LIBS = $(LIBS) advapi32.lib sicuuc.lib sicuin.lib sicudt.lib
72!else
73LIBS = $(LIBS) icuuc.lib icuin.lib icudt.lib
74!endif
75!endif
76!if "$(WITH_ZLIB)" == "1"
77# could be named differently zdll or zlib
78# LIBS = $(LIBS) zdll.lib
79LIBS = $(LIBS) zlib.lib
80!endif
81!if "$(WITH_LZMA)" == "1"
82LIBS = $(LIBS) liblzma.lib
83!endif
84!if "$(WITH_THREADS)" == "posix"
85LIBS = $(LIBS) pthreadVC.lib
86!endif
87!if "$(WITH_MODULES)" == "1"
88LIBS = $(LIBS) kernel32.lib
89!endif
90
91# The archiver and its options.
92AR = lib.exe
93ARFLAGS = /nologo
94
95# Optimisation and debug symbols.
96!if "$(DEBUG)" == "1"
97CFLAGS = $(CFLAGS) /D "_DEBUG" /Od /Z7
98LDFLAGS = $(LDFLAGS) /DEBUG
99!else
100CFLAGS = $(CFLAGS) /D "NDEBUG" /O2
101# commented out as this break VC10 c.f. 634846
102# LDFLAGS = $(LDFLAGS) /OPT:NOWIN98
103LDFLAGS = $(LDFLAGS)
104!endif
105
106# append CFLAGS etc. passed on command line
107CPPFLAGS = $(CPPFLAGS) $(EXTRA_CPPFLAGS)
108CFLAGS = $(CFLAGS) $(EXTRA_CFLAGS)
109LDFLAGS = $(LDFLAGS) $(EXTRA_LDFLAGS)
110
111# Libxml object files.
112XML_OBJS = $(XML_INTDIR)\buf.obj\
113 $(XML_INTDIR)\c14n.obj\
114 $(XML_INTDIR)\catalog.obj\
115 $(XML_INTDIR)\chvalid.obj\
116 $(XML_INTDIR)\debugXML.obj\
117 $(XML_INTDIR)\dict.obj\
118 $(XML_INTDIR)\encoding.obj\
119 $(XML_INTDIR)\entities.obj\
120 $(XML_INTDIR)\error.obj\
121 $(XML_INTDIR)\globals.obj\
122 $(XML_INTDIR)\hash.obj\
123 $(XML_INTDIR)\HTMLparser.obj\
124 $(XML_INTDIR)\HTMLtree.obj\
125 $(XML_INTDIR)\legacy.obj\
126 $(XML_INTDIR)\list.obj\
127 $(XML_INTDIR)\nanoftp.obj\
128 $(XML_INTDIR)\nanohttp.obj\
129 $(XML_INTDIR)\parser.obj\
130 $(XML_INTDIR)\parserInternals.obj\
131 $(XML_INTDIR)\pattern.obj\
132 $(XML_INTDIR)\relaxng.obj\
133 $(XML_INTDIR)\SAX2.obj\
134 $(XML_INTDIR)\SAX.obj\
135 $(XML_INTDIR)\schematron.obj\
136 $(XML_INTDIR)\threads.obj\
137 $(XML_INTDIR)\tree.obj\
138 $(XML_INTDIR)\uri.obj\
139 $(XML_INTDIR)\valid.obj\
140 $(XML_INTDIR)\xinclude.obj\
141 $(XML_INTDIR)\xlink.obj\
142 $(XML_INTDIR)\xmlIO.obj\
143 $(XML_INTDIR)\xmlmemory.obj\
144 $(XML_INTDIR)\xmlreader.obj\
145 $(XML_INTDIR)\xmlregexp.obj\
146 $(XML_INTDIR)\xmlmodule.obj\
147 $(XML_INTDIR)\xmlsave.obj\
148 $(XML_INTDIR)\xmlschemas.obj\
149 $(XML_INTDIR)\xmlschemastypes.obj\
150 $(XML_INTDIR)\xmlunicode.obj\
151 $(XML_INTDIR)\xmlwriter.obj\
152 $(XML_INTDIR)\xpath.obj\
153 $(XML_INTDIR)\xpointer.obj\
154 $(XML_INTDIR)\xmlstring.obj
155
156# Static libxml object files.
157XML_OBJS_A = $(XML_INTDIR_A)\buf.obj\
158 $(XML_INTDIR_A)\c14n.obj\
159 $(XML_INTDIR_A)\catalog.obj\
160 $(XML_INTDIR_A)\chvalid.obj\
161 $(XML_INTDIR_A)\debugXML.obj\
162 $(XML_INTDIR_A)\dict.obj\
163 $(XML_INTDIR_A)\encoding.obj\
164 $(XML_INTDIR_A)\entities.obj\
165 $(XML_INTDIR_A)\error.obj\
166 $(XML_INTDIR_A)\globals.obj\
167 $(XML_INTDIR_A)\hash.obj\
168 $(XML_INTDIR_A)\HTMLparser.obj\
169 $(XML_INTDIR_A)\HTMLtree.obj\
170 $(XML_INTDIR_A)\legacy.obj\
171 $(XML_INTDIR_A)\list.obj\
172 $(XML_INTDIR_A)\nanoftp.obj\
173 $(XML_INTDIR_A)\nanohttp.obj\
174 $(XML_INTDIR_A)\parser.obj\
175 $(XML_INTDIR_A)\parserInternals.obj\
176 $(XML_INTDIR_A)\pattern.obj\
177 $(XML_INTDIR_A)\relaxng.obj\
178 $(XML_INTDIR_A)\SAX2.obj\
179 $(XML_INTDIR_A)\SAX.obj\
180 $(XML_INTDIR_A)\schematron.obj\
181 $(XML_INTDIR_A)\threads.obj\
182 $(XML_INTDIR_A)\tree.obj\
183 $(XML_INTDIR_A)\uri.obj\
184 $(XML_INTDIR_A)\valid.obj\
185 $(XML_INTDIR_A)\xinclude.obj\
186 $(XML_INTDIR_A)\xlink.obj\
187 $(XML_INTDIR_A)\xmlIO.obj\
188 $(XML_INTDIR_A)\xmlmemory.obj\
189 $(XML_INTDIR_A)\xmlreader.obj\
190 $(XML_INTDIR_A)\xmlregexp.obj\
191 $(XML_INTDIR_A)\xmlmodule.obj\
192 $(XML_INTDIR_A)\xmlsave.obj\
193 $(XML_INTDIR_A)\xmlschemas.obj\
194 $(XML_INTDIR_A)\xmlschemastypes.obj\
195 $(XML_INTDIR_A)\xmlunicode.obj\
196 $(XML_INTDIR_A)\xmlwriter.obj\
197 $(XML_INTDIR_A)\xpath.obj\
198 $(XML_INTDIR_A)\xpointer.obj\
199 $(XML_INTDIR_A)\xmlstring.obj
200
201# Static libxml object files.
202XML_OBJS_A_DLL = $(XML_INTDIR_A_DLL)\buf.obj\
203 $(XML_INTDIR_A_DLL)\c14n.obj\
204 $(XML_INTDIR_A_DLL)\catalog.obj\
205 $(XML_INTDIR_A_DLL)\chvalid.obj\
206 $(XML_INTDIR_A_DLL)\debugXML.obj\
207 $(XML_INTDIR_A_DLL)\dict.obj\
208 $(XML_INTDIR_A_DLL)\encoding.obj\
209 $(XML_INTDIR_A_DLL)\entities.obj\
210 $(XML_INTDIR_A_DLL)\error.obj\
211 $(XML_INTDIR_A_DLL)\globals.obj\
212 $(XML_INTDIR_A_DLL)\hash.obj\
213 $(XML_INTDIR_A_DLL)\HTMLparser.obj\
214 $(XML_INTDIR_A_DLL)\HTMLtree.obj\
215 $(XML_INTDIR_A_DLL)\legacy.obj\
216 $(XML_INTDIR_A_DLL)\list.obj\
217 $(XML_INTDIR_A_DLL)\nanoftp.obj\
218 $(XML_INTDIR_A_DLL)\nanohttp.obj\
219 $(XML_INTDIR_A_DLL)\parser.obj\
220 $(XML_INTDIR_A_DLL)\parserInternals.obj\
221 $(XML_INTDIR_A_DLL)\pattern.obj\
222 $(XML_INTDIR_A_DLL)\relaxng.obj\
223 $(XML_INTDIR_A_DLL)\SAX2.obj\
224 $(XML_INTDIR_A_DLL)\SAX.obj\
225 $(XML_INTDIR_A_DLL)\schematron.obj\
226 $(XML_INTDIR_A_DLL)\threads.obj\
227 $(XML_INTDIR_A_DLL)\tree.obj\
228 $(XML_INTDIR_A_DLL)\uri.obj\
229 $(XML_INTDIR_A_DLL)\valid.obj\
230 $(XML_INTDIR_A_DLL)\xinclude.obj\
231 $(XML_INTDIR_A_DLL)\xlink.obj\
232 $(XML_INTDIR_A_DLL)\xmlIO.obj\
233 $(XML_INTDIR_A_DLL)\xmlmemory.obj\
234 $(XML_INTDIR_A_DLL)\xmlreader.obj\
235 $(XML_INTDIR_A_DLL)\xmlregexp.obj\
236 $(XML_INTDIR_A_DLL)\xmlmodule.obj\
237 $(XML_INTDIR_A_DLL)\xmlsave.obj\
238 $(XML_INTDIR_A_DLL)\xmlschemas.obj\
239 $(XML_INTDIR_A_DLL)\xmlschemastypes.obj\
240 $(XML_INTDIR_A_DLL)\xmlunicode.obj\
241 $(XML_INTDIR_A_DLL)\xmlwriter.obj\
242 $(XML_INTDIR_A_DLL)\xpath.obj\
243 $(XML_INTDIR_A_DLL)\xpointer.obj\
244 $(XML_INTDIR_A_DLL)\xmlstring.obj
245
246!if "$(WITH_LZMA)" == "1"
247XML_OBJS = $(XML_OBJS) $(XML_INTDIR)\xzlib.obj
248XML_OBJS_A = $(XML_OBJS_A) $(XML_INTDIR_A)\xzlib.obj
249XML_OBJS_A_DLL = $(XML_OBJS_A_DLL) $(XML_INTDIR_A_DLL)\xzlib.obj
250!endif
251
252# Xmllint and friends executables.
253UTILS = $(BINDIR)\xmllint.exe\
254 $(BINDIR)\xmlcatalog.exe\
255 $(BINDIR)\testModule.exe\
256 $(BINDIR)\runtest.exe\
257 $(BINDIR)\runsuite.exe\
258 $(BINDIR)\runxmlconf.exe\
259 $(BINDIR)\testapi.exe\
260 $(BINDIR)\testchar.exe\
261 $(BINDIR)\testdict.exe\
262 $(BINDIR)\testlimits.exe\
263 $(BINDIR)\testrecurse.exe
264
265!if "$(WITH_THREADS)" != "no"
266UTILS = $(UTILS) $(BINDIR)\testThreads.exe
267!endif
268
269!if "$(VCMANIFEST)" == "1"
270_VC_MANIFEST_EMBED_EXE= if exist [email protected] mt.exe -nologo -manifest [email protected] -outputresource:$@;1
271_VC_MANIFEST_EMBED_DLL= if exist [email protected] mt.exe -nologo -manifest [email protected] -outputresource:$@;2
272!else
273_VC_MANIFEST_EMBED_EXE=
274_VC_MANIFEST_EMBED_DLL=
275!endif
276
277all : libxml libxmla libxmladll utils
278
279libxml : $(BINDIR)\$(XML_SO)
280
281libxmla : $(BINDIR)\$(XML_A)
282
283libxmladll : $(BINDIR)\$(XML_A_DLL)
284
285utils : $(UTILS)
286
287clean :
288 if exist $(XML_INTDIR) rmdir /S /Q $(XML_INTDIR)
289 if exist $(XML_INTDIR_A) rmdir /S /Q $(XML_INTDIR_A)
290 if exist $(XML_INTDIR_A_DLL) rmdir /S /Q $(XML_INTDIR_A_DLL)
291 if exist $(UTILS_INTDIR) rmdir /S /Q $(UTILS_INTDIR)
292 if exist $(BINDIR) rmdir /S /Q $(BINDIR)
293
294distclean : clean
295 if exist config.* del config.*
296 if exist Makefile del Makefile
297
298rebuild : clean all
299
300install-libs : all
301 if not exist $(INCPREFIX)\libxml2 mkdir $(INCPREFIX)\libxml2
302 if not exist $(INCPREFIX)\libxml2\libxml mkdir $(INCPREFIX)\libxml2\libxml
303 if not exist $(BINPREFIX) mkdir $(BINPREFIX)
304 if not exist $(LIBPREFIX) mkdir $(LIBPREFIX)
305 if not exist $(SOPREFIX) mkdir $(SOPREFIX)
306 copy $(XML_SRCDIR)\include\libxml\*.h $(INCPREFIX)\libxml2\libxml
307 copy $(BINDIR)\$(XML_SO) $(SOPREFIX)
308 copy $(BINDIR)\$(XML_A) $(LIBPREFIX)
309 copy $(BINDIR)\$(XML_A_DLL) $(LIBPREFIX)
310 copy $(BINDIR)\$(XML_IMP) $(LIBPREFIX)
311
312install : install-libs
313 copy $(BINDIR)\*.exe $(BINPREFIX)
314 -copy $(BINDIR)\*.pdb $(BINPREFIX)
315
316install-dist : install-libs
317 copy $(BINDIR)\xml*.exe $(BINPREFIX)
318 -copy $(BINDIR)\xml*.pdb $(BINPREFIX)
319
320# This is a target for me, to make a binary distribution. Not for the public use,
321# keep your hands off :-)
322BDVERSION = $(LIBXML_MAJOR_VERSION).$(LIBXML_MINOR_VERSION).$(LIBXML_MICRO_VERSION)
323BDPREFIX = $(XML_BASENAME)-$(BDVERSION).win32
324bindist : all
325 $(MAKE) /nologo PREFIX=$(BDPREFIX) SOPREFIX=$(BDPREFIX)\bin install-dist
326 cscript //NoLogo configure.js genreadme $(XML_BASENAME) $(BDVERSION) $(BDPREFIX)\readme.txt
327
328
329# Makes the output directory.
330$(BINDIR) :
331 if not exist $(BINDIR) mkdir $(BINDIR)
332
333
334# Makes the libxml intermediate directory.
335$(XML_INTDIR) :
336 if not exist $(XML_INTDIR) mkdir $(XML_INTDIR)
337
338# Makes the static libxml intermediate directory.
339$(XML_INTDIR_A) :
340 if not exist $(XML_INTDIR_A) mkdir $(XML_INTDIR_A)
341
342# Makes the static for dll libxml intermediate directory.
343$(XML_INTDIR_A_DLL) :
344 if not exist $(XML_INTDIR_A_DLL) mkdir $(XML_INTDIR_A_DLL)
345
346# An implicit rule for libxml compilation.
347{$(XML_SRCDIR)}.c{$(XML_INTDIR)}.obj::
348 $(CC) $(CFLAGS) /Fo$(XML_INTDIR)\ /c $<
349
350# An implicit rule for static libxml compilation.
351{$(XML_SRCDIR)}.c{$(XML_INTDIR_A)}.obj::
352 $(CC) $(CFLAGS) /D "LIBXML_STATIC" /Fo$(XML_INTDIR_A)\ /c $<
353
354# An implicit rule for static for dll libxml compilation.
355{$(XML_SRCDIR)}.c{$(XML_INTDIR_A_DLL)}.obj::
356 $(CC) $(CFLAGS) /D "LIBXML_STATIC" /D "LIBXML_STATIC_FOR_DLL" /Fo$(XML_INTDIR_A_DLL)\ /c $<
357
358# Compiles libxml source. Uses the implicit rule for commands.
359$(XML_OBJS) : $(XML_INTDIR)
360
361# Compiles static libxml source. Uses the implicit rule for commands.
362$(XML_OBJS_A) : $(XML_INTDIR_A)
363
364# Compiles static for dll libxml source. Uses the implicit rule for commands.
365$(XML_OBJS_A_DLL) : $(XML_INTDIR_A_DLL)
366
367$(XML_INTDIR)\$(XML_RES) : $(XML_INTDIR) libxml2.rc
368 rc -Fo $(XML_INTDIR)\$(XML_RES) libxml2.rc
369
370# Creates the libxml shared object.
371$(BINDIR)\$(XML_SO) : $(BINDIR) $(XML_OBJS) $(XML_INTDIR)\$(XML_RES)
372 $(LD) $(LDFLAGS) /DLL \
373 /IMPLIB:$(BINDIR)\$(XML_IMP) /OUT:$(BINDIR)\$(XML_SO) $(XML_OBJS) $(XML_INTDIR)\$(XML_RES) $(LIBS)
374 @$(_VC_MANIFEST_EMBED_DLL)
375
376# Creates the libxml archive.
377$(BINDIR)\$(XML_A) : $(BINDIR) $(XML_OBJS_A)
378 $(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(XML_A) $(XML_OBJS_A)
379
380# Creates the libxml static for dll archive.
381$(BINDIR)\$(XML_A_DLL) : $(BINDIR) $(XML_OBJS_A_DLL)
382 $(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(XML_A_DLL) $(XML_OBJS_A_DLL)
383
384# Makes the utils intermediate directory.
385$(UTILS_INTDIR) :
386 if not exist $(UTILS_INTDIR) mkdir $(UTILS_INTDIR)
387
388# An implicit rule for xmllint and friends.
389!if "$(STATIC)" == "1"
390{$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe:
391 $(CC) /D "LIBXML_STATIC" $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $<
392 $(LD) $(LDFLAGS) /OUT:$@ $(XML_A) $(LIBS) $(UTILS_INTDIR)\$(<B).obj
393 @$(_VC_MANIFEST_EMBED_EXE)
394!else
395{$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe:
396 $(CC) $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $<
397 $(LD) $(LDFLAGS) /OUT:$@ $(XML_IMP) $(LIBS) $(UTILS_INTDIR)\$(<B).obj
398 @$(_VC_MANIFEST_EMBED_EXE)
399!endif
400
401# Builds xmllint and friends. Uses the implicit rule for commands.
402$(UTILS) : $(UTILS_INTDIR) $(BINDIR) libxml libxmla libxmladll
403
404# Source dependences should be autogenerated somehow here, but how to
405# do it? I have no clue.
406
407# TESTS
408
409tests : checktests XPathtests
410
411checktests : $(UTILS)
412 cd .. && win32\$(BINDIR)\runtest.exe
413 cd .. && win32\$(BINDIR)\testrecurse.exe
414 cd .. && win32\$(BINDIR)\testapi.exe
415 cd .. && win32\$(BINDIR)\testchar.exe
416 cd .. && win32\$(BINDIR)\testdict.exe
417 cd .. && win32\$(BINDIR)\runxmlconf.exe
418
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette