root/main/trunk/greenstone2/runtime-src/src/z3950/win32.mak @ 22766

Revision 22766, 5.3 KB (checked in by mdewsnip, 10 years ago)

Instead of having two copies of expat in Greenstone (one for Linux and one for Windows), added Windows makefiles into the version in common-src/packages/expat. This means we can remove the Windows-only version in common-src/packages/windows/expat, and also means that expat now works the same as SQLite.

  • Property svn:executable set to *
Line 
1###########################################################################
2#
3# win32 makefile -- src/z3950
4# A component of the Greenstone digital library software
5# from the New Zealand Digital Library Project at the
6# University of Waikato, New Zealand.
7#
8# Copyright (C) 1999-2008  The New Zealand Digital Library Project
9#
10#
11# This program is free software; you can redistribute it and/or modify
12# it under the terms of the GNU General Public License as published by
13# the Free Software Foundation; either version 2 of the License, or
14# (at your option) any later version.
15#
16# This program is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with this program; if not, write to the Free Software
23# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24#
25###########################################################################
26
27GSDL_DIR = ..\..\..
28COMMON_DIR = $(GSDL_DIR)\common-src
29RUNTIME_DIR = $(GSDL_DIR)\runtime-src
30
31INDEXERS_DIR = $(COMMON_DIR)\indexers
32COMMON_PACKAGES_DIR = $(COMMON_DIR)\packages
33PACKAGES_DIR = $(RUNTIME_DIR)\packages
34COLSERVR_DIR = $(RUNTIME_DIR)\src\colservr
35PROTOCOL_DIR = $(RUNTIME_DIR)\src\protocol
36
37
38GSDL_VC4 = 0
39DEBUG = 0
40DLL = 0
41DLLDEBUG = 0
42ENABLE_ACCENTFOLD = 1
43USE_GDBM = 1
44USE_JDBM = 1
45USE_SQLITE = 1
46USE_MSSQL = 0
47ENABLE_MG = 1
48ENABLE_MGPP = 1
49ENABLE_LUCENE = 1
50
51!IF $(DEBUG)
52CXXFLAGS = -DEBUG -Z7 /errorReport:prompt
53!ELSE
54CXXFLAGS =
55!ENDIF
56
57!IF $(GSDL_VC4)
58CXXFLAGS = $(CXXFLAGS) -GX
59!ELSE
60CXXFLAGS = $(CXXFLAGS) -EHsc
61!ENDIF
62
63!IF $(DLL)
64CXXFLAGS = $(CXXFLAGS) -MD
65!ELSE
66!IF ($(DLLDEBUG))
67CXXFLAGS = $(CXXFLAGS) -MDd
68!ENDIF
69!ENDIF
70
71!IF $(ENABLE_ACCENTFOLD)
72ACCENTFOLD_LIBS = "$(INDEXERS_DIR)\packages\unac\libunac.lib" "$(INDEXERS_DIR)\packages\windows\iconv\iconv\lib\iconv.lib"
73!ELSE
74ACCENTFOLD_LIBS =
75!ENDIF
76
77!IF $(USE_GDBM)
78GDBM_INCLUDES = -I"$(COMMON_PACKAGES_DIR)\gdbm\gdbm-1.8.3" \
79    -I"$(COMMON_PACKAGES_DIR)\gdbm\gdbm-1.8.3\windows"
80GDBM_LIBS = "$(COMMON_PACKAGES_DIR)\gdbm\gdbm-1.8.3\gdbm.lib"
81GDBM_DEFINES = -DUSE_GDBM
82!ELSE
83GDBM_INCLUDES =
84GDBM_LIBS =
85GDBM_DEFINES =
86!ENDIF
87
88!IF $(USE_JDBM)
89JDBM_DEFINES = -DUSE_JDBM
90!ELSE
91JDBM_DEFINES =
92!ENDIF
93
94!IF $(USE_SQLITE)
95SQLITE_LIBS = "$(COMMON_PACKAGES_DIR)\sqlite\lib\sqlite3.lib"
96SQLITE_DEFINES = -DUSE_SQLITE
97!ELSE
98SQLITE_LIBS =
99SQLITE_DEFINES =
100!ENDIF
101
102!IF $(USE_MSSQL)
103MSSQL_DEFINES = -DUSE_MSSQL
104!ELSE
105MSSQL_DEFINES =
106!ENDIF
107
108!IF $(ENABLE_MG)
109MG_DEFS = -DENABLE_MG
110MG_LIBS = "$(INDEXERS_DIR)\mg\src\text\libmgtext.lib" \
111    "$(INDEXERS_DIR)\mg\lib\libmglib.lib"
112!ELSE
113MG_DEFS =
114MG_LIBS =
115!ENDIF
116
117!IF $(ENABLE_MGPP)
118MGPP_DEFS = -DENABLE_MGPP
119MGPP_LIBS = "$(INDEXERS_DIR)\mgpp\text\libmgpptext.lib" \
120    "$(INDEXERS_DIR)\mgpp\lib\libmgpplib.lib"
121MGPP_INCLUDES = -I"$(INDEXERS_DIR)\mgpp\text"
122!ELSE
123MGPP_DEFS =
124MGPP_LIBS =
125MGPP_INCLUDES =
126!ENDIF
127
128!IF $(ENABLE_LUCENE)
129LUCENE_DEFS = -DENABLE_LUCENE
130!ELSE
131LUCENE_DEFS=
132!ENDIF
133
134AR = lib
135CC = cl
136DEFS = -D__WIN32__ -DHAVE_CONFIG_H -DPARADOCNUM -D_LITTLE_ENDIAN -DSHORT_SUFFIX -D_CRT_SECURE_NO_DEPRECATE \
137    $(GDBM_DEFINES) $(JDBM_DEFINES) $(SQLITE_DEFINES) $(MSSQL_DEFINES) \
138    $(MG_DEFS) $(MGPP_DEFS) $(LUCENE_DEFS)
139# Do NOT add the "recpt" directory here: the z39.50 code should be independent of the receptionist!
140INCLUDES = -I"$(GSDL_DIR)" -I"$(COMMON_DIR)\src\lib" -I"$(COLSERVR_DIR)" -I"$(PROTOCOL_DIR)" \
141    $(MGPP_INCLUDES) -I"$(PACKAGES_DIR)\yaz\yaz-2.1.4\include" \
142    -I"$(PACKAGES_DIR)\yaz\yaz-2.1.4\client" -I"$(PACKAGES_DIR)\d2m" \
143    $(GDBM_INCLUDES)
144LDFLAGS =
145LIBS = "$(COMMON_PACKAGES_DIR)\expat\lib\libexpat.lib" $(GDBM_LIBS) \
146        "$(PACKAGES_DIR)\d2m\libd2m.lib" "$(PACKAGES_DIR)\yaz\yaz-2.1.4\lib\yaz.lib" $(ACCENTFOLD_LIBS) \
147    $(SQLITE_LIBS)
148
149!IF $(GSDL_VC4)
150DEFS=$(DEFS) -DGSDL_NAMESPACE_BROKEN -DGSDL_USE_IOS_H -D__STL_NO_NEW_IOSTREAMS
151INCLUDES = $(INCLUDES) -I"$(COMMON_PACKAGES_DIR)\windows\stlport\stlport"
152!ENDIF
153
154
155COMPILE = $(CC) -nologo -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
156LINK = $(CC) -nologo -Fe"$@" $(LDFLAGS)
157
158
159.SUFFIXES:
160.SUFFIXES: .c .obj
161.c.obj:
162    $(COMPILE) $<
163
164.SUFFIXES: .cpp .obj
165.cpp.obj:
166    $(COMPILE) $<
167
168
169LIBRARY_SOURCES = \
170    yaz_zclient.c \
171    z3950proto.cpp \
172    z3950proxy.cpp \
173    zparse.tab.c \
174    zparse.yy.c
175
176LIBRARY_OBJECTS = \
177    yaz_zclient.obj \
178    z3950proto.obj \
179    z3950proxy.obj \
180    zparse.tab.obj \
181    zparse.yy.obj
182
183LIBRARY = gsdlz3950.lib
184
185
186SOURCES = \
187    z3950explain.cpp \
188    z3950parser.cpp \
189    z3950server.cpp \
190    z3950_to_gsdl.cpp
191
192OBJECTS = \
193    z3950explain.obj \
194    z3950parser.obj \
195    z3950server.obj \
196    z3950_to_gsdl.obj
197
198GSDL_LIBS = \
199    gsdlz3950.lib \
200    $(PROTOCOL_DIR)\gsdlprotocol.lib \
201    $(COLSERVR_DIR)\gsdlcolservr.lib \
202    $(MG_LIBS) \
203    $(MGPP_LIBS) \
204    $(COMMON_DIR)\src\lib\gsdllib.lib
205
206EXECUTABLE_OBJECTS = \
207    $(OBJECTS) \
208    $(GSDL_LIBS)
209
210EXECUTABLE = z3950server.exe
211
212
213# Default target: make both gsdlz3950.lib and z3950server.exe
214all: $(LIBRARY) $(EXECUTABLE)
215
216gsdlz3950.lib: $(LIBRARY_OBJECTS)
217    if EXIST $(LIBRARY) del $(LIBRARY)
218    $(AR) -nologo /out:$(LIBRARY) $(LIBRARY_OBJECTS) $(PACKAGES_DIR)/yaz/yaz-2.1.4/win/obj/tabcomplete.obj
219
220z3950server.exe: $(EXECUTABLE_OBJECTS)
221    $(LINK) $(EXECUTABLE_OBJECTS) $(LIBS)
222
223install: $(EXECUTABLE)
224    copy $(EXECUTABLE) "$(GSDL_DIR)\bin\windows"
225
226clean:
227    del *.obj
228    del $(LIBRARY)
229    del $(EXECUTABLE)
Note: See TracBrowser for help on using the browser.