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