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 |
|
---|
18 | AUTOCONF = .\config.msvc
|
---|
19 | !include $(AUTOCONF)
|
---|
20 |
|
---|
21 | # Names of various input and output components.
|
---|
22 | XML_NAME = xml2
|
---|
23 | XML_BASENAME = lib$(XML_NAME)
|
---|
24 | XML_SO = $(XML_BASENAME).dll
|
---|
25 | XML_IMP = $(XML_BASENAME).lib
|
---|
26 | XML_DEF = $(XML_BASENAME).def
|
---|
27 | XML_A = $(XML_BASENAME)_a.lib
|
---|
28 | XML_A_DLL = $(XML_BASENAME)_a_dll.lib
|
---|
29 |
|
---|
30 | # Place where we let the compiler put its output.
|
---|
31 | BINDIR = bin.msvc
|
---|
32 | XML_INTDIR = int.msvc
|
---|
33 | XML_INTDIR_A = int.a.msvc
|
---|
34 | XML_INTDIR_A_DLL = int.a.dll.msvc
|
---|
35 | UTILS_INTDIR = int.utils.msvc
|
---|
36 |
|
---|
37 | # The preprocessor and its options.
|
---|
38 | CPP = cl.exe /EP
|
---|
39 | CPPFLAGS = /nologo /I$(XML_SRCDIR)\include
|
---|
40 | !if "$(WITH_THREADS)" != "no"
|
---|
41 | CPPFLAGS = $(CPPFLAGS) /D "_REENTRANT"
|
---|
42 | !endif
|
---|
43 |
|
---|
44 | # The compiler and its options.
|
---|
45 | CC = cl.exe
|
---|
46 | CFLAGS = /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS" /W1 $(CRUNTIME)
|
---|
47 | CFLAGS = $(CFLAGS) /I$(XML_SRCDIR) /I$(XML_SRCDIR)\include /I$(INCPREFIX)
|
---|
48 | !if "$(WITH_THREADS)" != "no"
|
---|
49 | CFLAGS = $(CFLAGS) /D "_REENTRANT"
|
---|
50 | !endif
|
---|
51 | !if "$(WITH_THREADS)" == "yes" || "$(WITH_THREADS)" == "ctls"
|
---|
52 | CFLAGS = $(CFLAGS) /D "HAVE_WIN32_THREADS" /D "HAVE_COMPILER_TLS"
|
---|
53 | !else if "$(WITH_THREADS)" == "native"
|
---|
54 | CFLAGS = $(CFLAGS) /D "HAVE_WIN32_THREADS"
|
---|
55 | !else if "$(WITH_THREADS)" == "posix"
|
---|
56 | CFLAGS = $(CFLAGS) /D "HAVE_PTHREAD_H"
|
---|
57 | !endif
|
---|
58 | !if "$(WITH_ZLIB)" == "1"
|
---|
59 | CFLAGS = $(CFLAGS) /D "HAVE_ZLIB_H"
|
---|
60 | !endif
|
---|
61 | CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
|
---|
62 |
|
---|
63 | # The linker and its options.
|
---|
64 | LD = link.exe
|
---|
65 | LDFLAGS = /nologo /VERSION:$(LIBXML_MAJOR_VERSION).$(LIBXML_MINOR_VERSION)
|
---|
66 | LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR) /LIBPATH:$(LIBPREFIX)
|
---|
67 | LIBS =
|
---|
68 | !if "$(WITH_FTP)" == "1" || "$(WITH_HTTP)" == "1"
|
---|
69 | LIBS = $(LIBS) wsock32.lib
|
---|
70 | !endif
|
---|
71 | !if "$(WITH_ICONV)" == "1"
|
---|
72 | LIBS = $(LIBS) iconv.lib
|
---|
73 | !endif
|
---|
74 | !if "$(WITH_ZLIB)" == "1"
|
---|
75 | LIBS = $(LIBS) zdll.lib
|
---|
76 | !endif
|
---|
77 | !if "$(WITH_THREADS)" == "posix"
|
---|
78 | LIBS = $(LIBS) pthreadVC.lib
|
---|
79 | !endif
|
---|
80 | !if "$(WITH_MODULES)" == "1"
|
---|
81 | LIBS = $(LIBS) kernel32.lib
|
---|
82 | !endif
|
---|
83 |
|
---|
84 | # The archiver and its options.
|
---|
85 | AR = lib.exe
|
---|
86 | ARFLAGS = /nologo
|
---|
87 |
|
---|
88 | # Optimisation and debug symbols.
|
---|
89 | !if "$(DEBUG)" == "1"
|
---|
90 | CFLAGS = $(CFLAGS) /D "_DEBUG" /Od /Z7
|
---|
91 | LDFLAGS = $(LDFLAGS) /DEBUG
|
---|
92 | !else
|
---|
93 | CFLAGS = $(CFLAGS) /D "NDEBUG" /O2
|
---|
94 | LDFLAGS = $(LDFLAGS) /OPT:NOWIN98
|
---|
95 | !endif
|
---|
96 |
|
---|
97 | # Libxml object files.
|
---|
98 | XML_OBJS = $(XML_INTDIR)\c14n.obj\
|
---|
99 | $(XML_INTDIR)\catalog.obj\
|
---|
100 | $(XML_INTDIR)\chvalid.obj\
|
---|
101 | $(XML_INTDIR)\debugXML.obj\
|
---|
102 | $(XML_INTDIR)\dict.obj\
|
---|
103 | $(XML_INTDIR)\DOCBparser.obj\
|
---|
104 | $(XML_INTDIR)\encoding.obj\
|
---|
105 | $(XML_INTDIR)\entities.obj\
|
---|
106 | $(XML_INTDIR)\error.obj\
|
---|
107 | $(XML_INTDIR)\globals.obj\
|
---|
108 | $(XML_INTDIR)\hash.obj\
|
---|
109 | $(XML_INTDIR)\HTMLparser.obj\
|
---|
110 | $(XML_INTDIR)\HTMLtree.obj\
|
---|
111 | $(XML_INTDIR)\legacy.obj\
|
---|
112 | $(XML_INTDIR)\list.obj\
|
---|
113 | $(XML_INTDIR)\nanoftp.obj\
|
---|
114 | $(XML_INTDIR)\nanohttp.obj\
|
---|
115 | $(XML_INTDIR)\parser.obj\
|
---|
116 | $(XML_INTDIR)\parserInternals.obj\
|
---|
117 | $(XML_INTDIR)\pattern.obj\
|
---|
118 | $(XML_INTDIR)\relaxng.obj\
|
---|
119 | $(XML_INTDIR)\SAX2.obj\
|
---|
120 | $(XML_INTDIR)\SAX.obj\
|
---|
121 | $(XML_INTDIR)\schematron.obj\
|
---|
122 | $(XML_INTDIR)\threads.obj\
|
---|
123 | $(XML_INTDIR)\tree.obj\
|
---|
124 | $(XML_INTDIR)\uri.obj\
|
---|
125 | $(XML_INTDIR)\valid.obj\
|
---|
126 | $(XML_INTDIR)\xinclude.obj\
|
---|
127 | $(XML_INTDIR)\xlink.obj\
|
---|
128 | $(XML_INTDIR)\xmlIO.obj\
|
---|
129 | $(XML_INTDIR)\xmlmemory.obj\
|
---|
130 | $(XML_INTDIR)\xmlreader.obj\
|
---|
131 | $(XML_INTDIR)\xmlregexp.obj\
|
---|
132 | $(XML_INTDIR)\xmlmodule.obj\
|
---|
133 | $(XML_INTDIR)\xmlsave.obj\
|
---|
134 | $(XML_INTDIR)\xmlschemas.obj\
|
---|
135 | $(XML_INTDIR)\xmlschemastypes.obj\
|
---|
136 | $(XML_INTDIR)\xmlunicode.obj\
|
---|
137 | $(XML_INTDIR)\xmlwriter.obj\
|
---|
138 | $(XML_INTDIR)\xpath.obj\
|
---|
139 | $(XML_INTDIR)\xpointer.obj\
|
---|
140 | $(XML_INTDIR)\xmlstring.obj
|
---|
141 |
|
---|
142 | # Static libxml object files.
|
---|
143 | XML_OBJS_A = $(XML_INTDIR_A)\c14n.obj\
|
---|
144 | $(XML_INTDIR_A)\catalog.obj\
|
---|
145 | $(XML_INTDIR_A)\chvalid.obj\
|
---|
146 | $(XML_INTDIR_A)\debugXML.obj\
|
---|
147 | $(XML_INTDIR_A)\dict.obj\
|
---|
148 | $(XML_INTDIR_A)\DOCBparser.obj\
|
---|
149 | $(XML_INTDIR_A)\encoding.obj\
|
---|
150 | $(XML_INTDIR_A)\entities.obj\
|
---|
151 | $(XML_INTDIR_A)\error.obj\
|
---|
152 | $(XML_INTDIR_A)\globals.obj\
|
---|
153 | $(XML_INTDIR_A)\hash.obj\
|
---|
154 | $(XML_INTDIR_A)\HTMLparser.obj\
|
---|
155 | $(XML_INTDIR_A)\HTMLtree.obj\
|
---|
156 | $(XML_INTDIR_A)\legacy.obj\
|
---|
157 | $(XML_INTDIR_A)\list.obj\
|
---|
158 | $(XML_INTDIR_A)\nanoftp.obj\
|
---|
159 | $(XML_INTDIR_A)\nanohttp.obj\
|
---|
160 | $(XML_INTDIR_A)\parser.obj\
|
---|
161 | $(XML_INTDIR_A)\parserInternals.obj\
|
---|
162 | $(XML_INTDIR_A)\pattern.obj\
|
---|
163 | $(XML_INTDIR_A)\relaxng.obj\
|
---|
164 | $(XML_INTDIR_A)\SAX2.obj\
|
---|
165 | $(XML_INTDIR_A)\SAX.obj\
|
---|
166 | $(XML_INTDIR_A)\schematron.obj\
|
---|
167 | $(XML_INTDIR_A)\threads.obj\
|
---|
168 | $(XML_INTDIR_A)\tree.obj\
|
---|
169 | $(XML_INTDIR_A)\uri.obj\
|
---|
170 | $(XML_INTDIR_A)\valid.obj\
|
---|
171 | $(XML_INTDIR_A)\xinclude.obj\
|
---|
172 | $(XML_INTDIR_A)\xlink.obj\
|
---|
173 | $(XML_INTDIR_A)\xmlIO.obj\
|
---|
174 | $(XML_INTDIR_A)\xmlmemory.obj\
|
---|
175 | $(XML_INTDIR_A)\xmlreader.obj\
|
---|
176 | $(XML_INTDIR_A)\xmlregexp.obj\
|
---|
177 | $(XML_INTDIR_A)\xmlmodule.obj\
|
---|
178 | $(XML_INTDIR_A)\xmlsave.obj\
|
---|
179 | $(XML_INTDIR_A)\xmlschemas.obj\
|
---|
180 | $(XML_INTDIR_A)\xmlschemastypes.obj\
|
---|
181 | $(XML_INTDIR_A)\xmlunicode.obj\
|
---|
182 | $(XML_INTDIR_A)\xmlwriter.obj\
|
---|
183 | $(XML_INTDIR_A)\xpath.obj\
|
---|
184 | $(XML_INTDIR_A)\xpointer.obj\
|
---|
185 | $(XML_INTDIR_A)\xmlstring.obj
|
---|
186 |
|
---|
187 | # Static libxml object files.
|
---|
188 | XML_OBJS_A_DLL = $(XML_INTDIR_A_DLL)\c14n.obj\
|
---|
189 | $(XML_INTDIR_A_DLL)\catalog.obj\
|
---|
190 | $(XML_INTDIR_A_DLL)\chvalid.obj\
|
---|
191 | $(XML_INTDIR_A_DLL)\debugXML.obj\
|
---|
192 | $(XML_INTDIR_A_DLL)\dict.obj\
|
---|
193 | $(XML_INTDIR_A_DLL)\DOCBparser.obj\
|
---|
194 | $(XML_INTDIR_A_DLL)\encoding.obj\
|
---|
195 | $(XML_INTDIR_A_DLL)\entities.obj\
|
---|
196 | $(XML_INTDIR_A_DLL)\error.obj\
|
---|
197 | $(XML_INTDIR_A_DLL)\globals.obj\
|
---|
198 | $(XML_INTDIR_A_DLL)\hash.obj\
|
---|
199 | $(XML_INTDIR_A_DLL)\HTMLparser.obj\
|
---|
200 | $(XML_INTDIR_A_DLL)\HTMLtree.obj\
|
---|
201 | $(XML_INTDIR_A_DLL)\legacy.obj\
|
---|
202 | $(XML_INTDIR_A_DLL)\list.obj\
|
---|
203 | $(XML_INTDIR_A_DLL)\nanoftp.obj\
|
---|
204 | $(XML_INTDIR_A_DLL)\nanohttp.obj\
|
---|
205 | $(XML_INTDIR_A_DLL)\parser.obj\
|
---|
206 | $(XML_INTDIR_A_DLL)\parserInternals.obj\
|
---|
207 | $(XML_INTDIR_A_DLL)\pattern.obj\
|
---|
208 | $(XML_INTDIR_A_DLL)\relaxng.obj\
|
---|
209 | $(XML_INTDIR_A_DLL)\SAX2.obj\
|
---|
210 | $(XML_INTDIR_A_DLL)\SAX.obj\
|
---|
211 | $(XML_INTDIR_A_DLL)\schematron.obj\
|
---|
212 | $(XML_INTDIR_A_DLL)\threads.obj\
|
---|
213 | $(XML_INTDIR_A_DLL)\tree.obj\
|
---|
214 | $(XML_INTDIR_A_DLL)\uri.obj\
|
---|
215 | $(XML_INTDIR_A_DLL)\valid.obj\
|
---|
216 | $(XML_INTDIR_A_DLL)\xinclude.obj\
|
---|
217 | $(XML_INTDIR_A_DLL)\xlink.obj\
|
---|
218 | $(XML_INTDIR_A_DLL)\xmlIO.obj\
|
---|
219 | $(XML_INTDIR_A_DLL)\xmlmemory.obj\
|
---|
220 | $(XML_INTDIR_A_DLL)\xmlreader.obj\
|
---|
221 | $(XML_INTDIR_A_DLL)\xmlregexp.obj\
|
---|
222 | $(XML_INTDIR_A_DLL)\xmlmodule.obj\
|
---|
223 | $(XML_INTDIR_A_DLL)\xmlsave.obj\
|
---|
224 | $(XML_INTDIR_A_DLL)\xmlschemas.obj\
|
---|
225 | $(XML_INTDIR_A_DLL)\xmlschemastypes.obj\
|
---|
226 | $(XML_INTDIR_A_DLL)\xmlunicode.obj\
|
---|
227 | $(XML_INTDIR_A_DLL)\xmlwriter.obj\
|
---|
228 | $(XML_INTDIR_A_DLL)\xpath.obj\
|
---|
229 | $(XML_INTDIR_A_DLL)\xpointer.obj\
|
---|
230 | $(XML_INTDIR_A_DLL)\xmlstring.obj
|
---|
231 |
|
---|
232 | # Xmllint and friends executables.
|
---|
233 | UTILS = $(BINDIR)\xmllint.exe\
|
---|
234 | $(BINDIR)\xmlcatalog.exe\
|
---|
235 | $(BINDIR)\testAutomata.exe\
|
---|
236 | $(BINDIR)\testC14N.exe\
|
---|
237 | $(BINDIR)\testDocbook.exe\
|
---|
238 | $(BINDIR)\testHTML.exe\
|
---|
239 | $(BINDIR)\testReader.exe\
|
---|
240 | $(BINDIR)\testRelax.exe\
|
---|
241 | $(BINDIR)\testRegexp.exe\
|
---|
242 | $(BINDIR)\testModule.exe\
|
---|
243 | $(BINDIR)\testSAX.exe\
|
---|
244 | $(BINDIR)\testSchemas.exe\
|
---|
245 | $(BINDIR)\testURI.exe\
|
---|
246 | $(BINDIR)\testXPath.exe\
|
---|
247 | $(BINDIR)\runtest.exe\
|
---|
248 | $(BINDIR)\runsuite.exe\
|
---|
249 | $(BINDIR)\testapi.exe
|
---|
250 |
|
---|
251 | !if "$(WITH_THREADS)" == "yes" || "$(WITH_THREADS)" == "ctls" || "$(WITH_THREADS)" == "native"
|
---|
252 | UTILS = $(UTILS) $(BINDIR)\testThreadsWin32.exe
|
---|
253 | !else if "$(WITH_THREADS)" == "posix"
|
---|
254 | UTILS = $(UTILS) $(BINDIR)\testThreads.exe
|
---|
255 | !endif
|
---|
256 |
|
---|
257 | !if "$(VCMANIFEST)" == "1"
|
---|
258 | _VC_MANIFEST_EMBED_EXE= if exist [email protected] mt.exe -nologo -manifest [email protected] -outputresource:$@;1
|
---|
259 | _VC_MANIFEST_EMBED_DLL= if exist [email protected] mt.exe -nologo -manifest [email protected] -outputresource:$@;2
|
---|
260 | !else
|
---|
261 | _VC_MANIFEST_EMBED_EXE=
|
---|
262 | _VC_MANIFEST_EMBED_DLL=
|
---|
263 | !endif
|
---|
264 |
|
---|
265 | all : libxml libxmla libxmladll utils
|
---|
266 |
|
---|
267 | libxml : $(BINDIR)\$(XML_SO)
|
---|
268 |
|
---|
269 | libxmla : $(BINDIR)\$(XML_A)
|
---|
270 |
|
---|
271 | libxmladll : $(BINDIR)\$(XML_A_DLL)
|
---|
272 |
|
---|
273 | utils : $(UTILS)
|
---|
274 |
|
---|
275 | clean :
|
---|
276 | if exist $(XML_INTDIR) rmdir /S /Q $(XML_INTDIR)
|
---|
277 | if exist $(XML_INTDIR_A) rmdir /S /Q $(XML_INTDIR_A)
|
---|
278 | if exist $(XML_INTDIR_A_DLL) rmdir /S /Q $(XML_INTDIR_A_DLL)
|
---|
279 | if exist $(UTILS_INTDIR) rmdir /S /Q $(UTILS_INTDIR)
|
---|
280 | if exist $(BINDIR) rmdir /S /Q $(BINDIR)
|
---|
281 |
|
---|
282 | distclean : clean
|
---|
283 | if exist config.* del config.*
|
---|
284 | if exist Makefile del Makefile
|
---|
285 |
|
---|
286 | rebuild : clean all
|
---|
287 |
|
---|
288 | install-libs : all
|
---|
289 | if not exist $(INCPREFIX)\libxml mkdir $(INCPREFIX)\libxml
|
---|
290 | if not exist $(BINPREFIX) mkdir $(BINPREFIX)
|
---|
291 | if not exist $(LIBPREFIX) mkdir $(LIBPREFIX)
|
---|
292 | if not exist $(SOPREFIX) mkdir $(SOPREFIX)
|
---|
293 | copy $(XML_SRCDIR)\include\libxml\*.h $(INCPREFIX)\libxml
|
---|
294 | copy $(BINDIR)\$(XML_SO) $(SOPREFIX)
|
---|
295 | copy $(BINDIR)\$(XML_A) $(LIBPREFIX)
|
---|
296 | copy $(BINDIR)\$(XML_A_DLL) $(LIBPREFIX)
|
---|
297 | copy $(BINDIR)\$(XML_IMP) $(LIBPREFIX)
|
---|
298 |
|
---|
299 | install : install-libs
|
---|
300 | copy $(BINDIR)\*.exe $(BINPREFIX)
|
---|
301 | -copy $(BINDIR)\*.pdb $(BINPREFIX)
|
---|
302 |
|
---|
303 | install-dist : install-libs
|
---|
304 | copy $(BINDIR)\xml*.exe $(BINPREFIX)
|
---|
305 | -copy $(BINDIR)\xml*.pdb $(BINPREFIX)
|
---|
306 |
|
---|
307 | # This is a target for me, to make a binary distribution. Not for the public use,
|
---|
308 | # keep your hands off :-)
|
---|
309 | BDVERSION = $(LIBXML_MAJOR_VERSION).$(LIBXML_MINOR_VERSION).$(LIBXML_MICRO_VERSION)
|
---|
310 | BDPREFIX = $(XML_BASENAME)-$(BDVERSION).win32
|
---|
311 | bindist : all
|
---|
312 | $(MAKE) /nologo PREFIX=$(BDPREFIX) SOPREFIX=$(BDPREFIX)\bin install-dist
|
---|
313 | cscript //NoLogo configure.js genreadme $(XML_BASENAME) $(BDVERSION) $(BDPREFIX)\readme.txt
|
---|
314 |
|
---|
315 |
|
---|
316 | # Makes the output directory.
|
---|
317 | $(BINDIR) :
|
---|
318 | if not exist $(BINDIR) mkdir $(BINDIR)
|
---|
319 |
|
---|
320 |
|
---|
321 | # Makes the libxml intermediate directory.
|
---|
322 | $(XML_INTDIR) :
|
---|
323 | if not exist $(XML_INTDIR) mkdir $(XML_INTDIR)
|
---|
324 |
|
---|
325 | # Makes the static libxml intermediate directory.
|
---|
326 | $(XML_INTDIR_A) :
|
---|
327 | if not exist $(XML_INTDIR_A) mkdir $(XML_INTDIR_A)
|
---|
328 |
|
---|
329 | # Makes the static for dll libxml intermediate directory.
|
---|
330 | $(XML_INTDIR_A_DLL) :
|
---|
331 | if not exist $(XML_INTDIR_A_DLL) mkdir $(XML_INTDIR_A_DLL)
|
---|
332 |
|
---|
333 | # An implicit rule for libxml compilation.
|
---|
334 | {$(XML_SRCDIR)}.c{$(XML_INTDIR)}.obj::
|
---|
335 | $(CC) $(CFLAGS) /Fo$(XML_INTDIR)\ /c $<
|
---|
336 |
|
---|
337 | # An implicit rule for static libxml compilation.
|
---|
338 | {$(XML_SRCDIR)}.c{$(XML_INTDIR_A)}.obj::
|
---|
339 | $(CC) $(CFLAGS) /D "LIBXML_STATIC" /Fo$(XML_INTDIR_A)\ /c $<
|
---|
340 |
|
---|
341 | # An implicit rule for static for dll libxml compilation.
|
---|
342 | {$(XML_SRCDIR)}.c{$(XML_INTDIR_A_DLL)}.obj::
|
---|
343 | $(CC) $(CFLAGS) /D "LIBXML_STATIC" /D "LIBXML_STATIC_FOR_DLL" /Fo$(XML_INTDIR_A_DLL)\ /c $<
|
---|
344 |
|
---|
345 | # Compiles libxml source. Uses the implicit rule for commands.
|
---|
346 | $(XML_OBJS) : $(XML_INTDIR)
|
---|
347 |
|
---|
348 | # Compiles static libxml source. Uses the implicit rule for commands.
|
---|
349 | $(XML_OBJS_A) : $(XML_INTDIR_A)
|
---|
350 |
|
---|
351 | # Compiles static for dll libxml source. Uses the implicit rule for commands.
|
---|
352 | $(XML_OBJS_A_DLL) : $(XML_INTDIR_A_DLL)
|
---|
353 |
|
---|
354 | # Creates the export definition file (DEF) for libxml.
|
---|
355 | $(XML_INTDIR)\$(XML_DEF) : $(XML_INTDIR) $(XML_DEF).src
|
---|
356 | $(CPP) $(CPPFLAGS) $(XML_DEF).src > $(XML_INTDIR)\$(XML_DEF)
|
---|
357 |
|
---|
358 | # Creates the libxml shared object.
|
---|
359 | $(BINDIR)\$(XML_SO) : $(BINDIR) $(XML_OBJS) $(XML_INTDIR)\$(XML_DEF)
|
---|
360 | $(LD) $(LDFLAGS) /DLL \
|
---|
361 | /IMPLIB:$(BINDIR)\$(XML_IMP) /OUT:$(BINDIR)\$(XML_SO) $(XML_OBJS) $(LIBS)
|
---|
362 | @$(_VC_MANIFEST_EMBED_DLL)
|
---|
363 |
|
---|
364 | #$(BINDIR)\$(XML_SO) : $(BINDIR) $(XML_OBJS) $(XML_INTDIR)\$(XML_DEF)
|
---|
365 | # $(LD) $(LDFLAGS) /DLL /DEF:$(XML_INTDIR)\$(XML_DEF) \
|
---|
366 | # /IMPLIB:$(BINDIR)\$(XML_IMP) /OUT:$(BINDIR)\$(XML_SO) $(XML_OBJS) $(LIBS)
|
---|
367 |
|
---|
368 | # Creates the libxml archive.
|
---|
369 | $(BINDIR)\$(XML_A) : $(BINDIR) $(XML_OBJS_A)
|
---|
370 | $(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(XML_A) $(XML_OBJS_A)
|
---|
371 |
|
---|
372 | # Creates the libxml static for dll archive.
|
---|
373 | $(BINDIR)\$(XML_A_DLL) : $(BINDIR) $(XML_OBJS_A_DLL)
|
---|
374 | $(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(XML_A_DLL) $(XML_OBJS_A_DLL)
|
---|
375 |
|
---|
376 | # Makes the utils intermediate directory.
|
---|
377 | $(UTILS_INTDIR) :
|
---|
378 | if not exist $(UTILS_INTDIR) mkdir $(UTILS_INTDIR)
|
---|
379 |
|
---|
380 | # An implicit rule for xmllint and friends.
|
---|
381 | !if "$(STATIC)" == "1"
|
---|
382 | {$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe:
|
---|
383 | $(CC) /D "LIBXML_STATIC" $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $<
|
---|
384 | $(LD) $(LDFLAGS) /OUT:$@ $(XML_A) $(LIBS) $(UTILS_INTDIR)\$(<B).obj
|
---|
385 | @$(_VC_MANIFEST_EMBED_EXE)
|
---|
386 | !else
|
---|
387 | {$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe:
|
---|
388 | $(CC) $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $<
|
---|
389 | $(LD) $(LDFLAGS) /OUT:$@ $(XML_IMP) $(LIBS) $(UTILS_INTDIR)\$(<B).obj
|
---|
390 | @$(_VC_MANIFEST_EMBED_EXE)
|
---|
391 | !endif
|
---|
392 |
|
---|
393 | # Builds xmllint and friends. Uses the implicit rule for commands.
|
---|
394 | $(UTILS) : $(UTILS_INTDIR) $(BINDIR) libxml libxmla libxmladll
|
---|
395 |
|
---|
396 | # Source dependences should be autogenerated somehow here, but how to
|
---|
397 | # do it? I have no clue.
|
---|
398 |
|
---|
399 | # TESTS
|
---|
400 |
|
---|
401 | tests : XPathtests
|
---|
402 |
|
---|
403 | XPathtests : $(BINDIR)\testXPath.exe
|
---|
404 | @echo. 2> .memdump
|
---|
405 | @echo ## XPath regression tests
|
---|
406 | @-$(BINDIR)\testXPath.exe | find /C "support not compiled in" 1>nul
|
---|
407 | @if %ERRORLEVEL% NEQ 0 @( \
|
---|
408 | echo Skipping debug not compiled in\
|
---|
409 | @exit 0 \
|
---|
410 | )
|
---|
411 | @for %%I in ($(XML_SRCDIR)\test\XPath\expr\*.*) do @( \
|
---|
412 | @IF NOT EXIST $(XML_SRCDIR)\result\XPath\expr\%%~nxI ( \
|
---|
413 | @echo New test %%~nxI &&\
|
---|
414 | @echo %%~nxI &&\
|
---|
415 | $(BINDIR)\testXPath.exe -f --expr %%I > $(XML_SRCDIR)/result/XPath/expr/%%~nxI &&\
|
---|
416 | findstr /C:"MEMORY ALLOCATED : 0" \
|
---|
417 | ) ELSE ( \
|
---|
418 | $(BINDIR)\testXPath.exe -f --expr %%I 2>&1 > result.%%~nxI &&\
|
---|
419 | fc $(XML_SRCDIR)\result\XPath\expr\%%~nxI result.%%~nxI >nul &\
|
---|
420 | iF ERRORLEVEL 1 exit 1 & \
|
---|
421 | findstr "MEMORY ALLOCATED" .memdump | findstr /C:"MEMORY ALLOCATED : 0" >nul &&\
|
---|
422 | del result.%%~nxI \
|
---|
423 | ) \
|
---|
424 | )
|
---|
425 | @for %%I in ($(XML_SRCDIR)\test\XPath\docs\*.*) do @( \
|
---|
426 | for %%J in ($(XML_SRCDIR)\test\XPath\tests\%%~nxI*.*) do @( \
|
---|
427 | if not exist $(XML_SRCDIR)\result\XPath\tests\%%~nxJ ( \
|
---|
428 | $(BINDIR)\testXPath.exe -f -i %%I %%J > $(XML_SRCDIR)\result\XPath\tests\%%~nxJ &&\
|
---|
429 | findstr /C:"MEMORY ALLOCATED" .memdump | findstr /C:"MEMORY ALLOCATED : 0" > nul \
|
---|
430 | ) ELSE ( \
|
---|
431 | $(BINDIR)\testXPAth.exe -f -i %%I %%J 2>&1 > result.%%~nxJ &&\
|
---|
432 | findstr /C:"MEMORY ALLOCATED" .memdump | findstr /C:"MEMORY ALLOCATED : 0">null &&\
|
---|
433 | fc $(XML_SRCDIR)\result\XPath\tests\%%~nxJ result.%%~nxJ >null & \
|
---|
434 | IF ERRORLEVEL 1 (echo Error: %%I %%J & exit 1) & \
|
---|
435 | del result.%%~nxJ \
|
---|
436 | )\
|
---|
437 | )\
|
---|
438 | )
|
---|
439 |
|
---|
440 | XMLtests : $(BINDIR)\xmllint.exe
|
---|
441 | @echo. 2> .memdump
|
---|
442 | @echo ## XML regression tests
|
---|
443 | -@for %%I in ($(XML_SRCDIR)\test\*) do @( \
|
---|
444 | if not exist $(XML_SRCDIR)\result\%%~nxI ( \
|
---|
445 | echo New test file %%~nxI &\
|
---|
446 | $(BINDIR)\xmllint.exe %%I > $(XML_SRCDIR)\result\%%~nxI && \
|
---|
447 | findstr /C:"MEMORY ALLOCATED" .memdump | findstr /C:"MEMORY ALLOCATED : 0" > null \
|
---|
448 | ) ELSE ( \
|
---|
449 | $(BINDIR)\xmllint.exe %%I 2>&1 > result.%%~nxI && \
|
---|
450 | findstr /C:"MEMORY ALLOC" .memdump | findstr /C:"MEMORY ALLOCATED : 0" > null && \
|
---|
451 | fc $(XML_SRCDIR)\result\%%~nxI result.%%~nxI > null && \
|
---|
452 | $(BINDIR)\xmllint.exe result.%%~nxI 2>&1 > result2.%%~nxI | findstr /V /C:"failed to load external entity" && \
|
---|
453 | fc result.%%~nxI result2.%%~nxI & \
|
---|
454 | del result.%%~nxI result2.%%~nxI\
|
---|
455 | ) \
|
---|
456 | )
|
---|
457 |
|
---|
458 |
|
---|
459 |
|
---|
460 |
|
---|
461 |
|
---|
462 |
|
---|