Win32/64 split. Use ICU compiled with VS2015
[yaz-moved-to-github.git] / win / makefile
index b82ddf4..933d902 100644 (file)
@@ -5,6 +5,7 @@
 
 DEBUG=0   # 0 for release, 1 for debug
 USE_MANIFEST = 0
+BARCH = 32 # 32=win32/x86 or 64=x64
 
 # TCL
 TCL=tclsh
@@ -13,23 +14,31 @@ HAVE_TCL=1
 
 # iconv charcter conversion utility
 HAVE_ICONV=0
-ICONV_DIR = c:\iconv-1.9.2.win32
+ICONV_DIR = c:\iconv-1.9.2.win$(BARCH)
 
 # icu charcter conversion utility
 # get icu libraries from http://www.icu-project.org
 HAVE_ICU=1
-ICU_VER=54
-ICU_LIB = c:\icu\lib
-ICU_BIN = c:\icu\bin
-ICU_INCLUDE = c:\icu\include
+ICU_VER=56
+ICU_BASE = c:\icu-56.1-vs2015
+!if $(BARCH) == 32
+ICU_LIB = $(ICU_BASE)\lib
+ICU_BIN = $(ICU_BASE)\bin
+!elseif $(BARCH) == 64
+ICU_LIB = $(ICU_BASE)\lib64
+ICU_BIN = $(ICU_BASE)\bin64
+!else
+!error BARCH must be 32 or 64
+!endif
+ICU_INCLUDE = $(ICU_BASE)\include
 
 # libxslt
 HAVE_LIBXSLT=1
-LIBXSLT_DIR=c:\libxslt-1.1.28.win32
+LIBXSLT_DIR=c:\libxslt-1.1.28.win$(BARCH)
 
 # libxml2
 HAVE_LIBXML2=1
-LIBXML2_DIR=c:\libxml2-2.9.2.win32
+LIBXML2_DIR=c:\libxml2-2.9.2.win$(BARCH)
 
 # get WIN32 binaries libxml2 & iconv & zlib from here:
 #  http://www.zlatkovic.com/libxml.en.html
@@ -43,8 +52,6 @@ default: all
 all: dirs generate dll sc_test client ztest yazicu zoomsh utilprog \
  testprog iconv icu libxml2 libxslt yaz_url
 
-allj: all yaz4j
-
 NSIS="c:\program files (x86)\nsis\makensis.exe"
 HHC="c:\program files (x86)\html help workshop\hhc.exe"
 
@@ -53,27 +60,26 @@ YAZ4J_DIR="..\..\yaz4j"
 YAZPATH="$(MAKEDIR)\.."
 
 
-dist: yaz.win32.nsi yaz.nsi distclean
-       nmake DEBUG=0 allj
-       $(NSIS) yaz.win32.nsi
+dist: yaz.nsi version.nsi distclean
+       nmake DEBUG=0 all yaz4j
+       nmake nsis
 
-dist64: yaz.win64.nsi yaz.nsi distclean
-       nmake make64
-       $(NSIS) yaz.win64.nsi
+dist64: yaz.nsi version.nsi distclean
+       nmake make64 yaz4j
+       nmake nsis64
 
 make64:
-       nmake DEBUG=0 HAVE_LIBXSLT=1 HAVE_LIBXML2=1 HAVE_ICONV=0 HAVE_ICU=1 LIBXML2_DIR=c:\libxml2-2.9.2.win64 LIBXSLT_DIR=c:\libxslt-1.1.28.win64 ICU_LIB=\icu\lib64 ICU_INCLUDE=\icu\include ICU_BIN=\icu\bin64 YAZ4J_DIR=..\..\..\yaz4j allj
-
+       nmake DEBUG=0 BARCH=64 all
 
 distclean:
        nmake DEBUG=1 clean
        nmake DEBUG=0 clean
 
-nsis: all yaz.win32.nsi
-       $(NSIS) yaz.win32.nsi
+nsis: version.nsi
+       $(NSIS) /DVSARCH=x86 /DVSVER=14 yaz.nsi
 
-nsis64: yaz.win64.nsi
-       $(NSIS) yaz.win64.nsi
+nsis64: version.nsi
+       $(NSIS) /DVSARCH=x64 /DVSVER=14 yaz.nsi
 
 nsishelp:
        $(NSIS)
@@ -486,6 +492,7 @@ MISC_OBJS= \
    $(OBJDIR)\charneg.obj \
    $(OBJDIR)\grs1disp.obj \
    $(OBJDIR)\opac_to_xml.obj \
+   $(OBJDIR)\xml_get.obj \
    $(OBJDIR)\xml_add.obj \
    $(OBJDIR)\xml_match.obj \
    $(OBJDIR)\xml_to_opac.obj \
@@ -874,6 +881,9 @@ $(INCLDIR)\yaz\yaz-version.h: $(ROOTDIR)/IDMETA
        @cd $(SRCDIR)
        $(TCL) mk_version.tcl $(ROOTDIR)/IDMETA $(INCLDIR)\yaz\yaz-version.h
 
+version.nsi: $(ROOTDIR)/IDMETA
+       $(TCL) $(SRCDIR)/mk_version.tcl $(ROOTDIR)/IDMETA version.nsi
+
 
 !endif