1 # Zebra makefile for MS NMAKE
3 ###########################################################
4 ############### Parameters
5 ###########################################################
7 DEBUG=0 # 0 for release, 1 for debug
9 # TCL is optional - ONLY needed for source straight from Git
10 TCL="C:\Tcl\bin\tclsh85.exe"
13 # EXPAT is optional. It's required for grs.xml-filters.
15 EXPAT_DIR=c:\Program files\Expat 2.0.1
19 ICONV_DIR=c:\iconv-1.9.2.win32
21 # libxslt. For mod_dom and mod_alvis
23 LIBXSLT_DIR=c:\libxslt-1.1.24.win32
25 # libxml2. Used by libxslt
27 LIBXML2_DIR=c:\libxml2-2.7.1.win32
29 # zlib compression. Used by libxml2
30 ZLIB_DIR = c:\zlib-1.2.3.win32
32 # get WIN32 binaries libxml2 & iconv & zlib from here:
33 # http://www.zlatkovic.com/libxml.en.html
36 # get icu libraries from http://www.icu-project.org
42 all: dirs generate expat iconv libxml2 libxslt icu yaz dll zserver zebraidx tstflock
45 # The current directory is supposed to be something like
46 # ..../Zebra/Win, everything is relative to that
47 ROOTDIR=.. # The home of zebra
49 # YAZ include files, libraries, etc.
50 YAZDIR=$(ROOTDIR)\..\yaz # or \program files\yaz
52 YAZBINDIR=$(YAZDIR)\bin
54 YAZLIB="$(YAZDIR)\lib\yaz3d.lib"
56 YAZLIB=$(YAZLIB) "$(YAZDIR)\lib\yaz_icu3d.lib"
58 YAZ_DLL_SOURCE="$(YAZBINDIR)\yaz3d.dll"
59 YAZ_DLL_TARGET="$(BINDIR)\yaz3d.dll"
61 YAZLIB="$(YAZDIR)\lib\yaz3.lib"
63 YAZLIB=$(YAZLIB) "$(YAZDIR)\lib\yaz_icu3.lib"
65 YAZ_DLL_SOURCE="$(YAZBINDIR)\yaz3.dll"
66 YAZ_DLL_TARGET="$(BINDIR)\yaz3.dll"
69 # BZIP2 settings. Uncomment and specify if you wish to use LIBBZIP2.
70 # (C) 1996-1999 Julian Seward <jseward@acm.org> http://www.bzip2.org
72 #BZIP2INCLUDE=/I"$(ROOTDIR)\..\bzip2-0.9.5d"
73 #BZIP2LIB=$(ROOTDIR)\..\bzip2-0.9.5d\libbz2.lib
74 #BZIP2DEF=/D"HAVE_BZLIB_H=1"
76 # ZEBRA Include files, libraries, programs, etc.
77 INCLDIR=$(ROOTDIR)\include # our includes
78 LIBDIR=$(ROOTDIR)\lib # We produce .lib, .exp etc there
79 BINDIR=$(ROOTDIR)\bin # We produce exes and dlls there
80 WINDIR=$(ROOTDIR)\win # all these Win make things
82 OBJDIR=$(WINDIR)\dobj # where we store intermediate files
84 OBJDIR=$(WINDIR)\obj # where we store intermediate files
86 UNIXDIR=$(ROOTDIR)\unix # corresponding unix things
87 SRCDIR=$(ROOTDIR) # for the case we move them under src
89 INDEXDIR=$(SRCDIR)\INDEX
90 BFILEDIR=$(SRCDIR)\BFILE
92 DICTDIR=$(SRCDIR)\DICT
93 ISAMSDIR=$(SRCDIR)\ISAMS
94 ISAMCDIR=$(SRCDIR)\ISAMC
95 ISAMBDIR=$(SRCDIR)\ISAMB
96 RSETDIR=$(SRCDIR)\RSET
97 UTILDIR=$(SRCDIR)\UTIL
98 DATA1DIR=$(SRCDIR)\DATA1
100 # Force temp files in a local temp, easier to clean
101 # when nmake crashes and leaves a lot of rubbish behind
102 TMPDIR=$(ROOTDIR)\win\tmp
107 NSIS="c:\program files\nsis\makensis.exe"
118 # Targets - what to make
121 DLL=$(BINDIR)\idzebrad.dll
122 IMPLIB=$(LIBDIR)\idzebrad.lib
124 DLL=$(BINDIR)\idzebra.dll
125 IMPLIB=$(LIBDIR)\idzebra.lib
128 ZSERVER=$(BINDIR)\zebrasrv.exe
129 ZEBRAIDX=$(BINDIR)\zebraidx.exe
130 TSTFLOCK=$(BINDIR)\tstflock.exe
132 # shortcut names defined here
133 zebraidx: $(ZEBRAIDX)
135 tstflock: $(TSTFLOCK)
138 # External libs and modules (enabled or disabled)
141 EXPAT_DEF= /D HAVE_EXPAT_H=1 /I"$(EXPAT_DIR)\source\lib"
142 EXPAT_LIB= "$(EXPAT_DIR)\bin\libexpat.lib"
143 EXPAT_DLL_SOURCE= "$(EXPAT_DIR)\bin\libexpat.dll"
144 EXPAT_DLL_TARGET= "$(BINDIR)\libexpat.dll"
145 expat: $(EXPAT_DLL_TARGET)
147 $(EXPAT_DLL_TARGET) : $(EXPAT_DLL_SOURCE)
148 copy $(EXPAT_DLL_SOURCE) $(EXPAT_DLL_TARGET)
150 EXPAT_DEF= /D HAVE_EXPAT_H=0
158 ICONV_DEF= /D HAVE_ICONV_H=1 /I"$(ICONV_DIR)\include"
159 ICONV_LIB= $(ICONV_DIR)\lib\iconv.lib
160 iconv: $(BINDIR)\iconv.dll
163 copy "$(ICONV_DIR)\bin\iconv.dll" $(BINDIR)
165 ICONV_DEF= /D HAVE_ICONV_H=0
171 LIBXML2_LIB="$(LIBXML2_DIR)\lib\libxml2.lib"
172 LIBXML2_DEF=/DYAZ_HAVE_XML2=1 /D HAVE_XML2=1 /I"$(LIBXML2_DIR)\include"
173 libxml2: $(BINDIR)\libxml2.dll $(BINDIR)\zlib1.dll
175 $(BINDIR)\libxml2.dll:
176 copy "$(LIBXML2_DIR)\bin\libxml2.dll" $(BINDIR)
179 copy "$(ZLIB_DIR)\bin\zlib1.dll" $(BINDIR)
183 LIBXML2_DEF=/D HAVE_XML2=0
189 LIBXSLT_LIB="$(LIBXSLT_DIR)\lib\libxslt.lib"
190 LIBXSLT_DEF=/D HAVE_XSLT=1 /I"$(LIBXSLT_DIR)\include"
191 libxslt: $(BINDIR)\libxslt.dll
193 $(BINDIR)\libxslt.dll:
194 copy "$(LIBXSLT_DIR)\bin\libxslt.dll" $(BINDIR)
198 LIBXSLT_DEF=/D HAVE_XSLT=0
204 ICU_DEF= /DYAZ_HAVE_ICU=1 /I"$(ICU_DIR)\include"
205 ICU_LIB= $(ICU_DIR)\lib\icudt.lib $(ICU_DIR)\lib\icuin.lib $(ICU_DIR)\lib\icuuc.lib
206 icu: $(BINDIR)\icudt40.dll $(BINDIR)\icuin40.dll $(BINDIR)\icuuc40.dll
208 $(BINDIR)\icudt40.dll:
209 copy "$(ICU_DIR)\bin\icudt40.dll" $(BINDIR)
210 $(BINDIR)\icuin40.dll:
211 copy "$(ICU_DIR)\bin\icuin40.dll" $(BINDIR)
212 $(BINDIR)\icuuc40.dll:
213 copy "$(ICU_DIR)\bin\icuuc40.dll" $(BINDIR)
215 ICU_DEF= /DYAZ_HAVE_ICU=0
221 MOD_ALVIS_OBJS= $(OBJDIR)\mod_alvis.obj
222 MOD_ALVIS_CFLAGS=/DIDZEBRA_STATIC_ALVIS=1
224 MOD_DOM_OBJS= $(OBJDIR)\mod_dom.obj
225 MOD_DOM_CFLAGS=/DIDZEBRA_STATIC_DOM=1
234 ### C and CPP compiler (the same thing)
235 # Note: $(CPP) has already been defined in the environment
236 # (if you set things up right!)
239 /nologo /W3 /EHsc /FD /c \
241 /D"_CONSOLE" /D"_MBCS" \
242 /DYAZ_USE_NEW_LOG=1 \
243 /D"_CRT_SECURE_NO_DEPRECATE" \
244 /D"_CRT_NONSTDC_NO_DEPRECATE" \
253 /DDEFAULT_PROFILE_PATH=0 \
254 /DDEFAULT_MODULE_PATH=0 \
255 /DIDZEBRA_STATIC_GRS_SGML=1 \
256 /DIDZEBRA_STATIC_TEXT=1 \
257 /DIDZEBRA_STATIC_GRS_XML=1 \
258 /DIDZEBRA_STATIC_GRS_REGX=1 \
259 /DIDZEBRA_STATIC_GRS_MARC=1 \
260 /DIDZEBRA_STATIC_GRS_DANBIB=1 \
261 $(MOD_ALVIS_CFLAGS) \
263 /DIDZEBRA_STATIC_SAFARI=1 \
267 /I"$(SRCDIR)\include" \
268 /I"$(YAZDIR)\include" \
279 # /W3 = warning level
280 # /GX = Enable exception handling
281 # /FD = Generate file dependencies (what ever they are)
282 # /c = compile without linking
283 # /FR = Generate browse info (.sbr file that gets combined into .bsc)
284 # /Fo = object file name (or at least path)
285 # /Fd = debug database name (or path)
286 # /MD = Runtime library: Multithread DLL
287 # /MDd = Runtime library: Multithread DLL (debug)
288 # /Od = Disable optimising (debug)
289 # /O2 = Optimize for speed
290 # /YX = Automatic use of precomipled headers
291 # /Gm = Minimal rebuild (some cpp class stuff)
292 # /Zi = Program database for debuggers
293 # /ZI = Pgm database with special "edit&continue" stuff - not available in C5
298 LINK_LIBS= kernel32.lib user32.lib gdi32.lib winspool.lib \
299 comdlg32.lib advapi32.lib shell32.lib ole32.lib \
300 oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
301 wsock32.lib advapi32.lib \
302 $(ICONV_LIB) $(EXPAT_LIB) $(LIBXML2_LIB) $(LIBXSLT_LIB) $(ICU_LIB)
304 COMMON_LNK_OPTIONS= /nologo /machine:i386 /incremental:no
306 DEBUG_LNK_OPTIONS= /debug
310 ZEBRALIB_LINK_OPTIONS= -lib
312 DLL_LINK_OPTIONS= /dll
314 CLIENT_LINK_OPTIONS= /subsystem:console
316 # Final opt variables
318 COPT= $(COMMON_C_OPTIONS) $(DEBUG_C_OPTIONS) $(COMMON_C_INCLUDES)
319 MTLOPT= $(COMMON_MTL_OPTIONS) $(DEBUG_MTL_OPTIONS)
320 RCOPT= $(COMMON_RC_OPTIONS) $(DEBUG_RC_OPTIONS)
321 LNKOPT= $(COMMON_LNK_OPTIONS) $(DEBUG_LNK_OPTIONS) $(LNK_LIBS)
324 COPT= $(COMMON_C_OPTIONS) $(RELEASE_C_OPTIONS) $(COMMON_C_INCLUDES)
325 MTLOPT= $(COMMON_MTL_OPTIONS) $(RELEASE_MTL_OPTIONS)
326 RCOPT= $(COMMON_RC_OPTIONS) $(RELEASE_RC_OPTIONS)
327 LNKOPT= $(COMMON_LNK_OPTIONS) $(RELEASE_LNK_OPTIONS) $(LNK_LIBS)
330 LINK_PROGRAM= $(LINK) \
332 $(CLIENT_LINK_OPTIONS) \
340 generate: $(INCLDIR)\idzebra\version.h
342 $(INCLDIR)\idzebra\version.h:
344 $(TCL) mk_version.tcl $(ROOTDIR)/configure.ac $(INCLDIR)\idzebra\version.h
346 # Source and object modules
347 # Note: Ordinary source files are not specified here at
348 # all, make finds them in suitable dirs. The object modules
349 # need to be specified, though
352 $(OBJDIR)\zebrasrv.obj
355 $(OBJDIR)\zebraidx.obj
357 $(OBJDIR)\tstflock.obj
362 $(OBJDIR)\atoi_zn.obj \
363 $(OBJDIR)\attribute.obj \
364 $(OBJDIR)\attrfind.obj \
365 $(OBJDIR)\bfile.obj \
367 $(OBJDIR)\cfile.obj \
368 $(OBJDIR)\check_res.obj \
369 $(OBJDIR)\charmap.obj \
370 $(OBJDIR)\close.obj \
371 $(OBJDIR)\commit.obj \
372 $(OBJDIR)\compact.obj \
373 $(OBJDIR)\d1_absyn.obj \
374 $(OBJDIR)\d1_attset.obj \
375 $(OBJDIR)\d1_doespec.obj \
376 $(OBJDIR)\d1_espec.obj \
377 $(OBJDIR)\d1_expout.obj \
378 $(OBJDIR)\d1_grs.obj \
379 $(OBJDIR)\d1_handle.obj \
380 $(OBJDIR)\d1_if.obj \
381 $(OBJDIR)\d1_map.obj \
382 $(OBJDIR)\d1_marc.obj \
383 $(OBJDIR)\d1_prtree.obj \
384 $(OBJDIR)\d1_read.obj \
385 $(OBJDIR)\d1_soif.obj \
386 $(OBJDIR)\d1_sumout.obj \
387 $(OBJDIR)\d1_sutrs.obj \
388 $(OBJDIR)\d1_tagset.obj \
389 $(OBJDIR)\d1_utils.obj \
390 $(OBJDIR)\d1_varset.obj \
391 $(OBJDIR)\d1_write.obj \
392 $(OBJDIR)\dclose.obj \
393 $(OBJDIR)\dcompact.obj \
394 $(OBJDIR)\delete.obj \
397 $(OBJDIR)\dirent.obj \
399 $(OBJDIR)\dopen.obj \
400 $(OBJDIR)\drdwr.obj \
402 $(OBJDIR)\extract.obj \
403 $(OBJDIR)\flock.obj \
404 $(OBJDIR)\imalloc.obj \
405 $(OBJDIR)\inline.obj \
406 $(OBJDIR)\insert.obj \
407 $(OBJDIR)\invstat.obj \
408 $(OBJDIR)\isamb.obj \
409 $(OBJDIR)\isamc.obj \
410 $(OBJDIR)\isams.obj \
411 $(OBJDIR)\isam_methods.obj \
412 $(OBJDIR)\it_key.obj \
413 $(OBJDIR)\kcontrol.obj \
414 $(OBJDIR)\key_block.obj \
415 $(OBJDIR)\kinput.obj \
416 $(OBJDIR)\limit.obj \
417 $(OBJDIR)\lookgrep.obj \
418 $(OBJDIR)\lookup.obj \
419 $(OBJDIR)\lookupec.obj \
420 $(OBJDIR)\marcomp.obj \
421 $(OBJDIR)\mod_grs_marc.obj \
422 $(OBJDIR)\merge.obj \
423 $(OBJDIR)\mfile.obj \
425 $(OBJDIR)\orddict.obj \
426 $(OBJDIR)\passwddb.obj \
427 $(OBJDIR)\rank1.obj \
428 $(OBJDIR)\ranksimilarity.obj \
429 $(OBJDIR)\rankstatic.obj \
430 $(OBJDIR)\recctrl.obj \
431 $(OBJDIR)\recgrs.obj \
432 $(OBJDIR)\records.obj \
433 $(OBJDIR)\recindex.obj \
434 $(OBJDIR)\reckeys.obj \
435 $(OBJDIR)\mod_text.obj \
436 $(OBJDIR)\mod_grs_regx.obj \
438 $(OBJDIR)\retrieve.obj \
439 $(OBJDIR)\rpnscan.obj \
440 $(OBJDIR)\rpnsearch.obj \
441 $(OBJDIR)\rsbetween.obj \
442 $(OBJDIR)\rsbool.obj \
444 $(OBJDIR)\rset_isam.obj \
445 $(OBJDIR)\rsisamb.obj \
446 $(OBJDIR)\rsisamc.obj \
447 $(OBJDIR)\rsisams.obj \
448 $(OBJDIR)\rsmultiandor.obj \
449 $(OBJDIR)\rsnull.obj \
450 $(OBJDIR)\rsprox.obj \
451 $(OBJDIR)\rstemp.obj \
452 $(OBJDIR)\mod_safari.obj \
455 $(OBJDIR)\mod_grs_sgml.obj \
456 $(OBJDIR)\snippet.obj \
457 $(OBJDIR)\sortidx.obj \
458 $(OBJDIR)\states.obj \
459 $(OBJDIR)\stream.obj \
460 $(OBJDIR)\strmap.obj \
461 $(OBJDIR)\su_codec.obj \
462 $(OBJDIR)\trunc.obj \
463 $(OBJDIR)\untrans.obj \
464 $(OBJDIR)\update_path.obj \
465 $(OBJDIR)\update_file.obj \
466 $(OBJDIR)\version.obj \
467 $(OBJDIR)\mod_grs_xml.obj \
468 $(OBJDIR)\xpath.obj \
469 $(OBJDIR)\zaptterm.obj \
470 $(OBJDIR)\zebra-lock.obj \
471 $(OBJDIR)\zebraapi.obj \
472 $(OBJDIR)\zebramap.obj \
473 $(OBJDIR)\zinfo.obj \
478 # Note: This defines where to look for the necessary
479 # source files. Funny way of doing it, but it works.
481 {$(INDEXDIR)}.c{$(OBJDIR)}.obj:
484 {$(BFILEDIR)}.c{$(OBJDIR)}.obj:
487 {$(DFADIR)}.c{$(OBJDIR)}.obj:
490 {$(DICTDIR)}.c{$(OBJDIR)}.obj:
493 {$(ISAMSDIR)}.c{$(OBJDIR)}.obj:
496 {$(ISAMCDIR)}.c{$(OBJDIR)}.obj:
499 {$(ISAMBDIR)}.c{$(OBJDIR)}.obj:
502 {$(RSETDIR)}.c{$(OBJDIR)}.obj:
505 {$(UTILDIR)}.c{$(OBJDIR)}.obj:
508 {$(DATA1DIR)}.c{$(OBJDIR)}.obj:
513 $(ZSERVER) : "$(BINDIR)" $(ZSERVER_OBJS) $(IMPLIB)
518 $(ZEBRAIDX) : "$(BINDIR)" $(ZEBRAIDX_OBJS) $(IMPLIB)
523 $(TSTFLOCK) : "$(BINDIR)" $(TSTFLOCK_OBJS) $(IMPLIB)
529 RES=$(OBJDIR)\zebra.res
530 RC=$(WINDIR)\zebra.rc
541 $(RSC) $(RSOPT) /I"../include" /I"$(YAZDIR)\include" /fo"$(RES)" $(RC)
543 $(DLL) $(IMPLIB): "$(BINDIR)" $(ZEBRALIB_OBJS) $(RES)
547 $(DLL_LINK_OPTIONS) \
552 /implib:"$(IMPLIB)" \
553 /map:"$(LIBDIR)\idzebra.map" \
565 dirs: $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR)
567 $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR):
568 if not exist "$@/$(NUL)" mkdir "$@"
570 yaz: $(YAZ_DLL_TARGET)
572 $(YAZ_DLL_TARGET) : $(YAZ_DLL_SOURCE)
573 # copy "$(YAZBINDIR)\*.dll.manifest" $(BINDIR)
574 copy "$(YAZBINDIR)\*.dll" $(BINDIR)