# Zebra makefile for MS NMAKE
-# $Id: makefile,v 1.23 2003-03-26 16:52:48 adam Exp $
+# $Id: makefile,v 1.49 2006-06-06 09:46:52 adam Exp $
###########################################################
############### Parameters
# EXPAT is optional. It's required for grs.xml-filters.
HAVE_EXPAT=1
-EXPAT_DIR= c:\Expat-1.95.4
+EXPAT_DIR=c:\Expat-1.95.8
# iconv is optional
HAVE_ICONV=1
-ICONV_DIR = c:\iconv-1.8.win32
+ICONV_DIR=c:\iconv-1.9.1.win32
+
+# libxslt. For alvis
+HAVE_LIBXSLT=1
+LIBXSLT_DIR=c:\libxslt-1.1.14.win32
+
+# libxml2. Used by libxslt
+HAVE_LIBXML2=1
+LIBXML2_DIR=c:\libxml2-2.6.20.win32
+
+# zlib compression. Used by libxml2
+ZLIB_DIR = c:\zlib-1.2.3.win32
+
+# get WIN32 binaries libxml2 & iconv & zlib from here:
+# http://www.zlatkovic.com/libxml.en.html
default: all
-all: dirs zebralib zserver zindex
+all: dirs expat iconv libxml2 libxslt yaz dll zserver zindex
###########################################################
############### Directories
# YAZ include files, libraries, etc.
YAZDIR=$(ROOTDIR)\..\YAZ
YAZINCL=$(YAZDIR)\include
-YAZLIB=$(YAZDIR)\lib\yaz.lib
YAZLIBS=$(YAZLIB)
YAZBINDIR=$(YAZDIR)\bin
+!if $(DEBUG)
+YAZLIB=$(YAZDIR)\lib\yazd.lib
+YAZ_DLL_SOURCE=$(YAZBINDIR)\yazd.dll
+YAZ_DLL_TARGET=$(BINDIR)\yazd.dll
+!else
+YAZLIB=$(YAZDIR)\lib\yaz.lib
YAZ_DLL_SOURCE=$(YAZBINDIR)\yaz.dll
YAZ_DLL_TARGET=$(BINDIR)\yaz.dll
+!endif
# BZIP2 settings. Uncomment and specify if you wish to use LIBBZIP2.
# (C) 1996-1999 Julian Seward <jseward@acm.org> http://www.bzip2.org
LIBDIR=$(ROOTDIR)\lib # We produce .lib, .exp etc there
BINDIR=$(ROOTDIR)\bin # We produce exes and dlls there
WINDIR=$(ROOTDIR)\win # all these Win make things
+!if $(DEBUG)
+OBJDIR=$(WINDIR)\dobj # where we store intermediate files
+!else
OBJDIR=$(WINDIR)\obj # where we store intermediate files
+!endif
UNIXDIR=$(ROOTDIR)\unix # corresponding unix things
SRCDIR=$(ROOTDIR) # for the case we move them under src
TMP=$(TMPDIR)
TEMP=$(TMPDIR)
+# NSIS
+NSIS="c:\program files\nsis\makensis.exe"
+
+dist:
+ nmake DEBUG=1 clean
+ nmake DEBUG=0 clean
+ nmake DEBUG=0
+ $(NSIS) zebra.nsi
+
+nsis:
+ $(NSIS) zebra.nsi
+
###########################################################
############### Targets - what to make
###########################################################
-ZEBRALIB=$(LIBDIR)\zebra.lib
+!if $(DEBUG)
+DLL=$(BINDIR)\idzebrad.dll
+IMPLIB=$(LIBDIR)\idzebrad.lib
+!else
+DLL=$(BINDIR)\idzebra.dll
+IMPLIB=$(LIBDIR)\idzebra.lib
+!endif
+
+ZEBRA_RES=$(OBJDIR)\idzebra.res
+
ZSERVER=$(BINDIR)\zebrasrv.exe
ZINDEX=$(BINDIR)\zebraidx.exe
APITEST=$(BINDIR)\apitest.exe
+TSTFLOCK=$(BINDIR)\tstflock.exe
# shortcut names defined here
-zebralib: $(ZEBRALIB)
zindex: $(ZINDEX)
zserver: $(ZSERVER)
apitest: $(APITEST)
-
+tstflock: $(TSTFLOCK)
+dll: $(DLL)
###########################################################
############### Compiler and linker options
###########################################################
EXPAT_LIB= "$(EXPAT_DIR)\libs\libexpat.lib"
EXPAT_DLL_SOURCE= "$(EXPAT_DIR)\libs\libexpat.dll"
EXPAT_DLL_TARGET="$(BINDIR)\libexpat.dll"
+expat: $(EXPAT_DLL_TARGET)
+
$(EXPAT_DLL_TARGET) : $(EXPAT_DLL_SOURCE)
copy $(EXPAT_DLL_SOURCE) $(EXPAT_DLL_TARGET)
!else
EXPAT_LIB=
EXPAT_DLL_SOURCE=
EXPAT_DLL_TARGET=
+expat:
!endif
!if $(HAVE_ICONV)
ICONV_DEF= /D HAVE_ICONV_H=1 /I"$(ICONV_DIR)\include"
ICONV_LIB= $(ICONV_DIR)\lib\iconv.lib
+iconv: $(BINDIR)\iconv.dll
+
+$(BINDIR)\iconv.dll:
+ copy "$(ICONV_DIR)\bin\iconv.dll" $(BINDIR)
!else
ICONV_DEF= /D HAVE_ICONV_H=0
ICONV_LIB=
+iconv:
+!endif
+
+!if $(HAVE_LIBXML2)
+LIBXML2_LIB="$(LIBXML2_DIR)\lib\libxml2.lib"
+LIBXML2_DEF=/D HAVE_XML2=1 /I"$(LIBXML2_DIR)\include"
+libxml2: $(BINDIR)\libxml2.dll $(BINDIR)\zlib1.dll
+
+$(BINDIR)\libxml2.dll:
+ copy "$(LIBXML2_DIR)\bin\libxml2.dll" $(BINDIR)
+
+$(BINDIR)\zlib1.dll:
+ copy "$(ZLIB_DIR)\bin\zlib1.dll" $(BINDIR)
+
+!else
+LIBXML2_LIB=
+LIBXML2_DEF=/D HAVE_XML2=0
+libxml2:
+
+!endif
+
+!if $(HAVE_LIBXSLT)
+LIBXSLT_LIB="$(LIBXSLT_DIR)\lib\libxslt.lib"
+LIBXSLT_DEF=/D HAVE_XSLT=1 /I"$(LIBXSLT_DIR)\include"
+libxslt: $(BINDIR)\libxslt.dll
+
+$(BINDIR)\libxslt.dll:
+ copy "$(LIBXSLT_DIR)\bin\libxslt.dll" $(BINDIR)
+
+!else
+LIBXSLT_LIB=
+LIBXSLT_DEF=/D HAVE_XSLT=0
+libxslt:
+
+!endif
+
+!if $(HAVE_LIBXSLT)
+MOD_ALVIS_OBJS= $(OBJDIR)\alvis.obj
+MOD_ALVIS_CFLAGS=/DIDZEBRA_STATIC_ALVIS=1
+!else
+MOD_ALVIS_OBJS=
+MOD_ALVIS_CFLAGS=
!endif
### C and CPP compiler (the same thing)
# (if you set things up right!)
COMMON_C_OPTIONS= \
- /nologo /W3 /GX /FD /c \
+ /nologo /W3 /EHsc /FD /c \
/D "WIN32" \
/D"_CONSOLE" /D"_MBCS" \
+ /DYAZ_USE_NEW_LOG=1 \
+ /D"_CRT_SECURE_NO_DEPRECATE" \
$(ICONV_DEF) \
$(EXPAT_DEF) \
+ $(LIBXML2_DEF) \
+ $(LIBXSLT_DEF) \
/FR"$(OBJDIR)\\" \
/Fo"$(OBJDIR)\\" \
/Fd"$(OBJDIR)\\" \
/DDEFAULT_PROFILE_PATH=0 \
+ /DDEFAULT_MODULE_PATH=0 \
+ /DIDZEBRA_STATIC_GRS_SGML=1 \
+ /DIDZEBRA_STATIC_TEXT=1 \
+ /DIDZEBRA_STATIC_GRS_XML=1 \
+ /DIDZEBRA_STATIC_GRS_REGX=1 \
+ /DIDZEBRA_STATIC_GRS_MARC=1 \
+ /DIDZEBRA_STATIC_GRS_DANBIB=1 \
+ $(MOD_ALVIS_CFLAGS) \
+ /DIDZEBRA_STATIC_SAFARI=1 \
$(BZIP2DEF)
COMMON_C_INCLUDES= \
LINK_LIBS= kernel32.lib user32.lib gdi32.lib winspool.lib \
comdlg32.lib advapi32.lib shell32.lib ole32.lib \
oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
- wsock32.lib advapi32.lib $(ICONV_LIB) $(EXPAT_LIB)
-
-COMMON_LNK_OPTIONS= /nologo \
- /machine:i386 \
- /incremental:no
+ wsock32.lib advapi32.lib \
+ $(ICONV_LIB) $(EXPAT_LIB) $(LIBXML2_LIB) $(LIBXSLT_LIB)
-# /subsystem:windows \
+COMMON_LNK_OPTIONS= /nologo /machine:i386 /incremental:no
DEBUG_LNK_OPTIONS= /debug
-RELEASE_LNK_OPTIONS= /pdb:none
+RELEASE_LNK_OPTIONS=
-ZEBRALIB_LINK_OPTIONS = -lib
+ZEBRALIB_LINK_OPTIONS= -lib
-ZSERVER_LINK_OPTIONS = /subsystem:console
-ZINDEX_LINK_OPTIONS = /subsystem:console
-APITEST_LINK_OPTIONS = /subsystem:console
+DLL_LINK_OPTIONS= /dll
+
+ZSERVER_LINK_OPTIONS= /subsystem:console
+ZINDEX_LINK_OPTIONS= /subsystem:console
+APITEST_LINK_OPTIONS= /subsystem:console
# Final opt variables
!if $(DEBUG)
$(OBJDIR)\main.obj
APITEST_OBJS= \
$(OBJDIR)\apitest.obj
+TSTFLOCK_OBJS= \
+ $(OBJDIR)\tstflock.obj
ZEBRALIB_OBJS= \
- $(OBJDIR)\isam.obj \
- $(OBJDIR)\isamc.obj \
- $(OBJDIR)\isamd.obj \
- $(OBJDIR)\isutil.obj \
- $(OBJDIR)\memory.obj \
- $(OBJDIR)\merge.obj \
- $(OBJDIR)\merge-d.obj \
- $(OBJDIR)\physical.obj \
- $(OBJDIR)\rootblk.obj \
- $(OBJDIR)\zebra-lock.obj \
+ $(MOD_ALVIS_OBJS) \
+ $(OBJDIR)\atoi_zn.obj \
$(OBJDIR)\attribute.obj \
+ $(OBJDIR)\attrfind.obj \
$(OBJDIR)\bfile.obj \
$(OBJDIR)\bset.obj \
$(OBJDIR)\cfile.obj \
$(OBJDIR)\close.obj \
$(OBJDIR)\commit.obj \
$(OBJDIR)\compact.obj \
+ $(OBJDIR)\d1_absyn.obj \
+ $(OBJDIR)\d1_attset.obj \
+ $(OBJDIR)\d1_doespec.obj \
+ $(OBJDIR)\d1_espec.obj \
+ $(OBJDIR)\d1_expout.obj \
+ $(OBJDIR)\d1_grs.obj \
+ $(OBJDIR)\d1_handle.obj \
+ $(OBJDIR)\d1_if.obj \
+ $(OBJDIR)\d1_map.obj \
+ $(OBJDIR)\d1_marc.obj \
+ $(OBJDIR)\d1_prtree.obj \
+ $(OBJDIR)\d1_read.obj \
+ $(OBJDIR)\d1_soif.obj \
+ $(OBJDIR)\d1_sumout.obj \
+ $(OBJDIR)\d1_sutrs.obj \
+ $(OBJDIR)\d1_tagset.obj \
+ $(OBJDIR)\d1_varset.obj \
+ $(OBJDIR)\d1_write.obj \
$(OBJDIR)\dclose.obj \
$(OBJDIR)\dcompact.obj \
$(OBJDIR)\delete.obj \
$(OBJDIR)\dfa.obj \
+ $(OBJDIR)\dir.obj \
$(OBJDIR)\dirent.obj \
+ $(OBJDIR)\dirs.obj \
$(OBJDIR)\dopen.obj \
$(OBJDIR)\drdwr.obj \
+ $(OBJDIR)\extract.obj \
$(OBJDIR)\imalloc.obj \
+ $(OBJDIR)\inline.obj \
$(OBJDIR)\insert.obj \
$(OBJDIR)\invstat.obj \
+ $(OBJDIR)\isamb.obj \
+ $(OBJDIR)\isamc.obj \
+ $(OBJDIR)\isams.obj \
$(OBJDIR)\kcompare.obj \
- $(OBJDIR)\lockutil.obj \
+ $(OBJDIR)\kcontrol.obj \
+ $(OBJDIR)\kinput.obj \
+ $(OBJDIR)\limit.obj \
+ $(OBJDIR)\flock.obj \
$(OBJDIR)\lookgrep.obj \
$(OBJDIR)\lookup.obj \
$(OBJDIR)\lookupec.obj \
- $(OBJDIR)\marcread.obj \
$(OBJDIR)\marcomp.obj \
- $(OBJDIR)\inline.obj \
+ $(OBJDIR)\marcread.obj \
+ $(OBJDIR)\merge.obj \
$(OBJDIR)\mfile.obj \
$(OBJDIR)\open.obj \
+ $(OBJDIR)\orddict.obj \
$(OBJDIR)\passwddb.obj \
- $(OBJDIR)\zvrank.obj \
$(OBJDIR)\rank1.obj \
- $(OBJDIR)\livcode.obj \
- $(OBJDIR)\readfile.obj \
+ $(OBJDIR)\ranksimilarity.obj \
+ $(OBJDIR)\rankstatic.obj \
$(OBJDIR)\recctrl.obj \
$(OBJDIR)\recgrs.obj \
$(OBJDIR)\recindex.obj \
+ $(OBJDIR)\reckeys.obj \
$(OBJDIR)\recstat.obj \
$(OBJDIR)\rectext.obj \
$(OBJDIR)\regxread.obj \
- $(OBJDIR)\xmlread.obj \
$(OBJDIR)\res.obj \
$(OBJDIR)\retrieve.obj \
+ $(OBJDIR)\rsbetween.obj \
$(OBJDIR)\rsbool.obj \
$(OBJDIR)\rset.obj \
- $(OBJDIR)\rsisam.obj \
+ $(OBJDIR)\rsisamb.obj \
$(OBJDIR)\rsisamc.obj \
- $(OBJDIR)\rsm_or.obj \
+ $(OBJDIR)\rsisams.obj \
+ $(OBJDIR)\rsmultiandor.obj \
$(OBJDIR)\rsnull.obj \
+ $(OBJDIR)\rsprox.obj \
$(OBJDIR)\rstemp.obj \
+ $(OBJDIR)\safari.obj \
$(OBJDIR)\scan.obj \
$(OBJDIR)\set.obj \
$(OBJDIR)\sgmlread.obj \
+ $(OBJDIR)\snippet.obj \
$(OBJDIR)\sortidx.obj \
$(OBJDIR)\states.obj \
$(OBJDIR)\symtab.obj \
+ $(OBJDIR)\update_path.obj \
+ $(OBJDIR)\update_file.obj \
$(OBJDIR)\trunc.obj \
+ $(OBJDIR)\xmlread.obj \
+ $(OBJDIR)\xpath.obj \
+ $(OBJDIR)\zebra-lock.obj \
$(OBJDIR)\zebraapi.obj \
$(OBJDIR)\zebramap.obj \
$(OBJDIR)\zinfo.obj \
+ $(OBJDIR)\zint.obj \
$(OBJDIR)\zrpn.obj \
$(OBJDIR)\zsets.obj \
- $(OBJDIR)\isams.obj \
- $(OBJDIR)\isamb.obj \
- $(OBJDIR)\rsisamd.obj \
- $(OBJDIR)\rsisamb.obj \
- $(OBJDIR)\rsbetween.obj \
- $(OBJDIR)\dir.obj \
- $(OBJDIR)\dirs.obj \
- $(OBJDIR)\extract.obj \
- $(OBJDIR)\kinput.obj \
- $(OBJDIR)\rsisams.obj \
- $(OBJDIR)\trav.obj \
- $(OBJDIR)\d1_absyn.obj \
- $(OBJDIR)\d1_attset.obj \
- $(OBJDIR)\d1_doespec.obj \
- $(OBJDIR)\d1_espec.obj \
- $(OBJDIR)\d1_expout.obj \
- $(OBJDIR)\d1_grs.obj \
- $(OBJDIR)\d1_handle.obj \
- $(OBJDIR)\d1_if.obj \
- $(OBJDIR)\d1_map.obj \
- $(OBJDIR)\d1_marc.obj \
- $(OBJDIR)\d1_prtree.obj \
- $(OBJDIR)\d1_read.obj \
- $(OBJDIR)\d1_soif.obj \
- $(OBJDIR)\d1_sumout.obj \
- $(OBJDIR)\d1_sutrs.obj \
- $(OBJDIR)\d1_tagset.obj \
- $(OBJDIR)\d1_varset.obj \
- $(OBJDIR)\d1_write.obj \
- $(OBJDIR)\xpath.obj
+ $(OBJDIR)\zvrank.obj
ALL_OBJS=\
$(ZEBRALIB_OBJS) \
############### Linking
###########################################################
-$(ZSERVER) : "$(BINDIR)" $(ZSERVER_OBJS) $(ZEBRALIB) $(YAZLIBS)
+$(ZSERVER) : "$(BINDIR)" $(ZSERVER_OBJS) $(IMPLIB)
@echo Linking the server $(ZSERVER)
$(LINK) @<<
$(LNKOPT)
$(ZSERVER_LINK_OPTIONS)
/out:$(ZSERVER)
+ $(IMPLIB)
$(YAZLIBS)
- $(ZEBRALIB)
$(BZIP2LIB)
$(LINK_LIBS)
$(ZSERVER_OBJS)
<<
-$(ZINDEX) : "$(BINDIR)" $(ZEBRAIDX_OBJS) $(ZEBRALIB) $(YAZLIBS)
+$(ZINDEX) : "$(BINDIR)" $(ZEBRAIDX_OBJS) $(IMPLIB)
@echo Linking the indexer $(ZINDEX)
$(LINK) @<<
$(LNKOPT)
$(ZINDEX_LINK_OPTIONS)
/out:$(ZINDEX)
+ $(IMPLIB)
$(YAZLIBS)
- $(ZEBRALIB)
$(BZIP2LIB)
$(LINK_LIBS)
$(ZEBRAIDX_OBJS)
<<
-$(APITEST) : "$(BINDIR)" $(APITEST_OBJS) $(ZEBRALIB) $(YAZLIBS)
+$(APITEST) : "$(BINDIR)" $(APITEST_OBJS) $(YAZLIBS)
@echo Linking the test program $(APITEST)
$(LINK) @<<
$(LNKOPT)
$(APITEST_LINK_OPTIONS)
/out:$(APITEST)
+ $(IMPLIB)
$(YAZLIBS)
- $(ZEBRALIB)
$(BZIP2LIB)
$(LINK_LIBS)
$(APITEST_OBJS)
<<
-$(ZEBRALIB) : "$(BINDIR)" $(ZEBRALIB_OBJS)
- @echo Linking library $(ZEBRALIB)
- $(LINK) $(ZEBRALIB_LINK_OPTIONS) @<<
- /nologo
- $(ZEBRALIB_OBJS)
- /out:$(ZEBRALIB)
+$(TSTFLOCK) : "$(BINDIR)" $(TSTFLOCK_OBJS) $(IMPLIB)
+ @echo Linking $(TSTFLOCK)
+ $(LINK) @<<
+ $(LNKOPT)
+ $(TSTFLOCK_LINK_OPTIONS)
+ /out:$(TSTFLOCK)
+ $(IMPLIB)
+ $(YAZLIBS)
+ $(BZIP2LIB)
+ $(LINK_LIBS)
+ $(TSTFLOCK_OBJS)
+<<
+
+
+$(DLL) $(IMPLIB): "$(BINDIR)" $(ZEBRALIB_OBJS)
+ @echo Linking the dll $(DLL)
+ $(LINK) @<<
+ $(LNKOPT)
+ $(LINK_LIBS)
+ $(DLL_LINK_OPTIONS)
+ $(ZEBRALIB_OBJS)
+ /out:$(DLL)
+ $(YAZLIBS)
+ /implib:"$(IMPLIB)"
+ /map:"$(LIBDIR)\idzebra.map"
<<
###########################################################
-del $(OBJDIR)\*.obj
-del $(OBJDIR)\*.sbr
-del $(BINDIR)\*.exe
- -del $(BINDIR)\*.dll
-del $(TMPDIR)\*.
-del $(LIBDIR)\*.lib
########### check directories and create if needed
-dirs: $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR) \
- $(EXPAT_DLL_TARGET) $(YAZ_DLL_TARGET)
+dirs: $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR)
$(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR):
- if not exist "$@/$(NUL)" mkdir "$@"
+ if not exist "$@/$(NUL)" mkdir "$@"
+
+yaz: $(YAZ_DLL_TARGET)
$(YAZ_DLL_TARGET) : $(YAZ_DLL_SOURCE)
- copy $(YAZ_DLL_SOURCE) $(YAZ_DLL_TARGET)
+ copy $(YAZBINDIR)\*.dll $(BINDIR)
###########################################################
############### Explicit dependencies