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# append CFLAGS etc. passed on command line 110CPPFLAGS = $(CPPFLAGS) $(EXTRA_CPPFLAGS) 111CFLAGS = $(CFLAGS) $(EXTRA_CFLAGS) 112LDFLAGS = $(LDFLAGS) $(EXTRA_LDFLAGS) 113 114# Libxml object files. 115XML_OBJS = $(XML_INTDIR)\buf.obj\ 116 $(XML_INTDIR)\c14n.obj\ 117 $(XML_INTDIR)\catalog.obj\ 118 $(XML_INTDIR)\chvalid.obj\ 119 $(XML_INTDIR)\debugXML.obj\ 120 $(XML_INTDIR)\dict.obj\ 121 $(XML_INTDIR)\DOCBparser.obj\ 122 $(XML_INTDIR)\encoding.obj\ 123 $(XML_INTDIR)\entities.obj\ 124 $(XML_INTDIR)\error.obj\ 125 $(XML_INTDIR)\globals.obj\ 126 $(XML_INTDIR)\hash.obj\ 127 $(XML_INTDIR)\HTMLparser.obj\ 128 $(XML_INTDIR)\HTMLtree.obj\ 129 $(XML_INTDIR)\legacy.obj\ 130 $(XML_INTDIR)\list.obj\ 131 $(XML_INTDIR)\nanoftp.obj\ 132 $(XML_INTDIR)\nanohttp.obj\ 133 $(XML_INTDIR)\parser.obj\ 134 $(XML_INTDIR)\parserInternals.obj\ 135 $(XML_INTDIR)\pattern.obj\ 136 $(XML_INTDIR)\relaxng.obj\ 137 $(XML_INTDIR)\SAX2.obj\ 138 $(XML_INTDIR)\SAX.obj\ 139 $(XML_INTDIR)\schematron.obj\ 140 $(XML_INTDIR)\threads.obj\ 141 $(XML_INTDIR)\tree.obj\ 142 $(XML_INTDIR)\uri.obj\ 143 $(XML_INTDIR)\valid.obj\ 144 $(XML_INTDIR)\xinclude.obj\ 145 $(XML_INTDIR)\xlink.obj\ 146 $(XML_INTDIR)\xmlIO.obj\ 147 $(XML_INTDIR)\xmlmemory.obj\ 148 $(XML_INTDIR)\xmlreader.obj\ 149 $(XML_INTDIR)\xmlregexp.obj\ 150 $(XML_INTDIR)\xmlmodule.obj\ 151 $(XML_INTDIR)\xmlsave.obj\ 152 $(XML_INTDIR)\xmlschemas.obj\ 153 $(XML_INTDIR)\xmlschemastypes.obj\ 154 $(XML_INTDIR)\xmlunicode.obj\ 155 $(XML_INTDIR)\xmlwriter.obj\ 156 $(XML_INTDIR)\xpath.obj\ 157 $(XML_INTDIR)\xpointer.obj\ 158 $(XML_INTDIR)\xmlstring.obj 159 160# Static libxml object files. 161XML_OBJS_A = $(XML_INTDIR_A)\buf.obj\ 162 $(XML_INTDIR_A)\c14n.obj\ 163 $(XML_INTDIR_A)\catalog.obj\ 164 $(XML_INTDIR_A)\chvalid.obj\ 165 $(XML_INTDIR_A)\debugXML.obj\ 166 $(XML_INTDIR_A)\dict.obj\ 167 $(XML_INTDIR_A)\DOCBparser.obj\ 168 $(XML_INTDIR_A)\encoding.obj\ 169 $(XML_INTDIR_A)\entities.obj\ 170 $(XML_INTDIR_A)\error.obj\ 171 $(XML_INTDIR_A)\globals.obj\ 172 $(XML_INTDIR_A)\hash.obj\ 173 $(XML_INTDIR_A)\HTMLparser.obj\ 174 $(XML_INTDIR_A)\HTMLtree.obj\ 175 $(XML_INTDIR_A)\legacy.obj\ 176 $(XML_INTDIR_A)\list.obj\ 177 $(XML_INTDIR_A)\nanoftp.obj\ 178 $(XML_INTDIR_A)\nanohttp.obj\ 179 $(XML_INTDIR_A)\parser.obj\ 180 $(XML_INTDIR_A)\parserInternals.obj\ 181 $(XML_INTDIR_A)\pattern.obj\ 182 $(XML_INTDIR_A)\relaxng.obj\ 183 $(XML_INTDIR_A)\SAX2.obj\ 184 $(XML_INTDIR_A)\SAX.obj\ 185 $(XML_INTDIR_A)\schematron.obj\ 186 $(XML_INTDIR_A)\threads.obj\ 187 $(XML_INTDIR_A)\tree.obj\ 188 $(XML_INTDIR_A)\uri.obj\ 189 $(XML_INTDIR_A)\valid.obj\ 190 $(XML_INTDIR_A)\xinclude.obj\ 191 $(XML_INTDIR_A)\xlink.obj\ 192 $(XML_INTDIR_A)\xmlIO.obj\ 193 $(XML_INTDIR_A)\xmlmemory.obj\ 194 $(XML_INTDIR_A)\xmlreader.obj\ 195 $(XML_INTDIR_A)\xmlregexp.obj\ 196 $(XML_INTDIR_A)\xmlmodule.obj\ 197 $(XML_INTDIR_A)\xmlsave.obj\ 198 $(XML_INTDIR_A)\xmlschemas.obj\ 199 $(XML_INTDIR_A)\xmlschemastypes.obj\ 200 $(XML_INTDIR_A)\xmlunicode.obj\ 201 $(XML_INTDIR_A)\xmlwriter.obj\ 202 $(XML_INTDIR_A)\xpath.obj\ 203 $(XML_INTDIR_A)\xpointer.obj\ 204 $(XML_INTDIR_A)\xmlstring.obj 205 206# Static libxml object files. 207XML_OBJS_A_DLL = $(XML_INTDIR_A_DLL)\buf.obj\ 208 $(XML_INTDIR_A_DLL)\c14n.obj\ 209 $(XML_INTDIR_A_DLL)\catalog.obj\ 210 $(XML_INTDIR_A_DLL)\chvalid.obj\ 211 $(XML_INTDIR_A_DLL)\debugXML.obj\ 212 $(XML_INTDIR_A_DLL)\dict.obj\ 213 $(XML_INTDIR_A_DLL)\DOCBparser.obj\ 214 $(XML_INTDIR_A_DLL)\encoding.obj\ 215 $(XML_INTDIR_A_DLL)\entities.obj\ 216 $(XML_INTDIR_A_DLL)\error.obj\ 217 $(XML_INTDIR_A_DLL)\globals.obj\ 218 $(XML_INTDIR_A_DLL)\hash.obj\ 219 $(XML_INTDIR_A_DLL)\HTMLparser.obj\ 220 $(XML_INTDIR_A_DLL)\HTMLtree.obj\ 221 $(XML_INTDIR_A_DLL)\legacy.obj\ 222 $(XML_INTDIR_A_DLL)\list.obj\ 223 $(XML_INTDIR_A_DLL)\nanoftp.obj\ 224 $(XML_INTDIR_A_DLL)\nanohttp.obj\ 225 $(XML_INTDIR_A_DLL)\parser.obj\ 226 $(XML_INTDIR_A_DLL)\parserInternals.obj\ 227 $(XML_INTDIR_A_DLL)\pattern.obj\ 228 $(XML_INTDIR_A_DLL)\relaxng.obj\ 229 $(XML_INTDIR_A_DLL)\SAX2.obj\ 230 $(XML_INTDIR_A_DLL)\SAX.obj\ 231 $(XML_INTDIR_A_DLL)\schematron.obj\ 232 $(XML_INTDIR_A_DLL)\threads.obj\ 233 $(XML_INTDIR_A_DLL)\tree.obj\ 234 $(XML_INTDIR_A_DLL)\uri.obj\ 235 $(XML_INTDIR_A_DLL)\valid.obj\ 236 $(XML_INTDIR_A_DLL)\xinclude.obj\ 237 $(XML_INTDIR_A_DLL)\xlink.obj\ 238 $(XML_INTDIR_A_DLL)\xmlIO.obj\ 239 $(XML_INTDIR_A_DLL)\xmlmemory.obj\ 240 $(XML_INTDIR_A_DLL)\xmlreader.obj\ 241 $(XML_INTDIR_A_DLL)\xmlregexp.obj\ 242 $(XML_INTDIR_A_DLL)\xmlmodule.obj\ 243 $(XML_INTDIR_A_DLL)\xmlsave.obj\ 244 $(XML_INTDIR_A_DLL)\xmlschemas.obj\ 245 $(XML_INTDIR_A_DLL)\xmlschemastypes.obj\ 246 $(XML_INTDIR_A_DLL)\xmlunicode.obj\ 247 $(XML_INTDIR_A_DLL)\xmlwriter.obj\ 248 $(XML_INTDIR_A_DLL)\xpath.obj\ 249 $(XML_INTDIR_A_DLL)\xpointer.obj\ 250 $(XML_INTDIR_A_DLL)\xmlstring.obj 251 252!if "$(WITH_LZMA)" == "1" 253XML_OBJS = $(XML_OBJS) $(XML_INTDIR)\xzlib.obj 254XML_OBJS_A = $(XML_OBJS_A) $(XML_INTDIR_A)\xzlib.obj 255XML_OBJS_A_DLL = $(XML_OBJS_A_DLL) $(XML_INTDIR_A_DLL)\xzlib.obj 256!endif 257 258# Xmllint and friends executables. 259UTILS = $(BINDIR)\xmllint.exe\ 260 $(BINDIR)\xmlcatalog.exe\ 261 $(BINDIR)\testAutomata.exe\ 262 $(BINDIR)\testC14N.exe\ 263 $(BINDIR)\testDocbook.exe\ 264 $(BINDIR)\testHTML.exe\ 265 $(BINDIR)\testReader.exe\ 266 $(BINDIR)\testRelax.exe\ 267 $(BINDIR)\testRegexp.exe\ 268 $(BINDIR)\testModule.exe\ 269 $(BINDIR)\testSAX.exe\ 270 $(BINDIR)\testSchemas.exe\ 271 $(BINDIR)\testURI.exe\ 272 $(BINDIR)\testXPath.exe\ 273 $(BINDIR)\runtest.exe\ 274 $(BINDIR)\runsuite.exe\ 275 $(BINDIR)\runxmlconf.exe\ 276 $(BINDIR)\testapi.exe\ 277 $(BINDIR)\testchar.exe\ 278 $(BINDIR)\testdict.exe\ 279 $(BINDIR)\testlimits.exe\ 280 $(BINDIR)\testrecurse.exe 281 282!if "$(WITH_THREADS)" != "no" 283UTILS = $(UTILS) $(BINDIR)\testThreads.exe 284!endif 285 286!if "$(VCMANIFEST)" == "1" 287_VC_MANIFEST_EMBED_EXE= if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1 288_VC_MANIFEST_EMBED_DLL= if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 289!else 290_VC_MANIFEST_EMBED_EXE= 291_VC_MANIFEST_EMBED_DLL= 292!endif 293 294all : libxml libxmla libxmladll utils 295 296libxml : $(BINDIR)\$(XML_SO) 297 298libxmla : $(BINDIR)\$(XML_A) 299 300libxmladll : $(BINDIR)\$(XML_A_DLL) 301 302utils : $(UTILS) 303 304clean : 305 if exist $(XML_INTDIR) rmdir /S /Q $(XML_INTDIR) 306 if exist $(XML_INTDIR_A) rmdir /S /Q $(XML_INTDIR_A) 307 if exist $(XML_INTDIR_A_DLL) rmdir /S /Q $(XML_INTDIR_A_DLL) 308 if exist $(UTILS_INTDIR) rmdir /S /Q $(UTILS_INTDIR) 309 if exist $(BINDIR) rmdir /S /Q $(BINDIR) 310 311distclean : clean 312 if exist config.* del config.* 313 if exist Makefile del Makefile 314 315rebuild : clean all 316 317install-libs : all 318 if not exist $(INCPREFIX)\libxml2 mkdir $(INCPREFIX)\libxml2 319 if not exist $(INCPREFIX)\libxml2\libxml mkdir $(INCPREFIX)\libxml2\libxml 320 if not exist $(BINPREFIX) mkdir $(BINPREFIX) 321 if not exist $(LIBPREFIX) mkdir $(LIBPREFIX) 322 if not exist $(SOPREFIX) mkdir $(SOPREFIX) 323 copy $(XML_SRCDIR)\include\libxml\*.h $(INCPREFIX)\libxml2\libxml 324 copy $(BINDIR)\$(XML_SO) $(SOPREFIX) 325 copy $(BINDIR)\$(XML_A) $(LIBPREFIX) 326 copy $(BINDIR)\$(XML_A_DLL) $(LIBPREFIX) 327 copy $(BINDIR)\$(XML_IMP) $(LIBPREFIX) 328 329install : install-libs 330 copy $(BINDIR)\*.exe $(BINPREFIX) 331 -copy $(BINDIR)\*.pdb $(BINPREFIX) 332 333install-dist : install-libs 334 copy $(BINDIR)\xml*.exe $(BINPREFIX) 335 -copy $(BINDIR)\xml*.pdb $(BINPREFIX) 336 337# This is a target for me, to make a binary distribution. Not for the public use, 338# keep your hands off :-) 339BDVERSION = $(LIBXML_MAJOR_VERSION).$(LIBXML_MINOR_VERSION).$(LIBXML_MICRO_VERSION) 340BDPREFIX = $(XML_BASENAME)-$(BDVERSION).win32 341bindist : all 342 $(MAKE) /nologo PREFIX=$(BDPREFIX) SOPREFIX=$(BDPREFIX)\bin install-dist 343 cscript //NoLogo configure.js genreadme $(XML_BASENAME) $(BDVERSION) $(BDPREFIX)\readme.txt 344 345 346# Makes the output directory. 347$(BINDIR) : 348 if not exist $(BINDIR) mkdir $(BINDIR) 349 350 351# Makes the libxml intermediate directory. 352$(XML_INTDIR) : 353 if not exist $(XML_INTDIR) mkdir $(XML_INTDIR) 354 355# Makes the static libxml intermediate directory. 356$(XML_INTDIR_A) : 357 if not exist $(XML_INTDIR_A) mkdir $(XML_INTDIR_A) 358 359# Makes the static for dll libxml intermediate directory. 360$(XML_INTDIR_A_DLL) : 361 if not exist $(XML_INTDIR_A_DLL) mkdir $(XML_INTDIR_A_DLL) 362 363# An implicit rule for libxml compilation. 364{$(XML_SRCDIR)}.c{$(XML_INTDIR)}.obj:: 365 $(CC) $(CFLAGS) /Fo$(XML_INTDIR)\ /c $< 366 367# An implicit rule for static libxml compilation. 368{$(XML_SRCDIR)}.c{$(XML_INTDIR_A)}.obj:: 369 $(CC) $(CFLAGS) /D "LIBXML_STATIC" /Fo$(XML_INTDIR_A)\ /c $< 370 371# An implicit rule for static for dll libxml compilation. 372{$(XML_SRCDIR)}.c{$(XML_INTDIR_A_DLL)}.obj:: 373 $(CC) $(CFLAGS) /D "LIBXML_STATIC" /D "LIBXML_STATIC_FOR_DLL" /Fo$(XML_INTDIR_A_DLL)\ /c $< 374 375# Compiles libxml source. Uses the implicit rule for commands. 376$(XML_OBJS) : $(XML_INTDIR) 377 378# Compiles static libxml source. Uses the implicit rule for commands. 379$(XML_OBJS_A) : $(XML_INTDIR_A) 380 381# Compiles static for dll libxml source. Uses the implicit rule for commands. 382$(XML_OBJS_A_DLL) : $(XML_INTDIR_A_DLL) 383 384# Creates the export definition file (DEF) for libxml. 385$(XML_INTDIR)\$(XML_DEF) : $(XML_INTDIR) $(XML_DEF).src 386 $(CPP) $(CPPFLAGS) $(XML_DEF).src > $(XML_INTDIR)\$(XML_DEF) 387$(XML_INTDIR)\$(XML_RES) : $(XML_INTDIR) libxml2.rc 388 rc -Fo $(XML_INTDIR)\$(XML_RES) libxml2.rc 389 390# Creates the libxml shared object. 391$(BINDIR)\$(XML_SO) : $(BINDIR) $(XML_OBJS) $(XML_INTDIR)\$(XML_DEF) $(XML_INTDIR)\$(XML_RES) 392 $(LD) $(LDFLAGS) /DLL \ 393 /IMPLIB:$(BINDIR)\$(XML_IMP) /OUT:$(BINDIR)\$(XML_SO) $(XML_OBJS) $(XML_INTDIR)\$(XML_RES) $(LIBS) 394 @$(_VC_MANIFEST_EMBED_DLL) 395 396#$(BINDIR)\$(XML_SO) : $(BINDIR) $(XML_OBJS) $(XML_INTDIR)\$(XML_DEF) 397# $(LD) $(LDFLAGS) /DLL /DEF:$(XML_INTDIR)\$(XML_DEF) \ 398# /IMPLIB:$(BINDIR)\$(XML_IMP) /OUT:$(BINDIR)\$(XML_SO) $(XML_OBJS) $(LIBS) 399 400# Creates the libxml archive. 401$(BINDIR)\$(XML_A) : $(BINDIR) $(XML_OBJS_A) 402 $(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(XML_A) $(XML_OBJS_A) 403 404# Creates the libxml static for dll archive. 405$(BINDIR)\$(XML_A_DLL) : $(BINDIR) $(XML_OBJS_A_DLL) 406 $(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(XML_A_DLL) $(XML_OBJS_A_DLL) 407 408# Makes the utils intermediate directory. 409$(UTILS_INTDIR) : 410 if not exist $(UTILS_INTDIR) mkdir $(UTILS_INTDIR) 411 412# An implicit rule for xmllint and friends. 413!if "$(STATIC)" == "1" 414{$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe: 415 $(CC) /D "LIBXML_STATIC" $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $< 416 $(LD) $(LDFLAGS) /OUT:$@ $(XML_A) $(LIBS) $(UTILS_INTDIR)\$(<B).obj 417 @$(_VC_MANIFEST_EMBED_EXE) 418!else 419{$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe: 420 $(CC) $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $< 421 $(LD) $(LDFLAGS) /OUT:$@ $(XML_IMP) $(LIBS) $(UTILS_INTDIR)\$(<B).obj 422 @$(_VC_MANIFEST_EMBED_EXE) 423!endif 424 425# Builds xmllint and friends. Uses the implicit rule for commands. 426$(UTILS) : $(UTILS_INTDIR) $(BINDIR) libxml libxmla libxmladll 427 428# Source dependences should be autogenerated somehow here, but how to 429# do it? I have no clue. 430 431# TESTS 432 433tests : checktests XPathtests 434 435checktests : $(UTILS) 436 cd .. && win32\$(BINDIR)\runtest.exe 437 cd .. && win32\$(BINDIR)\testrecurse.exe 438 cd .. && win32\$(BINDIR)\testapi.exe 439 cd .. && win32\$(BINDIR)\testchar.exe 440 cd .. && win32\$(BINDIR)\testdict.exe 441 cd .. && win32\$(BINDIR)\runxmlconf.exe 442 443XPathtests : $(BINDIR)\testXPath.exe 444 @echo. 2> .memdump 445 @echo ## XPath regression tests 446 @-$(BINDIR)\testXPath.exe | find /C "support not compiled in" 1>nul 447 @if %ERRORLEVEL% NEQ 0 @( \ 448 echo Skipping debug not compiled in\ 449 @exit 0 \ 450 ) 451 @for %%I in ($(XML_SRCDIR)\test\XPath\expr\*.*) do @( \ 452 @IF NOT EXIST $(XML_SRCDIR)\result\XPath\expr\%%~nxI ( \ 453 @echo New test %%~nxI &&\ 454 @echo %%~nxI &&\ 455 $(BINDIR)\testXPath.exe -f --expr %%I > $(XML_SRCDIR)/result/XPath/expr/%%~nxI &&\ 456 findstr /C:"MEMORY ALLOCATED : 0" \ 457 ) ELSE ( \ 458 $(BINDIR)\testXPath.exe -f --expr %%I 2>&1 > result.%%~nxI &&\ 459 fc $(XML_SRCDIR)\result\XPath\expr\%%~nxI result.%%~nxI >nul &\ 460 iF ERRORLEVEL 1 exit 1 & \ 461 findstr "MEMORY ALLOCATED" .memdump | findstr /C:"MEMORY ALLOCATED : 0" >nul &&\ 462 del result.%%~nxI \ 463 ) \ 464 ) 465 @for %%I in ($(XML_SRCDIR)\test\XPath\docs\*.*) do @( \ 466 for %%J in ($(XML_SRCDIR)\test\XPath\tests\%%~nxI*.*) do @( \ 467 if not exist $(XML_SRCDIR)\result\XPath\tests\%%~nxJ ( \ 468 $(BINDIR)\testXPath.exe -f -i %%I %%J > $(XML_SRCDIR)\result\XPath\tests\%%~nxJ &&\ 469 findstr /C:"MEMORY ALLOCATED" .memdump | findstr /C:"MEMORY ALLOCATED : 0" > nul \ 470 ) ELSE ( \ 471 $(BINDIR)\testXPAth.exe -f -i %%I %%J 2>&1 > result.%%~nxJ &&\ 472 findstr /C:"MEMORY ALLOCATED" .memdump | findstr /C:"MEMORY ALLOCATED : 0">null &&\ 473 fc $(XML_SRCDIR)\result\XPath\tests\%%~nxJ result.%%~nxJ >null & \ 474 IF ERRORLEVEL 1 (echo Error: %%I %%J & exit 1) & \ 475 del result.%%~nxJ \ 476 )\ 477 )\ 478 ) 479 480XMLtests : $(BINDIR)\xmllint.exe 481 @echo. 2> .memdump 482 @echo ## XML regression tests 483 -@for %%I in ($(XML_SRCDIR)\test\*) do @( \ 484 if not exist $(XML_SRCDIR)\result\%%~nxI ( \ 485 echo New test file %%~nxI &\ 486 $(BINDIR)\xmllint.exe %%I > $(XML_SRCDIR)\result\%%~nxI && \ 487 findstr /C:"MEMORY ALLOCATED" .memdump | findstr /C:"MEMORY ALLOCATED : 0" > null \ 488 ) ELSE ( \ 489 $(BINDIR)\xmllint.exe %%I 2>&1 > result.%%~nxI && \ 490 findstr /C:"MEMORY ALLOC" .memdump | findstr /C:"MEMORY ALLOCATED : 0" > null && \ 491 fc $(XML_SRCDIR)\result\%%~nxI result.%%~nxI > null && \ 492 $(BINDIR)\xmllint.exe result.%%~nxI 2>&1 > result2.%%~nxI | findstr /V /C:"failed to load external entity" && \ 493 fc result.%%~nxI result2.%%~nxI & \ 494 del result.%%~nxI result2.%%~nxI\ 495 ) \ 496 ) 497 498 499 500 501 502 503