1 # Zebra makefile for MS NMAKE
2 # $Id: makefile,v 1.57 2006-09-22 10:18:06 adam Exp $
4 ###########################################################
5 ############### Parameters
6 ###########################################################
8 DEBUG=0 # 0 for release, 1 for debug
10 # EXPAT is optional. It's required for grs.xml-filters.
12 EXPAT_DIR=c:\Expat-1.95.8
16 ICONV_DIR=c:\iconv-1.9.2.win32
20 LIBXSLT_DIR=c:\libxslt-1.1.17.win32
22 # libxml2. Used by libxslt
24 LIBXML2_DIR=c:\libxml2-2.6.26.win32
26 # zlib compression. Used by libxml2
27 ZLIB_DIR = c:\zlib-1.2.3.win32
29 # get WIN32 binaries libxml2 & iconv & zlib from here:
30 # http://www.zlatkovic.com/libxml.en.html
34 all: dirs expat iconv libxml2 libxslt yaz dll zserver zebraidx tstflock
37 # The current directory is supposed to be something like
38 # ..../Zebra/Win, everything is relative to that
39 ROOTDIR=.. # The home of zebra
41 # YAZ include files, libraries, etc.
42 YAZDIR=$(ROOTDIR)\..\YAZ
43 YAZINCL=$(YAZDIR)\include
45 YAZBINDIR=$(YAZDIR)\bin
47 YAZLIB=$(YAZDIR)\lib\yazd.lib
48 YAZ_DLL_SOURCE=$(YAZBINDIR)\yazd.dll
49 YAZ_DLL_TARGET=$(BINDIR)\yazd.dll
51 YAZLIB=$(YAZDIR)\lib\yaz.lib
52 YAZ_DLL_SOURCE=$(YAZBINDIR)\yaz.dll
53 YAZ_DLL_TARGET=$(BINDIR)\yaz.dll
56 # BZIP2 settings. Uncomment and specify if you wish to use LIBBZIP2.
57 # (C) 1996-1999 Julian Seward <jseward@acm.org> http://www.bzip2.org
59 #BZIP2INCLUDE=/I"$(ROOTDIR)\..\bzip2-0.9.5d"
60 #BZIP2LIB=$(ROOTDIR)\..\bzip2-0.9.5d\libbz2.lib
61 #BZIP2DEF=/D"HAVE_BZLIB_H=1"
63 # ZEBRA Include files, libraries, programs, etc.
64 INCLDIR=$(ROOTDIR)\include # our includes
65 LIBDIR=$(ROOTDIR)\lib # We produce .lib, .exp etc there
66 BINDIR=$(ROOTDIR)\bin # We produce exes and dlls there
67 WINDIR=$(ROOTDIR)\win # all these Win make things
69 OBJDIR=$(WINDIR)\dobj # where we store intermediate files
71 OBJDIR=$(WINDIR)\obj # where we store intermediate files
73 UNIXDIR=$(ROOTDIR)\unix # corresponding unix things
74 SRCDIR=$(ROOTDIR) # for the case we move them under src
76 INDEXDIR=$(SRCDIR)\INDEX
77 BFILEDIR=$(SRCDIR)\BFILE
79 DICTDIR=$(SRCDIR)\DICT
80 ISAMSDIR=$(SRCDIR)\ISAMS
81 ISAMCDIR=$(SRCDIR)\ISAMC
82 ISAMBDIR=$(SRCDIR)\ISAMB
83 RSETDIR=$(SRCDIR)\RSET
84 UTILDIR=$(SRCDIR)\UTIL
85 DATA1DIR=$(SRCDIR)\DATA1
87 # Force temp files in a local temp, easier to clean
88 # when nmake crashes and leaves a lot of rubbish behind
89 TMPDIR=$(ROOTDIR)\win\tmp
94 NSIS="c:\program files\nsis\makensis.exe"
105 # Targets - what to make
108 DLL=$(BINDIR)\idzebrad.dll
109 IMPLIB=$(LIBDIR)\idzebrad.lib
111 DLL=$(BINDIR)\idzebra.dll
112 IMPLIB=$(LIBDIR)\idzebra.lib
115 ZEBRA_RES=$(OBJDIR)\idzebra.res
117 ZSERVER=$(BINDIR)\zebrasrv.exe
118 ZEBRAIDX=$(BINDIR)\zebraidx.exe
119 TSTFLOCK=$(BINDIR)\tstflock.exe
121 # shortcut names defined here
122 zebraidx: $(ZEBRAIDX)
124 tstflock: $(TSTFLOCK)
127 # External libs and modules (enabled or disabled)
130 EXPAT_DEF= /D HAVE_EXPAT_H=1 /I"$(EXPAT_DIR)\source\lib"
131 EXPAT_LIB= "$(EXPAT_DIR)\libs\libexpat.lib"
132 EXPAT_DLL_SOURCE= "$(EXPAT_DIR)\libs\libexpat.dll"
133 EXPAT_DLL_TARGET="$(BINDIR)\libexpat.dll"
134 expat: $(EXPAT_DLL_TARGET)
136 $(EXPAT_DLL_TARGET) : $(EXPAT_DLL_SOURCE)
137 copy $(EXPAT_DLL_SOURCE) $(EXPAT_DLL_TARGET)
139 EXPAT_DEF= /D HAVE_EXPAT_H=0
147 ICONV_DEF= /D HAVE_ICONV_H=1 /I"$(ICONV_DIR)\include"
148 ICONV_LIB= $(ICONV_DIR)\lib\iconv.lib
149 iconv: $(BINDIR)\iconv.dll
152 copy "$(ICONV_DIR)\bin\iconv.dll" $(BINDIR)
154 ICONV_DEF= /D HAVE_ICONV_H=0
160 LIBXML2_LIB="$(LIBXML2_DIR)\lib\libxml2.lib"
161 LIBXML2_DEF=/D HAVE_XML2=1 /I"$(LIBXML2_DIR)\include"
162 libxml2: $(BINDIR)\libxml2.dll $(BINDIR)\zlib1.dll
164 $(BINDIR)\libxml2.dll:
165 copy "$(LIBXML2_DIR)\bin\libxml2.dll" $(BINDIR)
168 copy "$(ZLIB_DIR)\bin\zlib1.dll" $(BINDIR)
172 LIBXML2_DEF=/D HAVE_XML2=0
178 LIBXSLT_LIB="$(LIBXSLT_DIR)\lib\libxslt.lib"
179 LIBXSLT_DEF=/D HAVE_XSLT=1 /I"$(LIBXSLT_DIR)\include"
180 libxslt: $(BINDIR)\libxslt.dll
182 $(BINDIR)\libxslt.dll:
183 copy "$(LIBXSLT_DIR)\bin\libxslt.dll" $(BINDIR)
187 LIBXSLT_DEF=/D HAVE_XSLT=0
193 MOD_ALVIS_OBJS= $(OBJDIR)\alvis.obj
194 MOD_ALVIS_CFLAGS=/DIDZEBRA_STATIC_ALVIS=1
200 ### C and CPP compiler (the same thing)
201 # Note: $(CPP) has already been defined in the environment
202 # (if you set things up right!)
205 /nologo /W3 /EHsc /FD /c \
207 /D"_CONSOLE" /D"_MBCS" \
208 /DYAZ_USE_NEW_LOG=1 \
209 /D"_CRT_SECURE_NO_DEPRECATE" \
210 /D"_CRT_NONSTDC_NO_DEPRECATE" \
218 /DDEFAULT_PROFILE_PATH=0 \
219 /DDEFAULT_MODULE_PATH=0 \
220 /DIDZEBRA_STATIC_GRS_SGML=1 \
221 /DIDZEBRA_STATIC_TEXT=1 \
222 /DIDZEBRA_STATIC_GRS_XML=1 \
223 /DIDZEBRA_STATIC_GRS_REGX=1 \
224 /DIDZEBRA_STATIC_GRS_MARC=1 \
225 /DIDZEBRA_STATIC_GRS_DANBIB=1 \
226 $(MOD_ALVIS_CFLAGS) \
227 /DIDZEBRA_STATIC_SAFARI=1 \
231 /I"$(SRCDIR)\include" \
232 /I"$(YAZDIR)\include" \
243 # /W3 = warning level
244 # /GX = Enable exception handling
245 # /FD = Generate file dependencies (what ever they are)
246 # /c = compile without linking
247 # /FR = Generate browse info (.sbr file that gets combined into .bsc)
248 # /Fo = object file name (or at least path)
249 # /Fd = debug database name (or path)
250 # /MD = Runtime library: Multithread DLL
251 # /MDd = Runtime library: Multithread DLL (debug)
252 # /Od = Disable optimising (debug)
253 # /O2 = Optimize for speed
254 # /YX = Automatic use of precomipled headers
255 # /Gm = Minimal rebuild (some cpp class stuff)
256 # /Zi = Program database for debuggers
257 # /ZI = Pgm database with special "edit&continue" stuff - not available in C5
262 LINK_LIBS= kernel32.lib user32.lib gdi32.lib winspool.lib \
263 comdlg32.lib advapi32.lib shell32.lib ole32.lib \
264 oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
265 wsock32.lib advapi32.lib \
266 $(ICONV_LIB) $(EXPAT_LIB) $(LIBXML2_LIB) $(LIBXSLT_LIB)
268 COMMON_LNK_OPTIONS= /nologo /machine:i386 /incremental:no
270 DEBUG_LNK_OPTIONS= /debug
274 ZEBRALIB_LINK_OPTIONS= -lib
276 DLL_LINK_OPTIONS= /dll
278 CLIENT_LINK_OPTIONS= /subsystem:console
280 # Final opt variables
282 COPT= $(COMMON_C_OPTIONS) $(DEBUG_C_OPTIONS) $(COMMON_C_INCLUDES)
283 MTLOPT= $(COMMON_MTL_OPTIONS) $(DEBUG_MTL_OPTIONS)
284 RCOPT= $(COMMON_RC_OPTIONS) $(DEBUG_RC_OPTIONS)
285 LNKOPT= $(COMMON_LNK_OPTIONS) $(DEBUG_LNK_OPTIONS) $(LNK_LIBS)
288 COPT= $(COMMON_C_OPTIONS) $(RELEASE_C_OPTIONS) $(COMMON_C_INCLUDES)
289 MTLOPT= $(COMMON_MTL_OPTIONS) $(RELEASE_MTL_OPTIONS)
290 RCOPT= $(COMMON_RC_OPTIONS) $(RELEASE_RC_OPTIONS)
291 LNKOPT= $(COMMON_LNK_OPTIONS) $(RELEASE_LNK_OPTIONS) $(LNK_LIBS)
294 LINK_PROGRAM= $(LINK) \
296 $(CLIENT_LINK_OPTIONS) \
302 # Source and object modules
303 # Note: Ordinary source files are not specified here at
304 # all, make finds them in suitable dirs. The object modules
305 # need to be specified, though
308 $(OBJDIR)\zebrasrv.obj
311 $(OBJDIR)\zebraidx.obj
313 $(OBJDIR)\tstflock.obj
317 $(OBJDIR)\atoi_zn.obj \
318 $(OBJDIR)\attribute.obj \
319 $(OBJDIR)\attrfind.obj \
320 $(OBJDIR)\bfile.obj \
322 $(OBJDIR)\cfile.obj \
323 $(OBJDIR)\charmap.obj \
324 $(OBJDIR)\close.obj \
325 $(OBJDIR)\commit.obj \
326 $(OBJDIR)\compact.obj \
327 $(OBJDIR)\d1_absyn.obj \
328 $(OBJDIR)\d1_attset.obj \
329 $(OBJDIR)\d1_doespec.obj \
330 $(OBJDIR)\d1_espec.obj \
331 $(OBJDIR)\d1_expout.obj \
332 $(OBJDIR)\d1_grs.obj \
333 $(OBJDIR)\d1_handle.obj \
334 $(OBJDIR)\d1_if.obj \
335 $(OBJDIR)\d1_map.obj \
336 $(OBJDIR)\d1_marc.obj \
337 $(OBJDIR)\d1_prtree.obj \
338 $(OBJDIR)\d1_read.obj \
339 $(OBJDIR)\d1_soif.obj \
340 $(OBJDIR)\d1_sumout.obj \
341 $(OBJDIR)\d1_sutrs.obj \
342 $(OBJDIR)\d1_tagset.obj \
343 $(OBJDIR)\d1_utils.obj \
344 $(OBJDIR)\d1_varset.obj \
345 $(OBJDIR)\d1_write.obj \
346 $(OBJDIR)\dclose.obj \
347 $(OBJDIR)\dcompact.obj \
348 $(OBJDIR)\delete.obj \
351 $(OBJDIR)\dirent.obj \
353 $(OBJDIR)\dopen.obj \
354 $(OBJDIR)\drdwr.obj \
355 $(OBJDIR)\extract.obj \
356 $(OBJDIR)\flock.obj \
357 $(OBJDIR)\imalloc.obj \
358 $(OBJDIR)\inline.obj \
359 $(OBJDIR)\insert.obj \
360 $(OBJDIR)\invstat.obj \
361 $(OBJDIR)\isamb.obj \
362 $(OBJDIR)\isamc.obj \
363 $(OBJDIR)\isams.obj \
364 $(OBJDIR)\kcompare.obj \
365 $(OBJDIR)\kcontrol.obj \
366 $(OBJDIR)\kinput.obj \
367 $(OBJDIR)\limit.obj \
368 $(OBJDIR)\lookgrep.obj \
369 $(OBJDIR)\lookup.obj \
370 $(OBJDIR)\lookupec.obj \
371 $(OBJDIR)\marcomp.obj \
372 $(OBJDIR)\marcread.obj \
373 $(OBJDIR)\merge.obj \
374 $(OBJDIR)\mfile.obj \
376 $(OBJDIR)\orddict.obj \
377 $(OBJDIR)\passwddb.obj \
378 $(OBJDIR)\rank1.obj \
379 $(OBJDIR)\ranksimilarity.obj \
380 $(OBJDIR)\rankstatic.obj \
381 $(OBJDIR)\recctrl.obj \
382 $(OBJDIR)\recgrs.obj \
383 $(OBJDIR)\recindex.obj \
384 $(OBJDIR)\reckeys.obj \
385 $(OBJDIR)\recstat.obj \
386 $(OBJDIR)\rectext.obj \
387 $(OBJDIR)\regxread.obj \
389 $(OBJDIR)\retrieve.obj \
390 $(OBJDIR)\rpnscan.obj \
391 $(OBJDIR)\rpnsearch.obj \
392 $(OBJDIR)\rsbetween.obj \
393 $(OBJDIR)\rsbool.obj \
395 $(OBJDIR)\rsisamb.obj \
396 $(OBJDIR)\rsisamc.obj \
397 $(OBJDIR)\rsisams.obj \
398 $(OBJDIR)\rsmultiandor.obj \
399 $(OBJDIR)\rsnull.obj \
400 $(OBJDIR)\rsprox.obj \
401 $(OBJDIR)\rstemp.obj \
402 $(OBJDIR)\safari.obj \
405 $(OBJDIR)\sgmlread.obj \
406 $(OBJDIR)\snippet.obj \
407 $(OBJDIR)\sortidx.obj \
408 $(OBJDIR)\states.obj \
409 $(OBJDIR)\stream.obj \
410 $(OBJDIR)\symtab.obj \
411 $(OBJDIR)\trunc.obj \
412 $(OBJDIR)\untrans.obj \
413 $(OBJDIR)\update_path.obj \
414 $(OBJDIR)\update_file.obj \
415 $(OBJDIR)\xmlread.obj \
416 $(OBJDIR)\xpath.obj \
417 $(OBJDIR)\zaptterm.obj \
418 $(OBJDIR)\zebra-lock.obj \
419 $(OBJDIR)\zebraapi.obj \
420 $(OBJDIR)\zebramap.obj \
421 $(OBJDIR)\zinfo.obj \
426 # Note: This defines where to look for the necessary
427 # source files. Funny way of doing it, but it works.
429 {$(INDEXDIR)}.c{$(OBJDIR)}.obj:
432 {$(BFILEDIR)}.c{$(OBJDIR)}.obj:
435 {$(DFADIR)}.c{$(OBJDIR)}.obj:
438 {$(DICTDIR)}.c{$(OBJDIR)}.obj:
441 {$(ISAMSDIR)}.c{$(OBJDIR)}.obj:
444 {$(ISAMCDIR)}.c{$(OBJDIR)}.obj:
447 {$(ISAMBDIR)}.c{$(OBJDIR)}.obj:
450 {$(RSETDIR)}.c{$(OBJDIR)}.obj:
453 {$(UTILDIR)}.c{$(OBJDIR)}.obj:
456 {$(DATA1DIR)}.c{$(OBJDIR)}.obj:
461 $(ZSERVER) : "$(BINDIR)" $(ZSERVER_OBJS) $(IMPLIB)
466 $(ZEBRAIDX) : "$(BINDIR)" $(ZEBRAIDX_OBJS) $(IMPLIB)
471 $(TSTFLOCK) : "$(BINDIR)" $(TSTFLOCK_OBJS) $(IMPLIB)
476 $(DLL) $(IMPLIB): "$(BINDIR)" $(ZEBRALIB_OBJS)
480 $(DLL_LINK_OPTIONS) \
484 /implib:"$(IMPLIB)" \
485 /map:"$(LIBDIR)\idzebra.map" \
497 dirs: $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR)
499 $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR):
500 if not exist "$@/$(NUL)" mkdir "$@"
502 yaz: $(YAZ_DLL_TARGET)
504 $(YAZ_DLL_TARGET) : $(YAZ_DLL_SOURCE)
505 # copy $(YAZBINDIR)\*.dll.manifest $(BINDIR)
506 copy $(YAZBINDIR)\*.dll $(BINDIR)