Makefile.msvc 15 KB

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