# Zebra makefile for MS NMAKE
-# $Id: makefile,v 1.25.2.4 2005-01-16 00:27:30 adam Exp $
+# $Id: makefile,v 1.25.2.5 2005-08-30 13:09:13 adam Exp $
###########################################################
############### Parameters
# EXPAT is optional. It's required for grs.xml-filters.
HAVE_EXPAT=1
-EXPAT_DIR= c:\Expat-1.95.8
+EXPAT_DIR=c:\Expat-1.95.8
# iconv is optional
HAVE_ICONV=1
-ICONV_DIR = c:\iconv-1.9.1.win32
+ICONV_DIR=c:\iconv-1.9.1.win32
default: all
-all: dirs zebralib zserver zindex
+all: dirs expat iconv 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
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
# shortcut names defined here
-zebralib: $(ZEBRALIB)
zindex: $(ZINDEX)
zserver: $(ZSERVER)
apitest: $(APITEST)
-
+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
### C and CPP compiler (the same thing)
/Fo"$(OBJDIR)\\" \
/Fd"$(OBJDIR)\\" \
/DDEFAULT_PROFILE_PATH=0 \
+ /DDEFAULT_MODULE_PATH=0 \
$(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)
+ wsock32.lib advapi32.lib
+
COMMON_LNK_OPTIONS= /nologo /machine:i386 /incremental:no
ZEBRALIB_LINK_OPTIONS= -lib
+DLL_LINK_OPTIONS= /dll
+
ZSERVER_LINK_OPTIONS= /subsystem:console
ZINDEX_LINK_OPTIONS= /subsystem:console
APITEST_LINK_OPTIONS= /subsystem:console
$(OBJDIR)\apitest.obj
ZEBRALIB_OBJS= \
+ $(OBJDIR)\danbibr.obj \
+ $(OBJDIR)\rsm_or.obj \
$(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)\livcode.obj \
+ $(OBJDIR)\rsisam.obj \
+ $(OBJDIR)\rsisamd.obj \
+ $(OBJDIR)\isamc.obj \
+ $(OBJDIR)\merge.obj \
$(OBJDIR)\zebra-lock.obj \
$(OBJDIR)\attribute.obj \
$(OBJDIR)\bfile.obj \
$(OBJDIR)\passwddb.obj \
$(OBJDIR)\zvrank.obj \
$(OBJDIR)\rank1.obj \
- $(OBJDIR)\livcode.obj \
- $(OBJDIR)\readfile.obj \
$(OBJDIR)\recctrl.obj \
$(OBJDIR)\recgrs.obj \
$(OBJDIR)\recindex.obj \
$(OBJDIR)\rectext.obj \
$(OBJDIR)\regxread.obj \
$(OBJDIR)\xmlread.obj \
- $(OBJDIR)\danbibr.obj \
$(OBJDIR)\res.obj \
$(OBJDIR)\retrieve.obj \
$(OBJDIR)\rsbool.obj \
$(OBJDIR)\rset.obj \
- $(OBJDIR)\rsisam.obj \
$(OBJDIR)\rsisamc.obj \
- $(OBJDIR)\rsm_or.obj \
$(OBJDIR)\rsnull.obj \
$(OBJDIR)\rstemp.obj \
$(OBJDIR)\scan.obj \
$(OBJDIR)\zsets.obj \
$(OBJDIR)\isams.obj \
$(OBJDIR)\isamb.obj \
- $(OBJDIR)\rsisamd.obj \
$(OBJDIR)\rsisamb.obj \
$(OBJDIR)\rsbetween.obj \
$(OBJDIR)\rsprox.obj \
$(OBJDIR)\d1_tagset.obj \
$(OBJDIR)\d1_varset.obj \
$(OBJDIR)\d1_write.obj \
- $(OBJDIR)\xpath.obj
+ $(OBJDIR)\xpath.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)
+ $(EXPAT_LIB)
$(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)
+$(DLL) $(IMPLIB): "$(BINDIR)" $(ZEBRALIB_OBJS)
+ @echo Linking the dll $(DLL)
+ $(LINK) @<<
+ $(LNKOPT)
+ $(LINK_LIBS)
+ $(DLL_LINK_OPTIONS)
+ $(ZEBRALIB_OBJS)
+ /out:$(DLL)
+ $(YAZLIBS)
+ $(ICONV_LIB)
+ $(EXPAT_LIB)
+ /implib:"$(IMPLIB)"
+ /map:"$(LIBDIR)\idzebra.map"
<<
###########################################################
-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 $(YAZBINDIR)\*.dll $(BINDIR)