Blame win32/Makefile.msvc

Packit Service a31ea6
# Makefile for libxml2, specific for Windows, MSVC and NMAKE.
Packit Service a31ea6
#
Packit Service a31ea6
# Take a look at the beginning and modify the variables to suit your 
Packit Service a31ea6
# environment. Having done that, you can do a
Packit Service a31ea6
#
Packit Service a31ea6
# nmake [all]     to build the libxml and the accompanying utilities.
Packit Service a31ea6
# nmake clean     to remove all compiler output files and return to a
Packit Service a31ea6
#                 clean state.
Packit Service a31ea6
# nmake rebuild   to rebuild everything from scratch. This basically does
Packit Service a31ea6
#                 a 'nmake clean' and then a 'nmake all'.
Packit Service a31ea6
# nmake install   to install the library and its header files.
Packit Service a31ea6
#
Packit Service a31ea6
# March 2002, Igor Zlatkovic <igor@zlatkovic.com>
Packit Service a31ea6
Packit Service a31ea6
# There should never be a need to modify anything below this line.
Packit Service a31ea6
# ----------------------------------------------------------------
Packit Service a31ea6
Packit Service a31ea6
AUTOCONF = .\config.msvc
Packit Service a31ea6
!include $(AUTOCONF)
Packit Service a31ea6
Packit Service a31ea6
# Names of various input and output components.
Packit Service a31ea6
XML_NAME = xml2
Packit Service a31ea6
XML_BASENAME = lib$(XML_NAME)
Packit Service a31ea6
XML_SO = $(XML_BASENAME).dll
Packit Service a31ea6
XML_IMP = $(XML_BASENAME).lib
Packit Service a31ea6
XML_DEF = $(XML_BASENAME).def
Packit Service a31ea6
XML_A = $(XML_BASENAME)_a.lib
Packit Service a31ea6
XML_A_DLL = $(XML_BASENAME)_a_dll.lib
Packit Service a31ea6
Packit Service a31ea6
# Place where we let the compiler put its output.
Packit Service a31ea6
BINDIR = bin.msvc
Packit Service a31ea6
XML_INTDIR = int.msvc
Packit Service a31ea6
XML_INTDIR_A = int.a.msvc
Packit Service a31ea6
XML_INTDIR_A_DLL = int.a.dll.msvc
Packit Service a31ea6
UTILS_INTDIR = int.utils.msvc
Packit Service a31ea6
Packit Service a31ea6
# The preprocessor and its options.
Packit Service a31ea6
CPP = cl.exe /EP
Packit Service a31ea6
CPPFLAGS = /nologo /I$(XML_SRCDIR)\include /D "NOLIBTOOL" 
Packit Service a31ea6
!if "$(WITH_THREADS)" != "no"
Packit Service a31ea6
CPPFLAGS = $(CPPFLAGS) /D "_REENTRANT"
Packit Service a31ea6
!endif
Packit Service a31ea6
Packit Service a31ea6
# The compiler and its options.
Packit Service a31ea6
CC = cl.exe
Packit Service a31ea6
CFLAGS = /nologo /D "_WINDOWS" /D "_MBCS" /D "NOLIBTOOL" /W3 /wd4244 /wd4267 $(CRUNTIME)
Packit Service a31ea6
CFLAGS = $(CFLAGS) /I$(XML_SRCDIR) /I$(XML_SRCDIR)\include /I$(INCPREFIX)
Packit Service a31ea6
!if "$(WITH_THREADS)" != "no"
Packit Service a31ea6
CFLAGS = $(CFLAGS) /D "_REENTRANT"
Packit Service a31ea6
!endif
Packit Service a31ea6
!if "$(WITH_THREADS)" == "yes" || "$(WITH_THREADS)" == "ctls"
Packit Service a31ea6
CFLAGS = $(CFLAGS) /D "HAVE_WIN32_THREADS" /D "HAVE_COMPILER_TLS"
Packit Service a31ea6
!else if "$(WITH_THREADS)" == "native"
Packit Service a31ea6
CFLAGS = $(CFLAGS) /D "HAVE_WIN32_THREADS"
Packit Service a31ea6
!else if "$(WITH_THREADS)" == "posix"
Packit Service a31ea6
CFLAGS = $(CFLAGS) /D "HAVE_PTHREAD_H"
Packit Service a31ea6
!endif
Packit Service a31ea6
!if "$(WITH_ZLIB)" == "1"
Packit Service a31ea6
CFLAGS = $(CFLAGS) /D "HAVE_ZLIB_H"
Packit Service a31ea6
!endif
Packit Service a31ea6
!if "$(WITH_LZMA)" == "1"
Packit Service a31ea6
CFLAGS = $(CFLAGS) /D "HAVE_LZMA_H"
Packit Service a31ea6
!endif
Packit Service a31ea6
CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
Packit Service a31ea6
Packit Service a31ea6
# The linker and its options.
Packit Service a31ea6
LD = link.exe
Packit Service a31ea6
LDFLAGS = /nologo /VERSION:$(LIBXML_MAJOR_VERSION).$(LIBXML_MINOR_VERSION)
Packit Service a31ea6
LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR) /LIBPATH:$(LIBPREFIX)
Packit Service a31ea6
LIBS =
Packit Service a31ea6
!if "$(WITH_FTP)" == "1" || "$(WITH_HTTP)" == "1"
Packit Service a31ea6
LIBS = $(LIBS) wsock32.lib ws2_32.lib
Packit Service a31ea6
!endif 
Packit Service a31ea6
!if "$(WITH_ICONV)" == "1"
Packit Service a31ea6
LIBS = $(LIBS) iconv.lib
Packit Service a31ea6
!endif 
Packit Service a31ea6
!if "$(WITH_ICU)" == "1"
Packit Service a31ea6
LIBS = $(LIBS) icu.lib
Packit Service a31ea6
!endif
Packit Service a31ea6
!if "$(WITH_ZLIB)" == "1"
Packit Service a31ea6
# could be named differently zdll or zlib
Packit Service a31ea6
# LIBS = $(LIBS) zdll.lib
Packit Service a31ea6
LIBS = $(LIBS) zlib.lib
Packit Service a31ea6
!endif
Packit Service a31ea6
!if "$(WITH_LZMA)" == "1"
Packit Service a31ea6
LIBS = $(LIBS) liblzma.lib
Packit Service a31ea6
!endif
Packit Service a31ea6
!if "$(WITH_THREADS)" == "posix"
Packit Service a31ea6
LIBS = $(LIBS) pthreadVC.lib
Packit Service a31ea6
!endif
Packit Service a31ea6
!if "$(WITH_MODULES)" == "1"
Packit Service a31ea6
LIBS = $(LIBS) kernel32.lib
Packit Service a31ea6
!endif
Packit Service a31ea6
Packit Service a31ea6
# The archiver and its options.
Packit Service a31ea6
AR = lib.exe
Packit Service a31ea6
ARFLAGS = /nologo
Packit Service a31ea6
Packit Service a31ea6
# Optimisation and debug symbols.
Packit Service a31ea6
!if "$(DEBUG)" == "1"
Packit Service a31ea6
CFLAGS = $(CFLAGS) /D "_DEBUG" /Od /Z7
Packit Service a31ea6
LDFLAGS = $(LDFLAGS) /DEBUG
Packit Service a31ea6
!else
Packit Service a31ea6
CFLAGS = $(CFLAGS) /D "NDEBUG" /O2 
Packit Service a31ea6
# commented out as this break VC10 c.f. 634846
Packit Service a31ea6
# LDFLAGS = $(LDFLAGS) /OPT:NOWIN98
Packit Service a31ea6
LDFLAGS = $(LDFLAGS)
Packit Service a31ea6
!endif
Packit Service a31ea6
Packit Service a31ea6
# Libxml object files.
Packit Service a31ea6
XML_OBJS = $(XML_INTDIR)\buf.obj\
Packit Service a31ea6
	$(XML_INTDIR)\c14n.obj\
Packit Service a31ea6
	$(XML_INTDIR)\catalog.obj\
Packit Service a31ea6
	$(XML_INTDIR)\chvalid.obj\
Packit Service a31ea6
	$(XML_INTDIR)\debugXML.obj\
Packit Service a31ea6
	$(XML_INTDIR)\dict.obj\
Packit Service a31ea6
	$(XML_INTDIR)\DOCBparser.obj\
Packit Service a31ea6
	$(XML_INTDIR)\encoding.obj\
Packit Service a31ea6
	$(XML_INTDIR)\entities.obj\
Packit Service a31ea6
	$(XML_INTDIR)\error.obj\
Packit Service a31ea6
	$(XML_INTDIR)\globals.obj\
Packit Service a31ea6
	$(XML_INTDIR)\hash.obj\
Packit Service a31ea6
	$(XML_INTDIR)\HTMLparser.obj\
Packit Service a31ea6
	$(XML_INTDIR)\HTMLtree.obj\
Packit Service a31ea6
	$(XML_INTDIR)\legacy.obj\
Packit Service a31ea6
	$(XML_INTDIR)\list.obj\
Packit Service a31ea6
	$(XML_INTDIR)\nanoftp.obj\
Packit Service a31ea6
	$(XML_INTDIR)\nanohttp.obj\
Packit Service a31ea6
	$(XML_INTDIR)\parser.obj\
Packit Service a31ea6
	$(XML_INTDIR)\parserInternals.obj\
Packit Service a31ea6
	$(XML_INTDIR)\pattern.obj\
Packit Service a31ea6
	$(XML_INTDIR)\relaxng.obj\
Packit Service a31ea6
	$(XML_INTDIR)\SAX2.obj\
Packit Service a31ea6
	$(XML_INTDIR)\SAX.obj\
Packit Service a31ea6
	$(XML_INTDIR)\schematron.obj\
Packit Service a31ea6
	$(XML_INTDIR)\threads.obj\
Packit Service a31ea6
	$(XML_INTDIR)\tree.obj\
Packit Service a31ea6
	$(XML_INTDIR)\uri.obj\
Packit Service a31ea6
	$(XML_INTDIR)\valid.obj\
Packit Service a31ea6
	$(XML_INTDIR)\xinclude.obj\
Packit Service a31ea6
	$(XML_INTDIR)\xlink.obj\
Packit Service a31ea6
	$(XML_INTDIR)\xmlIO.obj\
Packit Service a31ea6
	$(XML_INTDIR)\xmlmemory.obj\
Packit Service a31ea6
	$(XML_INTDIR)\xmlreader.obj\
Packit Service a31ea6
	$(XML_INTDIR)\xmlregexp.obj\
Packit Service a31ea6
	$(XML_INTDIR)\xmlmodule.obj\
Packit Service a31ea6
	$(XML_INTDIR)\xmlsave.obj\
Packit Service a31ea6
	$(XML_INTDIR)\xmlschemas.obj\
Packit Service a31ea6
	$(XML_INTDIR)\xmlschemastypes.obj\
Packit Service a31ea6
	$(XML_INTDIR)\xmlunicode.obj\
Packit Service a31ea6
	$(XML_INTDIR)\xmlwriter.obj\
Packit Service a31ea6
	$(XML_INTDIR)\xpath.obj\
Packit Service a31ea6
	$(XML_INTDIR)\xpointer.obj\
Packit Service a31ea6
	$(XML_INTDIR)\xmlstring.obj
Packit Service a31ea6
Packit Service a31ea6
# Static libxml object files.
Packit Service a31ea6
XML_OBJS_A = $(XML_INTDIR_A)\buf.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\c14n.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\catalog.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\chvalid.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\debugXML.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\dict.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\DOCBparser.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\encoding.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\entities.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\error.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\globals.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\hash.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\HTMLparser.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\HTMLtree.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\legacy.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\list.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\nanoftp.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\nanohttp.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\parser.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\parserInternals.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\pattern.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\relaxng.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\SAX2.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\SAX.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\schematron.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\threads.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\tree.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\uri.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\valid.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\xinclude.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\xlink.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\xmlIO.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\xmlmemory.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\xmlreader.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\xmlregexp.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\xmlmodule.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\xmlsave.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\xmlschemas.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\xmlschemastypes.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\xmlunicode.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\xmlwriter.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\xpath.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\xpointer.obj\
Packit Service a31ea6
	$(XML_INTDIR_A)\xmlstring.obj
Packit Service a31ea6
Packit Service a31ea6
# Static libxml object files.
Packit Service a31ea6
XML_OBJS_A_DLL = $(XML_INTDIR_A_DLL)\buf.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\c14n.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\catalog.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\chvalid.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\debugXML.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\dict.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\DOCBparser.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\encoding.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\entities.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\error.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\globals.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\hash.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\HTMLparser.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\HTMLtree.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\legacy.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\list.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\nanoftp.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\nanohttp.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\parser.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\parserInternals.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\pattern.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\relaxng.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\SAX2.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\SAX.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\schematron.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\threads.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\tree.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\uri.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\valid.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\xinclude.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\xlink.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\xmlIO.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\xmlmemory.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\xmlreader.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\xmlregexp.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\xmlmodule.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\xmlsave.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\xmlschemas.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\xmlschemastypes.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\xmlunicode.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\xmlwriter.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\xpath.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\xpointer.obj\
Packit Service a31ea6
	$(XML_INTDIR_A_DLL)\xmlstring.obj
Packit Service a31ea6
Packit Service a31ea6
# Xmllint and friends executables.
Packit Service a31ea6
UTILS = $(BINDIR)\xmllint.exe\
Packit Service a31ea6
	$(BINDIR)\xmlcatalog.exe\
Packit Service a31ea6
	$(BINDIR)\testAutomata.exe\
Packit Service a31ea6
	$(BINDIR)\testC14N.exe\
Packit Service a31ea6
	$(BINDIR)\testDocbook.exe\
Packit Service a31ea6
	$(BINDIR)\testHTML.exe\
Packit Service a31ea6
	$(BINDIR)\testReader.exe\
Packit Service a31ea6
	$(BINDIR)\testRelax.exe\
Packit Service a31ea6
	$(BINDIR)\testRegexp.exe\
Packit Service a31ea6
	$(BINDIR)\testModule.exe\
Packit Service a31ea6
	$(BINDIR)\testSAX.exe\
Packit Service a31ea6
	$(BINDIR)\testSchemas.exe\
Packit Service a31ea6
	$(BINDIR)\testURI.exe\
Packit Service a31ea6
	$(BINDIR)\testXPath.exe\
Packit Service a31ea6
	$(BINDIR)\runtest.exe\
Packit Service a31ea6
	$(BINDIR)\runsuite.exe\
Packit Service a31ea6
	$(BINDIR)\testapi.exe\
Packit Service a31ea6
	$(BINDIR)\testlimits.exe\
Packit Service a31ea6
	$(BINDIR)\testrecurse.exe
Packit Service a31ea6
	
Packit Service a31ea6
!if "$(WITH_THREADS)" == "yes" || "$(WITH_THREADS)" == "ctls" || "$(WITH_THREADS)" == "native"
Packit Service a31ea6
UTILS = $(UTILS) $(BINDIR)\testThreadsWin32.exe
Packit Service a31ea6
!else if "$(WITH_THREADS)" == "posix"
Packit Service a31ea6
UTILS = $(UTILS) $(BINDIR)\testThreads.exe
Packit Service a31ea6
!endif
Packit Service a31ea6
Packit Service a31ea6
!if "$(VCMANIFEST)" == "1"
Packit Service a31ea6
_VC_MANIFEST_EMBED_EXE= if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
Packit Service a31ea6
_VC_MANIFEST_EMBED_DLL= if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
Packit Service a31ea6
!else
Packit Service a31ea6
_VC_MANIFEST_EMBED_EXE=
Packit Service a31ea6
_VC_MANIFEST_EMBED_DLL=
Packit Service a31ea6
!endif
Packit Service a31ea6
Packit Service a31ea6
all : libxml libxmla libxmladll utils
Packit Service a31ea6
Packit Service a31ea6
libxml : $(BINDIR)\$(XML_SO) 
Packit Service a31ea6
Packit Service a31ea6
libxmla : $(BINDIR)\$(XML_A)
Packit Service a31ea6
Packit Service a31ea6
libxmladll : $(BINDIR)\$(XML_A_DLL)
Packit Service a31ea6
Packit Service a31ea6
utils : $(UTILS)
Packit Service a31ea6
Packit Service a31ea6
clean :
Packit Service a31ea6
	if exist $(XML_INTDIR) rmdir /S /Q $(XML_INTDIR)
Packit Service a31ea6
	if exist $(XML_INTDIR_A) rmdir /S /Q $(XML_INTDIR_A)
Packit Service a31ea6
	if exist $(XML_INTDIR_A_DLL) rmdir /S /Q $(XML_INTDIR_A_DLL)
Packit Service a31ea6
	if exist $(UTILS_INTDIR) rmdir /S /Q $(UTILS_INTDIR)
Packit Service a31ea6
	if exist $(BINDIR) rmdir /S /Q $(BINDIR)
Packit Service a31ea6
Packit Service a31ea6
distclean : clean
Packit Service a31ea6
	if exist config.* del config.*
Packit Service a31ea6
	if exist Makefile del Makefile
Packit Service a31ea6
Packit Service a31ea6
rebuild : clean all
Packit Service a31ea6
Packit Service a31ea6
install-libs : all
Packit Service a31ea6
	if not exist $(INCPREFIX)\libxml2 mkdir $(INCPREFIX)\libxml2
Packit Service a31ea6
	if not exist $(INCPREFIX)\libxml2\libxml mkdir $(INCPREFIX)\libxml2\libxml
Packit Service a31ea6
	if not exist $(BINPREFIX) mkdir $(BINPREFIX)
Packit Service a31ea6
	if not exist $(LIBPREFIX) mkdir $(LIBPREFIX)
Packit Service a31ea6
	if not exist $(SOPREFIX) mkdir $(SOPREFIX)
Packit Service a31ea6
	copy $(XML_SRCDIR)\include\libxml\*.h $(INCPREFIX)\libxml2\libxml
Packit Service a31ea6
	copy $(BINDIR)\$(XML_SO) $(SOPREFIX)
Packit Service a31ea6
	copy $(BINDIR)\$(XML_A) $(LIBPREFIX)
Packit Service a31ea6
	copy $(BINDIR)\$(XML_A_DLL) $(LIBPREFIX)
Packit Service a31ea6
	copy $(BINDIR)\$(XML_IMP) $(LIBPREFIX)
Packit Service a31ea6
Packit Service a31ea6
install : install-libs 
Packit Service a31ea6
	copy $(BINDIR)\*.exe $(BINPREFIX)
Packit Service a31ea6
	-copy $(BINDIR)\*.pdb $(BINPREFIX)
Packit Service a31ea6
Packit Service a31ea6
install-dist : install-libs 
Packit Service a31ea6
	copy $(BINDIR)\xml*.exe $(BINPREFIX)
Packit Service a31ea6
	-copy $(BINDIR)\xml*.pdb $(BINPREFIX)
Packit Service a31ea6
Packit Service a31ea6
# This is a target for me, to make a binary distribution. Not for the public use,
Packit Service a31ea6
# keep your hands off :-)
Packit Service a31ea6
BDVERSION = $(LIBXML_MAJOR_VERSION).$(LIBXML_MINOR_VERSION).$(LIBXML_MICRO_VERSION)
Packit Service a31ea6
BDPREFIX = $(XML_BASENAME)-$(BDVERSION).win32
Packit Service a31ea6
bindist : all
Packit Service a31ea6
	$(MAKE) /nologo PREFIX=$(BDPREFIX) SOPREFIX=$(BDPREFIX)\bin install-dist
Packit Service a31ea6
	cscript //NoLogo configure.js genreadme $(XML_BASENAME) $(BDVERSION) $(BDPREFIX)\readme.txt
Packit Service a31ea6
Packit Service a31ea6
Packit Service a31ea6
# Makes the output directory.
Packit Service a31ea6
$(BINDIR) :
Packit Service a31ea6
	if not exist $(BINDIR) mkdir $(BINDIR)
Packit Service a31ea6
Packit Service a31ea6
Packit Service a31ea6
# Makes the libxml intermediate directory.
Packit Service a31ea6
$(XML_INTDIR) :
Packit Service a31ea6
	if not exist $(XML_INTDIR) mkdir $(XML_INTDIR)
Packit Service a31ea6
Packit Service a31ea6
# Makes the static libxml intermediate directory.
Packit Service a31ea6
$(XML_INTDIR_A) :
Packit Service a31ea6
	if not exist $(XML_INTDIR_A) mkdir $(XML_INTDIR_A)
Packit Service a31ea6
Packit Service a31ea6
# Makes the static for dll libxml intermediate directory.
Packit Service a31ea6
$(XML_INTDIR_A_DLL) :
Packit Service a31ea6
	if not exist $(XML_INTDIR_A_DLL) mkdir $(XML_INTDIR_A_DLL)
Packit Service a31ea6
Packit Service a31ea6
# An implicit rule for libxml compilation.
Packit Service a31ea6
{$(XML_SRCDIR)}.c{$(XML_INTDIR)}.obj::
Packit Service a31ea6
	$(CC) $(CFLAGS) /Fo$(XML_INTDIR)\ /c $<
Packit Service a31ea6
Packit Service a31ea6
# An implicit rule for static libxml compilation.
Packit Service a31ea6
{$(XML_SRCDIR)}.c{$(XML_INTDIR_A)}.obj::
Packit Service a31ea6
	$(CC) $(CFLAGS) /D "LIBXML_STATIC" /Fo$(XML_INTDIR_A)\ /c $<
Packit Service a31ea6
Packit Service a31ea6
# An implicit rule for static for dll libxml compilation.
Packit Service a31ea6
{$(XML_SRCDIR)}.c{$(XML_INTDIR_A_DLL)}.obj::
Packit Service a31ea6
	$(CC) $(CFLAGS) /D "LIBXML_STATIC" /D "LIBXML_STATIC_FOR_DLL" /Fo$(XML_INTDIR_A_DLL)\ /c $<
Packit Service a31ea6
Packit Service a31ea6
# Compiles libxml source. Uses the implicit rule for commands.
Packit Service a31ea6
$(XML_OBJS) : $(XML_INTDIR) 
Packit Service a31ea6
Packit Service a31ea6
# Compiles static libxml source. Uses the implicit rule for commands.
Packit Service a31ea6
$(XML_OBJS_A) : $(XML_INTDIR_A) 
Packit Service a31ea6
Packit Service a31ea6
# Compiles static for dll libxml source. Uses the implicit rule for commands.
Packit Service a31ea6
$(XML_OBJS_A_DLL) : $(XML_INTDIR_A_DLL) 
Packit Service a31ea6
Packit Service a31ea6
# Creates the export definition file (DEF) for libxml.
Packit Service a31ea6
$(XML_INTDIR)\$(XML_DEF) : $(XML_INTDIR) $(XML_DEF).src
Packit Service a31ea6
	$(CPP) $(CPPFLAGS) $(XML_DEF).src > $(XML_INTDIR)\$(XML_DEF)
Packit Service a31ea6
Packit Service a31ea6
# Creates the libxml shared object.
Packit Service a31ea6
$(BINDIR)\$(XML_SO) : $(BINDIR) $(XML_OBJS) $(XML_INTDIR)\$(XML_DEF)
Packit Service a31ea6
	$(LD) $(LDFLAGS) /DLL \
Packit Service a31ea6
		/IMPLIB:$(BINDIR)\$(XML_IMP) /OUT:$(BINDIR)\$(XML_SO) $(XML_OBJS) $(LIBS)
Packit Service a31ea6
	@$(_VC_MANIFEST_EMBED_DLL)
Packit Service a31ea6
Packit Service a31ea6
#$(BINDIR)\$(XML_SO) : $(BINDIR) $(XML_OBJS) $(XML_INTDIR)\$(XML_DEF)
Packit Service a31ea6
#	$(LD) $(LDFLAGS) /DLL /DEF:$(XML_INTDIR)\$(XML_DEF) \
Packit Service a31ea6
#		/IMPLIB:$(BINDIR)\$(XML_IMP) /OUT:$(BINDIR)\$(XML_SO) $(XML_OBJS) $(LIBS)
Packit Service a31ea6
Packit Service a31ea6
# Creates the libxml archive.
Packit Service a31ea6
$(BINDIR)\$(XML_A) : $(BINDIR) $(XML_OBJS_A)
Packit Service a31ea6
	$(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(XML_A) $(XML_OBJS_A)
Packit Service a31ea6
Packit Service a31ea6
# Creates the libxml static for dll archive.
Packit Service a31ea6
$(BINDIR)\$(XML_A_DLL) : $(BINDIR) $(XML_OBJS_A_DLL)
Packit Service a31ea6
	$(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(XML_A_DLL) $(XML_OBJS_A_DLL)
Packit Service a31ea6
Packit Service a31ea6
# Makes the utils intermediate directory.
Packit Service a31ea6
$(UTILS_INTDIR) :
Packit Service a31ea6
	if not exist $(UTILS_INTDIR) mkdir $(UTILS_INTDIR)
Packit Service a31ea6
Packit Service a31ea6
# An implicit rule for xmllint and friends.
Packit Service a31ea6
!if "$(STATIC)" == "1"
Packit Service a31ea6
{$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe:
Packit Service a31ea6
	$(CC) /D "LIBXML_STATIC" $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $< 
Packit Service a31ea6
	$(LD) $(LDFLAGS) /OUT:$@ $(XML_A) $(LIBS) $(UTILS_INTDIR)\$(
Packit Service a31ea6
	@$(_VC_MANIFEST_EMBED_EXE)
Packit Service a31ea6
!else
Packit Service a31ea6
{$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe:
Packit Service a31ea6
	$(CC) $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $< 
Packit Service a31ea6
	$(LD) $(LDFLAGS) /OUT:$@ $(XML_IMP) $(LIBS) $(UTILS_INTDIR)\$(
Packit Service a31ea6
	@$(_VC_MANIFEST_EMBED_EXE)
Packit Service a31ea6
!endif
Packit Service a31ea6
Packit Service a31ea6
# Builds xmllint and friends. Uses the implicit rule for commands.
Packit Service a31ea6
$(UTILS) : $(UTILS_INTDIR) $(BINDIR) libxml libxmla libxmladll
Packit Service a31ea6
Packit Service a31ea6
# Source dependences should be autogenerated somehow here, but how to
Packit Service a31ea6
# do it? I have no clue.
Packit Service a31ea6
Packit Service a31ea6
# TESTS
Packit Service a31ea6
Packit Service a31ea6
tests : checktests XPathtests
Packit Service a31ea6
Packit Service a31ea6
checktests : $(UTILS)
Packit Service a31ea6
	cd .. && win32\$(BINDIR)\runtest.exe
Packit Service a31ea6
	cd .. && win32\$(BINDIR)\testrecurse.exe
Packit Service a31ea6
	cd .. && win32\$(BINDIR)\testapi.exe
Packit Service a31ea6
	cd .. && win32\$(BINDIR)\testchar.exe
Packit Service a31ea6
	cd .. && win32\$(BINDIR)\testdict.exe
Packit Service a31ea6
	cd .. && win32\$(BINDIR)\runxmlconf.exe
Packit Service a31ea6
Packit Service a31ea6
XPathtests : $(BINDIR)\testXPath.exe
Packit Service a31ea6
	@echo. 2> .memdump
Packit Service a31ea6
	@echo ## XPath regression tests
Packit Service a31ea6
	@-$(BINDIR)\testXPath.exe | find /C "support not compiled in" 1>nul
Packit Service a31ea6
	@if %ERRORLEVEL% NEQ 0 @( \
Packit Service a31ea6
		echo Skipping debug not compiled in\
Packit Service a31ea6
		@exit 0 \
Packit Service a31ea6
	)
Packit Service a31ea6
	@for %%I in ($(XML_SRCDIR)\test\XPath\expr\*.*) do @( \
Packit Service a31ea6
		@IF NOT EXIST $(XML_SRCDIR)\result\XPath\expr\%%~nxI ( \
Packit Service a31ea6
			@echo New test %%~nxI &&\
Packit Service a31ea6
			@echo %%~nxI &&\
Packit Service a31ea6
			$(BINDIR)\testXPath.exe -f --expr %%I > $(XML_SRCDIR)/result/XPath/expr/%%~nxI &&\
Packit Service a31ea6
			findstr /C:"MEMORY ALLOCATED : 0" \
Packit Service a31ea6
		) ELSE ( \
Packit Service a31ea6
			$(BINDIR)\testXPath.exe -f --expr %%I 2>&1 > result.%%~nxI &&\
Packit Service a31ea6
			fc $(XML_SRCDIR)\result\XPath\expr\%%~nxI result.%%~nxI >nul &\
Packit Service a31ea6
			iF ERRORLEVEL 1 exit 1 & \
Packit Service a31ea6
			findstr "MEMORY ALLOCATED" .memdump | findstr /C:"MEMORY ALLOCATED : 0" >nul &&\
Packit Service a31ea6
			del result.%%~nxI \
Packit Service a31ea6
		) \
Packit Service a31ea6
	)
Packit Service a31ea6
	@for %%I in ($(XML_SRCDIR)\test\XPath\docs\*.*) do @( \
Packit Service a31ea6
		for %%J in ($(XML_SRCDIR)\test\XPath\tests\%%~nxI*.*) do @( \
Packit Service a31ea6
			if not exist $(XML_SRCDIR)\result\XPath\tests\%%~nxJ ( \
Packit Service a31ea6
				$(BINDIR)\testXPath.exe -f -i %%I %%J > $(XML_SRCDIR)\result\XPath\tests\%%~nxJ &&\
Packit Service a31ea6
				findstr /C:"MEMORY ALLOCATED" .memdump | findstr /C:"MEMORY ALLOCATED : 0" > nul \
Packit Service a31ea6
			) ELSE ( \
Packit Service a31ea6
				$(BINDIR)\testXPAth.exe -f -i %%I %%J 2>&1 > result.%%~nxJ &&\
Packit Service a31ea6
				findstr /C:"MEMORY ALLOCATED" .memdump | findstr /C:"MEMORY ALLOCATED : 0">null &&\
Packit Service a31ea6
				fc $(XML_SRCDIR)\result\XPath\tests\%%~nxJ result.%%~nxJ >null & \
Packit Service a31ea6
				IF ERRORLEVEL 1 (echo Error: %%I %%J & exit 1) & \
Packit Service a31ea6
				del result.%%~nxJ \
Packit Service a31ea6
			)\
Packit Service a31ea6
		)\
Packit Service a31ea6
	)
Packit Service a31ea6
Packit Service a31ea6
XMLtests : $(BINDIR)\xmllint.exe
Packit Service a31ea6
	@echo. 2> .memdump
Packit Service a31ea6
	@echo ## XML regression tests
Packit Service a31ea6
	-@for %%I in ($(XML_SRCDIR)\test\*) do @( \
Packit Service a31ea6
		if not exist $(XML_SRCDIR)\result\%%~nxI ( \
Packit Service a31ea6
			echo New test file %%~nxI &\
Packit Service a31ea6
			$(BINDIR)\xmllint.exe  %%I > $(XML_SRCDIR)\result\%%~nxI && \
Packit Service a31ea6
			findstr /C:"MEMORY ALLOCATED" .memdump | findstr /C:"MEMORY ALLOCATED : 0" > null \
Packit Service a31ea6
		) ELSE ( \
Packit Service a31ea6
			$(BINDIR)\xmllint.exe %%I 2>&1 > result.%%~nxI && \
Packit Service a31ea6
			findstr /C:"MEMORY ALLOC" .memdump | findstr /C:"MEMORY ALLOCATED : 0" > null && \
Packit Service a31ea6
			fc $(XML_SRCDIR)\result\%%~nxI result.%%~nxI > null && \
Packit Service a31ea6
			$(BINDIR)\xmllint.exe result.%%~nxI 2>&1 > result2.%%~nxI | findstr /V /C:"failed to load external entity" && \
Packit Service a31ea6
			fc result.%%~nxI result2.%%~nxI & \
Packit Service a31ea6
			del result.%%~nxI result2.%%~nxI\
Packit Service a31ea6
		) \
Packit Service a31ea6
	)	
Packit Service a31ea6
Packit Service a31ea6
				
Packit Service a31ea6
Packit Service a31ea6
Packit Service a31ea6
Packit Service a31ea6