1 # This file is part of Pazpar2.
2 # Copyright (C) 2006-2011 Index Data
4 DEBUG=0 # 0 for release, 1 for debug
5 USE_MANIFEST = 1 # Can be enabled Visual Studio 2005/2008
12 # Libxml2 + libxslt + associates
13 ZLIB_DIR=\zlib-1.2.3.win32
14 ICONV_DIR=\iconv-1.9.2.win32
15 LIBXML2_DIR=\libxml2-2.7.6.win32
16 LIBXSLT_DIR=\libxslt-1.1.26.win32
24 all: dirs yaz libxslt pazpar2
26 NSIS="c:\program files\nsis\makensis.exe"
43 BINDIR=$(ROOTDIR)\bin # We produce exes and dlls there
44 WINDIR=$(ROOTDIR)\win # all these Win make things
45 SRCDIR=$(ROOTDIR)\src # for the case we move them under src
53 TMPDIR=$(ROOTDIR)\win\tmp
56 PAZPAR2_EXE=$(BINDIR)\pazpar2.exe
58 pazpar2: $(PAZPAR2_EXE)
60 YAZBINDIR=$(YAZ_DIR)\bin
62 YAZ_LIB="$(YAZ_DIR)\lib\yaz4d.lib" "$(YAZ_DIR)\lib\yaz_cond4d.lib"
64 YAZ_LIB=$(YAZ_LIB) "$(YAZ_DIR)\lib\yaz_icu4d.lib"
66 YAZ_DLL_SOURCE="$(YAZBINDIR)\yaz4d.dll"
67 YAZ_DLL_TARGET="$(BINDIR)\yaz4d.dll"
69 YAZ_LIB="$(YAZ_DIR)\lib\yaz4.lib" "$(YAZ_DIR)\lib\yaz_cond4.lib"
71 YAZ_LIB=$(YAZ_LIB) "$(YAZ_DIR)\lib\yaz_icu4.lib"
73 YAZ_DLL_SOURCE="$(YAZBINDIR)\yaz4.dll"
74 YAZ_DLL_TARGET="$(BINDIR)\yaz4.dll"
77 YAZ_DEF=/DYAZ_HAVE_XML2=2 /DYAZ_HAVE_XSLT=1 /I"$(YAZ_DIR)\include"
79 # Copy libxslt and associates to our bin directory
80 libxslt: $(BINDIR)\libxslt.dll
82 $(BINDIR)\libxslt.dll: "$(LIBXSLT_DIR)\bin\libxslt.dll"
83 copy "$(ICONV_DIR)\bin\iconv.dll" $(BINDIR)
84 copy "$(ZLIB_DIR)\bin\zlib1.dll" $(BINDIR)
85 copy "$(LIBXML2_DIR)\bin\libxml2.dll" $(BINDIR)
86 copy "$(LIBXSLT_DIR)\bin\libxslt.dll" $(BINDIR)
90 /I"$(ICONV_DIR)\include" \
91 /I"$(LIBXML2_DIR)\include" \
92 /I"$(LIBXSLT_DIR)\include"
95 "$(ICONV_DIR)\lib\iconv.lib" \
96 "$(LIBXML2_DIR)\lib\libxml2.lib" \
97 "$(LIBXSLT_DIR)\lib\libxslt.lib"
100 ICU_DEF=/DYAZ_HAVE_ICU=1 /I"$(ICU_DIR)\include"
101 ICU_LIB= $(ICU_DIR)\lib\icudt.lib \
102 $(ICU_DIR)\lib\icuin.lib \
103 $(ICU_DIR)\lib\icuuc.lib
105 ICU_DEF=/DYAZ_HAVE_ICU=0
110 /nologo /W3 /EHsc /FD /c \
111 /D "_CRT_SECURE_NO_DEPRECATE" \
112 /D "PACKAGE_VERSION=\"$(PACKAGE_VERSION)\"" \
113 /D "PACKAGE_NAME=\"$(PACKAGE_NAME)\"" \
114 /D "VERSION=\"$(PACKAGE_VERSION)\"" \
120 /D "HAVE_WCHAR_H=1" \
126 /I"$(ROOTDIR)\include"
136 # /W3 = warning level
137 # /GX = Enable exception handling
138 # /FD = Generate file dependencies (what ever they are)
139 # /c = compile without linking
140 # /FR = Generate browse info (.sbr file that gets combined into .bsc)
141 # /Fo = object file name (or at least path)
142 # /Fd = debug database name (or path)
143 # /MD = Runtime library: Multithread DLL
144 # /MDd = Runtime library: Multithread DLL (debug)
145 # /Od = Disable optimising (debug)
146 # /O2 = Optimize for speed
147 # /Gm = Minimal rebuild (some cpp class stuff)
148 # /Zi = Program database for debuggers
149 # /ZI = Pgm database with special "edit&continue" stuff - not available in C5
155 LINK_LIBS= kernel32.lib ws2_32.lib advapi32.lib \
156 $(YAZ_LIB) $(ICU_LIB) $(LIBXSLT_LIB)
158 COMMON_LNK_OPTIONS= /nologo /subsystem:windows /machine:i386 /incremental:no
160 DEBUG_LNK_OPTIONS= /debug
164 CLIENT_LINK_OPTIONS = /subsystem:console
166 # Final opt variables
168 COPT= $(COMMON_C_OPTIONS) $(DEBUG_C_OPTIONS) $(COMMON_C_INCLUDES)
169 RCOPT= $(COMMON_RC_OPTIONS) $(DEBUG_RC_OPTIONS)
170 LNKOPT= $(COMMON_LNK_OPTIONS) $(DEBUG_LNK_OPTIONS) $(LNK_LIBS)
173 COPT= $(COMMON_C_OPTIONS) $(RELEASE_C_OPTIONS) $(COMMON_C_INCLUDES)
174 RCOPT= $(COMMON_RC_OPTIONS) $(RELEASE_RC_OPTIONS)
175 LNKOPT= $(COMMON_LNK_OPTIONS) $(RELEASE_LNK_OPTIONS) $(LNK_LIBS)
178 # Source and object modules
181 "$(OBJDIR)\pazpar2.obj" \
182 "$(OBJDIR)\pazpar2_config.obj" \
183 "$(OBJDIR)\http.obj" \
184 "$(OBJDIR)\eventl.obj" \
185 "$(OBJDIR)\http_command.obj" \
186 "$(OBJDIR)\session.obj" \
187 "$(OBJDIR)\record.obj" \
188 "$(OBJDIR)\reclists.obj" \
189 "$(OBJDIR)\relevance.obj" \
190 "$(OBJDIR)\termlists.obj" \
191 "$(OBJDIR)\normalize7bit.obj" \
192 "$(OBJDIR)\zeerex.obj" \
193 "$(OBJDIR)\database.obj" \
194 "$(OBJDIR)\settings.obj" \
195 "$(OBJDIR)\getaddrinfo.obj" \
196 "$(OBJDIR)\charsets.obj" \
197 "$(OBJDIR)\client.obj" \
198 "$(OBJDIR)\jenkins_hash.obj" \
199 "$(OBJDIR)\marcmap.obj" \
200 "$(OBJDIR)\marchash.obj" \
201 "$(OBJDIR)\normalize_record.obj" \
202 "$(OBJDIR)\normalize_cache.obj" \
203 "$(OBJDIR)\ppmutex.obj" \
204 "$(OBJDIR)\incref.obj" \
205 "$(OBJDIR)\sel_thread.obj" \
206 "$(OBJDIR)\connection.obj"
209 {$(SRCDIR)}.c{$(OBJDIR)}.obj:
220 LINK_PROGRAM = $(LINK) $(LNKOPT) $(CLIENT_LINK_OPTIONS) $(LINK_LIBS)
223 $(PAZPAR2_EXE) : "$(BINDIR)" $(PAZPAR2_OBJS) $(YAZ_LIB)
224 $(LINK_PROGRAM) $(PAZPAR2_OBJS) /out:$@
225 $(MT) -manifest $@.manifest -outputresource:$@;1
232 dirs: $(OBJDIR) $(WINDIR) $(BINDIR) $(TMPDIR)
234 $(OBJDIR) $(WINDIR) $(BINDIR) $(TMPDIR):
235 if not exist "$@/$(NUL)" mkdir "$@"
237 yaz: $(YAZ_DLL_TARGET)
239 $(YAZ_DLL_TARGET) : $(YAZ_DLL_SOURCE)
240 # copy "$(YAZBINDIR)\*.dll.manifest" $(BINDIR)
241 copy "$(YAZBINDIR)\*.dll" $(BINDIR)