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